| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <protocol name="wlr_gamma_control_unstable_v1"> |
| 3 | <copyright> |
| 4 | Copyright © 2015 Giulio camuffo |
| 5 | Copyright © 2018 Simon Ser |
| 6 | |
| 7 | Permission to use, copy, modify, distribute, and sell this |
| 8 | software and its documentation for any purpose is hereby granted |
| 9 | without fee, provided that the above copyright notice appear in |
| 10 | all copies and that both that copyright notice and this permission |
| 11 | notice appear in supporting documentation, and that the name of |
| 12 | the copyright holders not be used in advertising or publicity |
| 13 | pertaining to distribution of the software without specific, |
| 14 | written prior permission. The copyright holders make no |
| 15 | representations about the suitability of this software for any |
| 16 | purpose. It is provided "as is" without express or implied |
| 17 | warranty. |
| 18 | |
| 19 | THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS |
| 20 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 21 | FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 22 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 23 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
| 24 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
| 25 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF |
| 26 | THIS SOFTWARE. |
| 27 | </copyright> |
| 28 | |
| 29 | <description summary="manage gamma tables of outputs"> |
| 30 | This protocol allows a privileged client to set the gamma tables for |
| 31 | outputs. |
| 32 | |
| 33 | Warning! The protocol described in this file is experimental and |
| 34 | backward incompatible changes may be made. Backward compatible changes |
| 35 | may be added together with the corresponding interface version bump. |
| 36 | Backward incompatible changes are done by bumping the version number in |
| 37 | the protocol and interface names and resetting the interface version. |
| 38 | Once the protocol is to be declared stable, the 'z' prefix and the |
| 39 | version number in the protocol and interface names are removed and the |
| 40 | interface version number is reset. |
| 41 | </description> |
| 42 | |
| 43 | <interface name="zwlr_gamma_control_manager_v1" version="1"> |
| 44 | <description summary="manager to create per-output gamma controls"> |
| 45 | This interface is a manager that allows creating per-output gamma |
| 46 | controls. |
| 47 | </description> |
| 48 | |
| 49 | <request name="get_gamma_control"> |
| 50 | <description summary="get a gamma control for an output"> |
| 51 | Create a gamma control that can be used to adjust gamma tables for the |
| 52 | provided output. |
| 53 | </description> |
| 54 | <arg name="id" type="new_id" interface="zwlr_gamma_control_v1"/> |
| 55 | <arg name="output" type="object" interface="wl_output"/> |
| 56 | </request> |
| 57 | |
| 58 | <request name="destroy" type="destructor"> |
| 59 | <description summary="destroy the manager"> |
| 60 | All objects created by the manager will still remain valid, until their |
| 61 | appropriate destroy request has been called. |
| 62 | </description> |
| 63 | </request> |
| 64 | </interface> |
| 65 | |
| 66 | <interface name="zwlr_gamma_control_v1" version="1"> |
| 67 | <description summary="adjust gamma tables for an output"> |
| 68 | This interface allows a client to adjust gamma tables for a particular |
| 69 | output. |
| 70 | |
| 71 | The client will receive the gamma size, and will then be able to set gamma |
| 72 | tables. At any time the compositor can send a failed event indicating that |
| 73 | this object is no longer valid. |
| 74 | |
| 75 | There can only be at most one gamma control object per output, which |
| 76 | has exclusive access to this particular output. When the gamma control |
| 77 | object is destroyed, the gamma table is restored to its original value. |
| 78 | </description> |
| 79 | |
| 80 | <event name="gamma_size"> |
| 81 | <description summary="size of gamma ramps"> |
| 82 | Advertise the size of each gamma ramp. |
| 83 | |
| 84 | This event is sent immediately when the gamma control object is created. |
| 85 | </description> |
| 86 | <arg name="size" type="uint" summary="number of elements in a ramp"/> |
| 87 | </event> |
| 88 | |
| 89 | <enum name="error"> |
| 90 | <entry name="invalid_gamma" value="1" summary="invalid gamma tables"/> |
| 91 | </enum> |
| 92 | |
| 93 | <request name="set_gamma"> |
| 94 | <description summary="set the gamma table"> |
| 95 | Set the gamma table. The file descriptor can be memory-mapped to provide |
| 96 | the raw gamma table, which contains successive gamma ramps for the red, |
| 97 | green and blue channels. Each gamma ramp is an array of 16-byte unsigned |
| 98 | integers which has the same length as the gamma size. |
| 99 | |
| 100 | The file descriptor data must have the same length as three times the |
| 101 | gamma size. |
| 102 | </description> |
| 103 | <arg name="fd" type="fd" summary="gamma table file descriptor"/> |
| 104 | </request> |
| 105 | |
| 106 | <event name="failed"> |
| 107 | <description summary="object no longer valid"> |
| 108 | This event indicates that the gamma control is no longer valid. This |
| 109 | can happen for a number of reasons, including: |
| 110 | - The output doesn't support gamma tables |
| 111 | - Setting the gamma tables failed |
| 112 | - Another client already has exclusive gamma control for this output |
| 113 | - The compositor has transferred gamma control to another client |
| 114 | |
| 115 | Upon receiving this event, the client should destroy this object. |
| 116 | </description> |
| 117 | </event> |
| 118 | |
| 119 | <request name="destroy" type="destructor"> |
| 120 | <description summary="destroy this control"> |
| 121 | Destroys the gamma control object. If the object is still valid, this |
| 122 | restores the original gamma tables. |
| 123 | </description> |
| 124 | </request> |
| 125 | </interface> |
| 126 | </protocol> |