| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <protocol name="kywc_capture_v1"> |
| 3 | <copyright><![CDATA[ |
| 4 | SPDX-FileCopyrightText: 2024 KylinSoft Co., Ltd. |
| 5 | SPDX-License-Identifier: MulanPSL-2.0 |
| 6 | ]]></copyright> |
| 7 | |
| 8 | <interface name="kywc_capture_manager_v1" version="2"> |
| 9 | <description summary="manager to inform clients and begin get capturing"> |
| 10 | This object is a manager which offers requests to start capturing from a source. |
| 11 | </description> |
| 12 | |
| 13 | <request name="capture_output"> |
| 14 | <description summary="capture an output"> |
| 15 | Capture the next frame of an entire output. |
| 16 | </description> |
| 17 | <arg name="frame" type="new_id" interface="kywc_capture_frame_v1"/> |
| 18 | <arg name="overlay_cursor" type="int" summary="composite cursor onto the frame"/> |
| 19 | <arg name="output" type="string" summary="unique id for an output"/> |
| 20 | </request> |
| 21 | |
| 22 | <request name="capture_workspace"> |
| 23 | <description summary="capture a workspace"> |
| 24 | Capture the next frame of an entire workspace in one output. |
| 25 | </description> |
| 26 | <arg name="frame" type="new_id" interface="kywc_capture_frame_v1"/> |
| 27 | <arg name="workspace" type="string" summary="unique id for workspace"/> |
| 28 | <arg name="output" type="string" summary="unique id for output"/> |
| 29 | </request> |
| 30 | |
| 31 | <request name="capture_toplevel"> |
| 32 | <description summary="capture a toplevel"> |
| 33 | Capture the next frame of an entire toplevel. |
| 34 | </description> |
| 35 | <arg name="frame" type="new_id" interface="kywc_capture_frame_v1"/> |
| 36 | <arg name="toplevel" type="string" summary="unique id for toplevel"/> |
| 37 | <arg name="without_decoration" type="uint" summary="no decoration"/> |
| 38 | </request> |
| 39 | |
| 40 | <request name="capture_cursor"> |
| 41 | <description summary="capture a cursor"> |
| 42 | Capture the cursor of the seat and frame. |
| 43 | </description> |
| 44 | <arg name="cursor" type="new_id" interface= "kywc_capture_cursor_v1"/> |
| 45 | <arg name="seat" type="object" interface= "wl_seat"/> |
| 46 | <arg name="frame" type="object" interface="kywc_capture_frame_v1" allow-null="true"/> |
| 47 | </request> |
| 48 | |
| 49 | <request name="destroy" type="destructor"> |
| 50 | <description summary="destroy the manager"> |
| 51 | All objects created by the manager will still remain valid, until their |
| 52 | appropriate destroy request has been called. |
| 53 | </description> |
| 54 | </request> |
| 55 | </interface> |
| 56 | |
| 57 | <interface name="kywc_capture_frame_v1" version="2"> |
| 58 | <description summary="a frame ready for copy"> |
| 59 | </description> |
| 60 | |
| 61 | <request name="destroy" type="destructor"> |
| 62 | <description summary="delete this object, used or not"> |
| 63 | Destroys the frame. This request can be sent at any time by the client. |
| 64 | </description> |
| 65 | </request> |
| 66 | |
| 67 | <event name="failed"> |
| 68 | <description summary="frame copy failed"> |
| 69 | This event indicates that the attempted frame copy has failed. |
| 70 | After receiving this event, the client should destroy the object. |
| 71 | </description> |
| 72 | </event> |
| 73 | |
| 74 | <event name="cancelled"> |
| 75 | <description summary="frame copy has been cancelled"> |
| 76 | Sent if the compositor cancels the frame because the source has gone. |
| 77 | Upon receiving this event, the client should destroy this object. |
| 78 | </description> |
| 79 | </event> |
| 80 | |
| 81 | <enum name="flags" bitfield="true"> |
| 82 | <entry name="dmabuf" value="1" summary="buffer is a dmabuf"/> |
| 83 | <entry name="reused" value="2" summary="buffer is reused"/> |
| 84 | </enum> |
| 85 | |
| 86 | <event name="buffer"> |
| 87 | <description summary="buffer information"> |
| 88 | Provides information about buffer parameters that need to be |
| 89 | used for this frame. |
| 90 | </description> |
| 91 | <arg name="fd" type="fd" summary="buffer file descriptor"/> |
| 92 | <arg name="format" type="uint" summary="DRM_FORMAT code"/> |
| 93 | <arg name="width" type="uint" summary="buffer width in pixels"/> |
| 94 | <arg name="height" type="uint" summary="buffer height in pixels"/> |
| 95 | <arg name="offset" type="uint" summary="buffer offset in bytes"/> |
| 96 | <arg name="stride" type="uint" summary="buffer stride in bytes"/> |
| 97 | <arg name="modifier_hi" type="uint" summary="high 32 bits of layout modifier"/> |
| 98 | <arg name="modifier_lo" type="uint" summary="low 32 bits of layout modifier"/> |
| 99 | <arg name="flags" type="uint" enum="flags" summary="buffer flags"/> |
| 100 | </event> |
| 101 | |
| 102 | <request name="release_buffer"> |
| 103 | <description summary="buffer is not used anymore"> |
| 104 | Mark the buffer is not used by client. This request is sent after buffer event. |
| 105 | </description> |
| 106 | <arg name="want_buffer" type="uint" summary="request send buffer event when buffer is changed"/> |
| 107 | </request> |
| 108 | |
| 109 | <event name="buffer_with_plane" since="2"> |
| 110 | <description summary="buffer information with plane"> |
| 111 | Provides information about buffer parameters with the plane index |
| 112 | that need to be used for this frame. |
| 113 | </description> |
| 114 | <arg name="index" type="uint" summary="plane index"/> |
| 115 | <arg name="fd" type="fd" summary="buffer file descriptor"/> |
| 116 | <arg name="offset" type="uint" summary="buffer offset in bytes"/> |
| 117 | <arg name="stride" type="uint" summary="buffer stride in bytes"/> |
| 118 | </event> |
| 119 | |
| 120 | <event name="buffer_done" since="2"> |
| 121 | <description summary="all buffer parameters have been sent"> |
| 122 | </description> |
| 123 | </event> |
| 124 | </interface> |
| 125 | |
| 126 | <interface name="kywc_capture_cursor_v1" version="2"> |
| 127 | <description summary="cursor handle"> |
| 128 | When the seat or frame is destroyed, this object becomes inert. |
| 129 | </description> |
| 130 | |
| 131 | <request name="destroy" type="destructor"> |
| 132 | <description summary="delete this object"> |
| 133 | Destroys the object. This request can be sent at any time by the client. |
| 134 | </description> |
| 135 | </request> |
| 136 | |
| 137 | <event name="enter"> |
| 138 | <description summary="cursor entered a frame"> |
| 139 | This event indicates that when a cursor enters the frame. It shall be |
| 140 | generated before the "position" and "hotspot" events. |
| 141 | |
| 142 | If the pointer object referenced by the seat does not exist, this event |
| 143 | will not be triggered. |
| 144 | </description> |
| 145 | </event> |
| 146 | |
| 147 | <event name="leave"> |
| 148 | <description summary="cursor left frame"> |
| 149 | This event indicates that when a cursor leaves the frame. No "position" or |
| 150 | "hotspot" event is generated for the cursor until the cursor enters the |
| 151 | frame again. |
| 152 | |
| 153 | If the pointer object referenced by the seat is removed, this event will be sent. |
| 154 | </description> |
| 155 | </event> |
| 156 | |
| 157 | <event name="position"> |
| 158 | <description summary="informs cursor position"> |
| 159 | This event informs the cursor position. The given position is |
| 160 | relative to the frame's top left corner in transformed buffer |
| 161 | pixel coordinates. |
| 162 | |
| 163 | Note, if the frame parameter is set to null in the capture_cursor request, |
| 164 | the given position coordinates are global. |
| 165 | </description> |
| 166 | <arg name="x" type="int" summary="position x coordinates"/> |
| 167 | <arg name="y" type="int" summary="position y coordinates"/> |
| 168 | </event> |
| 169 | |
| 170 | <event name="hotspot"> |
| 171 | <description summary="informs cursor hotspot"> |
| 172 | This event informs the cursor hotspot. The hotspot describes the offset |
| 173 | between the cursor image and the position of the input device. |
| 174 | |
| 175 | The parameters x and y represent the offset of the new hotspot relative |
| 176 | to the origin of the cursor image, which is typically the top-left corner |
| 177 | of the image. |
| 178 | </description> |
| 179 | <arg name="x" type="int" summary="hotspot x coordinates"/> |
| 180 | <arg name="y" type="int" summary="hotspot y coordinates"/> |
| 181 | </event> |
| 182 | </interface> |
| 183 | </protocol> |