SDL
102 строки · 4.5 Кб
1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="fractional_scale_v1">3<copyright>4Copyright © 2022 Kenny Levinsen
5
6Permission is hereby granted, free of charge, to any person obtaining a
7copy of this software and associated documentation files (the "Software"),
8to deal in the Software without restriction, including without limitation
9the rights to use, copy, modify, merge, publish, distribute, sublicense,
10and/or sell copies of the Software, and to permit persons to whom the
11Software is furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice (including the next
14paragraph) shall be included in all copies or substantial portions of the
15Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23DEALINGS IN THE SOFTWARE.
24</copyright>25
26<description summary="Protocol for requesting fractional surface scales">27This protocol allows a compositor to suggest for surfaces to render at
28fractional scales.
29
30A client can submit scaled content by utilizing wp_viewport. This is done by
31creating a wp_viewport object for the surface and setting the destination
32rectangle to the surface size before the scale factor is applied.
33
34The buffer size is calculated by multiplying the surface size by the
35intended scale.
36
37The wl_surface buffer scale should remain set to 1.
38
39If a surface has a surface-local size of 100 px by 50 px and wishes to
40submit buffers with a scale of 1.5, then a buffer of 150px by 75 px should
41be used and the wp_viewport destination rectangle should be 100 px by 50 px.
42
43For toplevel surfaces, the size is rounded halfway away from zero. The
44rounding algorithm for subsurface position and size is not defined.
45</description>46
47<interface name="wp_fractional_scale_manager_v1" version="1">48<description summary="fractional surface scale information">49A global interface for requesting surfaces to use fractional scales.
50</description>51
52<request name="destroy" type="destructor">53<description summary="unbind the fractional surface scale interface">54Informs the server that the client will not be using this protocol
55object anymore. This does not affect any other objects,
56wp_fractional_scale_v1 objects included.
57</description>58</request>59
60<enum name="error">61<entry name="fractional_scale_exists" value="0"62summary="the surface already has a fractional_scale object associated"/>63</enum>64
65<request name="get_fractional_scale">66<description summary="extend surface interface for scale information">67Create an add-on object for the the wl_surface to let the compositor
68request fractional scales. If the given wl_surface already has a
69wp_fractional_scale_v1 object associated, the fractional_scale_exists
70protocol error is raised.
71</description>72<arg name="id" type="new_id" interface="wp_fractional_scale_v1"73summary="the new surface scale info interface id"/>74<arg name="surface" type="object" interface="wl_surface"75summary="the surface"/>76</request>77</interface>78
79<interface name="wp_fractional_scale_v1" version="1">80<description summary="fractional scale interface to a wl_surface">81An additional interface to a wl_surface object which allows the compositor
82to inform the client of the preferred scale.
83</description>84
85<request name="destroy" type="destructor">86<description summary="remove surface scale information for surface">87Destroy the fractional scale object. When this object is destroyed,
88preferred_scale events will no longer be sent.
89</description>90</request>91
92<event name="preferred_scale">93<description summary="notify of new preferred scale">94Notification of a new preferred scale for this surface that the
95compositor suggests that the client should use.
96
97The sent scale is the numerator of a fraction with a denominator of 120.
98</description>99<arg name="scale" type="uint" summary="the new preferred scale"/>100</event>101</interface>102</protocol>103