[PATCH V3 1/7] weston: Add weston randr protocol

Quanxian Wang quanxian.wang at intel.com
Mon Apr 7 22:03:15 PDT 2014


Weston randr protocol will provide interfaces to
1) Mode set of output (scale, transform, mode setting)
   For mode setting, three match methods are provided.
2) Position of output (currently support leftof, rightof)
   More need to be done, above, below and any positoion of output with (x,y).
3) New a custom mode
   This action will bind with output automatically.
4) Delete mode
   Three match methods are provided.
5) Provide a set of actions above in one shot
   1-4 actions could be combined together in one shot.
6) Support multiple outputs operation with one commit.
   The result event will be sent with output parameter one by one.

This protocol is not exposed to public. It is only for
QA testing and Admin configuration currently.

Signed-off-by: Quanxian Wang <quanxian.wang at intel.com>
---
 protocol/Makefile.am |   1 +
 protocol/randr.xml   | 260 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 261 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..5ac508a
--- /dev/null
+++ b/protocol/randr.xml
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="randr">
+
+  <copyright>
+    Copyright © 2014 Quanxian Wang
+    Copyright © 2014 Intel Corporation
+
+    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="wrandr_type" version="1">
+    <description summary="Weston randr data type">
+      This interface is to define the data type used by weston randr protocol.
+    </description>
+
+    <enum name="wop">
+      <description summary="Compositor operation type">
+	Weston operation type
+      </description>
+      <entry name="configure" value="1"/>
+    </enum>
+
+    <enum name="oop">
+      <description summary="Output operation type">
+	Output operation type
+      </description>
+      <entry name="modenum" value="0"/>
+      <entry name="mode" value="1"/>
+      <entry name="movel"  value="3" summary="move left"/>
+      <entry name="mover"  value="4" summary="move right"/>
+      <entry name="movea"  value="5" summary="move above"/>
+      <entry name="moveb"  value="6" summary="move below"/>
+      <entry name="transform" value="7"/>
+      <entry name="scale" value="8"/>
+      <entry name="newmode" value="9"/>
+      <entry name="newtiming" value="10"/>
+      <entry name="delmodenum" value="11"/>
+      <entry name="delmode" value="12"/>
+    </enum>
+
+    <enum name="ret">
+      <description summary="Weston randr return value">
+	Weston randr operation return type
+      </description>
+      <entry name="SUCCESS" value="1"/>
+      <entry name="FAIL" value="2"/>
+      <entry name="NOACT" value="3"/>
+    </enum>
+  </interface>
+
+  <interface name="weston_randr" version="1">
+    <description summary="Weston randr interface">
+	The weston randr interface provides output property setting
+	capabilities. The properties include output mode setting,
+	scale, transform, layout, and etc. The interface is not
+	exposed to public while it is designed for QA testing and Admin.
+	This interface refers to the design idea of xrandr protocol.
+    </description>
+
+    <request name="destroy" type="destructor">
+      <description summary="Unbind from the weston_randr interface">
+	Destroy the weston_randr object which will not be used anymore.
+      </description>
+    </request>
+
+    <enum name="mode">
+      <description summary="Mode flag">
+	The flag describes properties of an output mode.
+	Once clients get the mode change with these flags,
+	they should take the related action. For example,
+	del flag tells clients that mode is not used anymore.
+	Clients should delete it at once.
+      </description>
+      <entry name="custom" value="0x1000"
+	     summary="The mode is customed by client."/>
+      <entry name="del" value="0x2000"
+	     summary="The mode is deleted and not used any more."/>
+    </enum>
+
+    <request name="set_modenum">
+      <description summary="Set mode number">
+	Select the nth mode
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="num" type="int"/>
+    </request>
+
+    <request name="set_mode">
+      <description summary="Set the mode of output">
+	Fuzzy output mode setting
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="set_transform">
+      <description summary="Set output transform">
+	Set output transform and the values should
+	be 0-7. They means 0, 90, 180, 270, FLIP-0, FLIP-90,
+	FLIP-180, FLIP-270. These terms are from
+	the wl_output protocol.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="transform" type="uint"
+           summary="The value should be between 0-7."/>
+    </request>
+
+    <request name="set_scale">
+      <description summary="Set output scale">
+	Scale output.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="scale" type="int"/>
+    </request>
+
+    <enum name="move">
+      <description summary="Position output">
+	The data type defines different movements of output.
+      </description>
+      <entry name="rightof" value="0"/>
+      <entry name="leftof" value="1"/>
+      <entry name="above" value="2"/>
+      <entry name="below" value="3"/>
+    </enum>
+
+    <request name="move">
+      <description summary="Move target output">
+	Position output relative to target 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="delmodenum">
+      <description summary="Delete the nth mode of output">
+	Delete the nth mode of output.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="num" type="int"/>
+    </request>
+
+    <request name="delmode">
+      <description summary="Delete the mode of output">
+	Fuzzy deletion of output mode.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="newmode">
+      <description summary="New the mode of output">
+	Custom a simple output mode.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="refresh" type="int"/>
+    </request>
+
+    <request name="newtiming">
+      <description summary="Custom new mode">
+	Custom a new output mode.
+      </description>
+      <arg name="output" type="object" interface="wl_output"
+           summary="Target output"/>
+      <arg name="clock" type="uint"
+           summary="Pixel clock (kHz)"/>
+      <arg name="hdisplay" type="int"
+           summary="The number of pixel for one horticontal line"/>
+      <arg name="hsync_start" type="int"
+           summary="Start of horizontal sync signal"/>
+      <arg name="hsync_end" type="int"
+           summary="End of horizontal sync signal"/>
+      <arg name="htotal" type="int"
+           summary="The whole cycle of a horizontal line"/>
+      <arg name="vdisplay" type="int"
+           summary="The number of pixel for one vertical line"/>
+      <arg name="vsync_start" type="int"
+           summary="Start of vertical sync signal"/>
+      <arg name="vsync_end" type="int"
+           summary="End of vertical sync signal"/>
+      <arg name="vtotal" type="int"
+           summary="The whole cycle of a vertical"/>
+      <arg name="vscan" type="int"
+           summary="The number of times each scanline is painted"/>
+      <arg name="flags" type="int" summary="Mode flags"/>
+    </request>
+
+    <request name="configure">
+      <description summary="Submit a configure file">
+	Submit a configure file to randr interface for parsing.
+	The file contains more configure request set.
+      </description>
+      <arg name="configure" type="string"
+           summary="Sumbit config file which contains configure requests."/>
+    </request>
+
+    <request name="commit">
+      <description summary="Multiple operations on one output">
+	Commit all the previous output changes from the client.
+	Before the commit, change request will be stored in randr interface.
+	Once client commits, all pending changes of the client will be submit.
+        And at the same time the pending changes will be clean up.
+      </description>
+      <arg name="callback" type="new_id" interface="wrandr_callback"/>
+    </request>
+  </interface>
+
+  <interface name="wrandr_callback" version="1">
+    <description summary="Weston randr callback interface">
+	It is a callback interface which can notify randr client
+	after commit.
+    </description>
+
+    <event name="done">
+      <description summary="Operation done event">
+	Notify the randr client when randr commits.
+	Flags contain all the operations executed. Every bit stands for one
+	type of operation. In result, every 2 bit contains the results of
+	every operation.
+      </description>
+      <arg name="output" type="object" interface="wl_output" allow-null="true"/>
+      <arg name="flags" type="uint" summary="Operation flags"/>
+      <arg name="results" type="uint" summary="Operation result"/>
+    </event>
+  </interface>
+</protocol>
-- 
1.8.1.2



More information about the wayland-devel mailing list