[PATCH 1/6] Add weston randr protocol

Quanxian Wang quanxian.wang at intel.com
Wed Feb 26 19:28:00 PST 2014


Weston protocol wrandr will provide interface to
1) set output mode
2) set output transform
3) move output to relative position
4) provide disconnected display port information

*Dynamic* mode setting is the main objective of this protocol.
Remember, it is one shot operation. For example, if setting the mode,
just call one request wl_randr_set_mode without any other operation.

Signed-off-by: Quanxian Wang <quanxian.wang at intel.com>
Reviewed-by: Zhang, Xiong Y <xiong.y.zhang at intel.com>
---
 protocol/Makefile.am |   1 +
 protocol/randr.xml   | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+)
 create mode 100644 protocol/randr.xml

diff --git a/protocol/Makefile.am b/protocol/Makefile.am
index 5e331a7..df2e070 100644
--- a/protocol/Makefile.am
+++ b/protocol/Makefile.am
@@ -5,6 +5,7 @@ protocol_sources =				\
 	text.xml				\
 	input-method.xml			\
 	workspaces.xml				\
+	randr.xml				\
 	text-cursor-position.xml		\
 	wayland-test.xml			\
 	xdg-shell.xml				\
diff --git a/protocol/randr.xml b/protocol/randr.xml
new file mode 100644
index 0000000..f15e87a
--- /dev/null
+++ b/protocol/randr.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="randr">
+
+  <copyright>
+    Copyright © 2012-2013 Collabora, Ltd.
+
+    Permission to use, copy, modify, distribute, and sell this
+    software and its documentation for any purpose is hereby granted
+    without fee, provided that the above copyright notice appear in
+    all copies and that both that copyright notice and this permission
+    notice appear in supporting documentation, and that the name of
+    the copyright holders not be used in advertising or publicity
+    pertaining to distribution of the software without specific,
+    written prior permission.  The copyright holders make no
+    representations about the suitability of this software for any
+    purpose.  It is provided "as is" without express or implied
+    warranty.
+
+    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+    THIS SOFTWARE.
+  </copyright>
+
+  <interface name="wl_randr" version="1">
+    <description summary="randr">
+      The global interface exposing randr capabilities.
+      As a wl_randr, that provides the interfaces for apps to more operations
+      on output.
+
+      The aim of wl_randr is to get modes list, choose preferred mode,
+      layout the output including position, rotate, and en/disable.
+      The idea is from xrandr protocoal of xserver. It is very convenient for
+      weston/wayland user to operates on mode setting of output.
+    </description>
+
+    <enum name="error">
+      <entry name="bad_randr" value="0"
+             summary="the to-be wl_randr is invalid"/>
+    </enum>
+
+    <request name="destroy" type="destructor">
+      <description summary="unbind from the wl_randr interface">
+	Informs the server that the client will not be using this
+	protocol object anymore. This does not affect any other
+	objects, wl_randr objects included.
+      </description>
+    </request>
+
+    <request name="set_mode">
+      <description summary="set the mode of output">
+	set the mode of output
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="the output object"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="set_transform">
+      <description summary="set the transform of output">
+	set the transform of output
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="the output object"/>
+      <arg name="transform" type="uint"
+           summary="the value should be between 0-7"/>
+    </request>
+
+    <enum name="move">
+      <description summary="move target output to the position of source output">
+	The purpose is mainly to allow clients move target output to
+        the position of source output.
+      </description>
+      <entry name="rightof" value="0"/>
+      <entry name="leftof" value="1"/>
+    </enum>
+
+    <request name="move">
+      <description summary="move target output">
+	position the target output leftof/rightof source output
+      </description>
+      <arg name="target_output" type="object" interface="wl_output"
+           summary="the target output object"/>
+      <arg name="source_output" type="object" interface="wl_output"
+           summary="the source output object"/>
+      <arg name="move" type="int"/>
+    </request>
+
+    <request name="get_disoutputs">
+      <description summary="disconnected output information">
+	get the disconnected display port information
+      </description>
+    </request>
+
+    <request name="get_output_name">
+      <description summary="output name">
+	get the output name
+      </description>
+      <arg name="wl_output" type="object" interface="wl_output"/>
+    </request>
+
+    <event name="output_name">
+      <description summary="output name">
+	get output name of wl_output
+      </description>
+      <arg name="output" type="object" interface="wl_output"/>
+      <arg name="name" type="string"/>
+    </event>
+
+    <enum name="action">
+      <description summary="action">
+	Actions have been taken.
+      </description>
+      <entry name="move" value="0"/>
+      <entry name="transform" value="1"/>
+      <entry name="mode" value="2"/>
+    </enum>
+
+    <enum name="result">
+      <description summary="action result">
+	Action result
+      </description>
+      <entry name="FAIL" value="-1"/>
+      <entry name="SUCCESS" value="1"/>
+      <entry name="NOACT" value="2"/>
+    </enum>
+
+    <event name="action_done">
+      <description summary="action done event">
+	Notify the randr client mode set done.
+      </description>
+      <arg name="flags" type="uint"
+           summary="which action is done"/>
+      <arg name="result" type="int"/>
+    </event>
+
+    <event name="disoutputs">
+      <description summary="disconnected output string event">
+	Send back disconnected outputs information.
+      </description>
+      <arg name="output" type="string"/>
+    </event>
+  </interface>
+
+</protocol>
-- 
1.8.1.2



More information about the wayland-devel mailing list