diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-12 08:17:52 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-12 08:17:52 -0500 |
commit | aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa (patch) | |
tree | 62968b4f9a22d275965605cba155afbb69892ee0 | |
parent | Fix gaps for views being incorrect (diff) | |
download | sway-aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa.tar.gz sway-aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa.tar.zst sway-aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa.zip |
Add new dependencies for wayland clients
Cairo for rendering shit, Pango for text rendering, and wayland client
stuff. Thanks @Cloudef, blatantly ripping off his cmake files for this
-rw-r--r-- | CMake/FindCairo.cmake | 47 | ||||
-rw-r--r-- | CMake/FindPango.cmake | 47 | ||||
-rw-r--r-- | CMake/FindWayland.cmake | 62 | ||||
-rw-r--r-- | CMake/Wayland.cmake | 77 | ||||
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | xdg-shell.xml | 422 |
7 files changed, 661 insertions, 0 deletions
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake new file mode 100644 index 00000000..36c28095 --- /dev/null +++ b/CMake/FindCairo.cmake | |||
@@ -0,0 +1,47 @@ | |||
1 | # - Try to find the cairo library | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # CAIRO_FOUND - system has cairo | ||
5 | # CAIRO_INCLUDE_DIRS - the cairo include directory | ||
6 | # CAIRO_LIBRARIES - Link these to use cairo | ||
7 | # | ||
8 | # Define CAIRO_MIN_VERSION for which version desired. | ||
9 | # | ||
10 | |||
11 | INCLUDE(FindPkgConfig) | ||
12 | |||
13 | IF(Cairo_FIND_REQUIRED) | ||
14 | SET(_pkgconfig_REQUIRED "REQUIRED") | ||
15 | ELSE(Cairo_FIND_REQUIRED) | ||
16 | SET(_pkgconfig_REQUIRED "") | ||
17 | ENDIF(Cairo_FIND_REQUIRED) | ||
18 | |||
19 | IF(CAIRO_MIN_VERSION) | ||
20 | PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION}) | ||
21 | ELSE(CAIRO_MIN_VERSION) | ||
22 | PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo) | ||
23 | ENDIF(CAIRO_MIN_VERSION) | ||
24 | |||
25 | IF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) | ||
26 | FIND_PATH(CAIRO_INCLUDE_DIRS cairo.h) | ||
27 | FIND_LIBRARY(CAIRO_LIBRARIES cairo) | ||
28 | |||
29 | # Report results | ||
30 | IF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) | ||
31 | SET(CAIRO_FOUND 1) | ||
32 | IF(NOT Cairo_FIND_QUIETLY) | ||
33 | MESSAGE(STATUS "Found Cairo: ${CAIRO_LIBRARIES}") | ||
34 | ENDIF(NOT Cairo_FIND_QUIETLY) | ||
35 | ELSE(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) | ||
36 | IF(Cairo_FIND_REQUIRED) | ||
37 | MESSAGE(SEND_ERROR "Could not find Cairo") | ||
38 | ELSE(Cairo_FIND_REQUIRED) | ||
39 | IF(NOT Cairo_FIND_QUIETLY) | ||
40 | MESSAGE(STATUS "Could not find Cairo") | ||
41 | ENDIF(NOT Cairo_FIND_QUIETLY) | ||
42 | ENDIF(Cairo_FIND_REQUIRED) | ||
43 | ENDIF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) | ||
44 | ENDIF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) | ||
45 | |||
46 | # Hide advanced variables from CMake GUIs | ||
47 | MARK_AS_ADVANCED(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS) | ||
diff --git a/CMake/FindPango.cmake b/CMake/FindPango.cmake new file mode 100644 index 00000000..64bf9ac4 --- /dev/null +++ b/CMake/FindPango.cmake | |||
@@ -0,0 +1,47 @@ | |||
1 | # - Try to find the pango library | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # PANGO_FOUND - system has pango | ||
5 | # PANGO_INCLUDE_DIRS - the pango include directory | ||
6 | # PANGO_LIBRARIES - Link these to use pango | ||
7 | # | ||
8 | # Define PANGO_MIN_VERSION for which version desired. | ||
9 | # | ||
10 | |||
11 | INCLUDE(FindPkgConfig) | ||
12 | |||
13 | IF(Pango_FIND_REQUIRED) | ||
14 | SET(_pkgconfig_REQUIRED "REQUIRED") | ||
15 | ELSE(Pango_FIND_REQUIRED) | ||
16 | SET(_pkgconfig_REQUIRED "") | ||
17 | ENDIF(Pango_FIND_REQUIRED) | ||
18 | |||
19 | IF(PANGO_MIN_VERSION) | ||
20 | PKG_SEARCH_MODULE(PANGO ${_pkgconfig_REQUIRED} "pango>=${PANGO_MIN_VERSION} pangocairo>=${PANGO_MIN_VERSION}") | ||
21 | ELSE(PANGO_MIN_VERSION) | ||
22 | PKG_SEARCH_MODULE(PANGO ${_pkgconfig_REQUIRED} "pango pangocairo") | ||
23 | ENDIF(PANGO_MIN_VERSION) | ||
24 | |||
25 | IF(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) | ||
26 | FIND_PATH(PANGO_INCLUDE_DIRS pango.h) | ||
27 | FIND_LIBRARY(PANGO_LIBRARIES pango pangocairo) | ||
28 | |||
29 | # Report results | ||
30 | IF(PANGO_LIBRARIES AND PANGO_INCLUDE_DIRS) | ||
31 | SET(PANGO_FOUND 1) | ||
32 | IF(NOT Pango_FIND_QUIETLY) | ||
33 | MESSAGE(STATUS "Found Pango: ${PANGO_LIBRARIES}") | ||
34 | ENDIF(NOT Pango_FIND_QUIETLY) | ||
35 | ELSE(PANGO_LIBRARIES AND PANGO_INCLUDE_DIRS) | ||
36 | IF(Pango_FIND_REQUIRED) | ||
37 | MESSAGE(SEND_ERROR "Could not find Pango") | ||
38 | ELSE(Pango_FIND_REQUIRED) | ||
39 | IF(NOT Pango_FIND_QUIETLY) | ||
40 | MESSAGE(STATUS "Could not find Pango") | ||
41 | ENDIF(NOT Pango_FIND_QUIETLY) | ||
42 | ENDIF(Pango_FIND_REQUIRED) | ||
43 | ENDIF(PANGO_LIBRARIES AND PANGO_INCLUDE_DIRS) | ||
44 | ENDIF(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND) | ||
45 | |||
46 | # Hide advanced variables from CMake GUIs | ||
47 | MARK_AS_ADVANCED(PANGO_LIBRARIES PANGO_INCLUDE_DIRS) | ||
diff --git a/CMake/FindWayland.cmake b/CMake/FindWayland.cmake new file mode 100644 index 00000000..00c17a3c --- /dev/null +++ b/CMake/FindWayland.cmake | |||
@@ -0,0 +1,62 @@ | |||
1 | # Try to find Wayland on a Unix system | ||
2 | # | ||
3 | # This will define: | ||
4 | # | ||
5 | # WAYLAND_FOUND - True if Wayland is found | ||
6 | # WAYLAND_LIBRARIES - Link these to use Wayland | ||
7 | # WAYLAND_INCLUDE_DIR - Include directory for Wayland | ||
8 | # WAYLAND_DEFINITIONS - Compiler flags for using Wayland | ||
9 | # | ||
10 | # In addition the following more fine grained variables will be defined: | ||
11 | # | ||
12 | # WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES | ||
13 | # WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES | ||
14 | # WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES | ||
15 | # | ||
16 | # Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org> | ||
17 | # | ||
18 | # Redistribution and use is allowed according to the terms of the BSD license. | ||
19 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
20 | |||
21 | IF (NOT WIN32) | ||
22 | IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES) | ||
23 | # In the cache already | ||
24 | SET(WAYLAND_FIND_QUIETLY TRUE) | ||
25 | ENDIF () | ||
26 | |||
27 | # Use pkg-config to get the directories and then use these values | ||
28 | # in the FIND_PATH() and FIND_LIBRARY() calls | ||
29 | FIND_PACKAGE(PkgConfig) | ||
30 | PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl) | ||
31 | |||
32 | SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS}) | ||
33 | |||
34 | FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
35 | FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
36 | FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) | ||
37 | |||
38 | FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
39 | FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
40 | FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) | ||
41 | |||
42 | set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR}) | ||
43 | |||
44 | set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES}) | ||
45 | |||
46 | list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR) | ||
47 | |||
48 | include(FindPackageHandleStandardArgs) | ||
49 | |||
50 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR) | ||
51 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR) | ||
52 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR) | ||
53 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR) | ||
54 | |||
55 | MARK_AS_ADVANCED( | ||
56 | WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES | ||
57 | WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES | ||
58 | WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES | ||
59 | WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES | ||
60 | ) | ||
61 | |||
62 | ENDIF () | ||
diff --git a/CMake/Wayland.cmake b/CMake/Wayland.cmake new file mode 100644 index 00000000..42f97b3b --- /dev/null +++ b/CMake/Wayland.cmake | |||
@@ -0,0 +1,77 @@ | |||
1 | #============================================================================= | ||
2 | # Copyright (C) 2012-2013 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | ||
3 | # All rights reserved. | ||
4 | # | ||
5 | # Redistribution and use in source and binary forms, with or without | ||
6 | # modification, are permitted provided that the following conditions | ||
7 | # are met: | ||
8 | # | ||
9 | # * Redistributions of source code must retain the above copyright | ||
10 | # notice, this list of conditions and the following disclaimer. | ||
11 | # | ||
12 | # * Redistributions in binary form must reproduce the above copyright | ||
13 | # notice, this list of conditions and the following disclaimer in the | ||
14 | # documentation and/or other materials provided with the distribution. | ||
15 | # | ||
16 | # * Neither the name of Pier Luigi Fiorini nor the names of his | ||
17 | # contributors may be used to endorse or promote products derived | ||
18 | # from this software without specific prior written permission. | ||
19 | # | ||
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
24 | # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
31 | #============================================================================= | ||
32 | |||
33 | find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) | ||
34 | |||
35 | # wayland_add_protocol_client(outfiles inputfile basename) | ||
36 | function(WAYLAND_ADD_PROTOCOL_CLIENT _sources _protocol _basename) | ||
37 | if(NOT WAYLAND_SCANNER_EXECUTABLE) | ||
38 | message(FATAL "The wayland-scanner executable has nto been found on your system. You must install it.") | ||
39 | endif() | ||
40 | |||
41 | get_filename_component(_infile ${_protocol} ABSOLUTE) | ||
42 | set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-client-protocol.h") | ||
43 | set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c") | ||
44 | |||
45 | add_custom_command(OUTPUT "${_client_header}" | ||
46 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header < ${_infile} > ${_client_header} | ||
47 | DEPENDS ${_infile} VERBATIM) | ||
48 | |||
49 | add_custom_command(OUTPUT "${_code}" | ||
50 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code} | ||
51 | DEPENDS ${_infile} VERBATIM) | ||
52 | |||
53 | list(APPEND ${_sources} "${_client_header}" "${_code}") | ||
54 | set(${_sources} ${${_sources}} PARENT_SCOPE) | ||
55 | endfunction() | ||
56 | |||
57 | # wayland_add_protocol_server(outfiles inputfile basename) | ||
58 | function(WAYLAND_ADD_PROTOCOL_SERVER _sources _protocol _basename) | ||
59 | if(NOT WAYLAND_SCANNER_EXECUTABLE) | ||
60 | message(FATAL "The wayland-scanner executable has nto been found on your system. You must install it.") | ||
61 | endif() | ||
62 | |||
63 | get_filename_component(_infile ${_protocol} ABSOLUTE) | ||
64 | set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-server-protocol.h") | ||
65 | set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c") | ||
66 | |||
67 | add_custom_command(OUTPUT "${_server_header}" | ||
68 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header < ${_infile} > ${_server_header} | ||
69 | DEPENDS ${_infile} VERBATIM) | ||
70 | |||
71 | add_custom_command(OUTPUT "${_code}" | ||
72 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code} | ||
73 | DEPENDS ${_infile} VERBATIM) | ||
74 | |||
75 | list(APPEND ${_sources} "${_server_header}" "${_code}") | ||
76 | set(${_sources} ${${_sources}} PARENT_SCOPE) | ||
77 | endfunction() | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt index d8e4ebca..b497cedb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -40,6 +40,9 @@ find_package(WLC REQUIRED) | |||
40 | find_package(A2X REQUIRED) | 40 | find_package(A2X REQUIRED) |
41 | find_package(PCRE REQUIRED) | 41 | find_package(PCRE REQUIRED) |
42 | find_package(JsonC REQUIRED) | 42 | find_package(JsonC REQUIRED) |
43 | FIND_PACKAGE(Wayland REQUIRED) | ||
44 | FIND_PACKAGE(Cairo REQUIRED) | ||
45 | FIND_PACKAGE(Pango REQUIRED) | ||
43 | 46 | ||
44 | FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) | 47 | FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) |
45 | 48 | ||
@@ -32,10 +32,13 @@ Install dependencies: | |||
32 | 32 | ||
33 | * cmake | 33 | * cmake |
34 | * [wlc](https://github.com/Cloudef/wlc) | 34 | * [wlc](https://github.com/Cloudef/wlc) |
35 | * wayland | ||
35 | * xwayland | 36 | * xwayland |
36 | * asciidoc | 37 | * asciidoc |
37 | * pcre | 38 | * pcre |
38 | * json-c | 39 | * json-c |
40 | * pango | ||
41 | * cairo | ||
39 | 42 | ||
40 | Run these commands: | 43 | Run these commands: |
41 | 44 | ||
diff --git a/xdg-shell.xml b/xdg-shell.xml new file mode 100644 index 00000000..776438be --- /dev/null +++ b/xdg-shell.xml | |||
@@ -0,0 +1,422 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <protocol name="xdg_shell"> | ||
3 | |||
4 | <copyright> | ||
5 | Copyright © 2008-2013 Kristian Høgsberg | ||
6 | Copyright © 2013 Rafael Antognolli | ||
7 | Copyright © 2013 Jasper St. Pierre | ||
8 | Copyright © 2010-2013 Intel Corporation | ||
9 | |||
10 | Permission to use, copy, modify, distribute, and sell this | ||
11 | software and its documentation for any purpose is hereby granted | ||
12 | without fee, provided that the above copyright notice appear in | ||
13 | all copies and that both that copyright notice and this permission | ||
14 | notice appear in supporting documentation, and that the name of | ||
15 | the copyright holders not be used in advertising or publicity | ||
16 | pertaining to distribution of the software without specific, | ||
17 | written prior permission. The copyright holders make no | ||
18 | representations about the suitability of this software for any | ||
19 | purpose. It is provided "as is" without express or implied | ||
20 | warranty. | ||
21 | |||
22 | THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS | ||
23 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
24 | FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
25 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
26 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN | ||
27 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | ||
28 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF | ||
29 | THIS SOFTWARE. | ||
30 | </copyright> | ||
31 | |||
32 | <interface name="xdg_shell" version="1"> | ||
33 | <description summary="create desktop-style surfaces"> | ||
34 | This interface is implemented by servers that provide | ||
35 | desktop-style user interfaces. | ||
36 | |||
37 | It allows clients to associate a xdg_surface with | ||
38 | a basic surface. | ||
39 | </description> | ||
40 | |||
41 | <enum name="version"> | ||
42 | <description summary="latest protocol version"> | ||
43 | The 'current' member of this enum gives the version of the | ||
44 | protocol. Implementations can compare this to the version | ||
45 | they implement using static_assert to ensure the protocol and | ||
46 | implementation versions match. | ||
47 | </description> | ||
48 | <entry name="current" value="4" summary="Always the latest version"/> | ||
49 | </enum> | ||
50 | |||
51 | <enum name="error"> | ||
52 | <entry name="role" value="0" summary="given wl_surface has another role"/> | ||
53 | </enum> | ||
54 | |||
55 | <request name="use_unstable_version"> | ||
56 | <description summary="enable use of this unstable version"> | ||
57 | Negotiate the unstable version of the interface. This | ||
58 | mechanism is in place to ensure client and server agree on the | ||
59 | unstable versions of the protocol that they speak or exit | ||
60 | cleanly if they don't agree. This request will go away once | ||
61 | the xdg-shell protocol is stable. | ||
62 | </description> | ||
63 | <arg name="version" type="int"/> | ||
64 | </request> | ||
65 | |||
66 | <request name="get_xdg_surface"> | ||
67 | <description summary="create a shell surface from a surface"> | ||
68 | Create a shell surface for an existing surface. | ||
69 | |||
70 | This request gives the surface the role of xdg_surface. If the | ||
71 | surface already has another role, it raises a protocol error. | ||
72 | |||
73 | Only one shell or popup surface can be associated with a given | ||
74 | surface. | ||
75 | </description> | ||
76 | <arg name="id" type="new_id" interface="xdg_surface"/> | ||
77 | <arg name="surface" type="object" interface="wl_surface"/> | ||
78 | </request> | ||
79 | |||
80 | <request name="get_xdg_popup"> | ||
81 | <description summary="create a shell surface from a surface"> | ||
82 | Create a popup surface for an existing surface. | ||
83 | |||
84 | This request gives the surface the role of xdg_popup. If the | ||
85 | surface already has another role, it raises a protocol error. | ||
86 | |||
87 | Only one shell or popup surface can be associated with a given | ||
88 | surface. | ||
89 | </description> | ||
90 | <arg name="id" type="new_id" interface="xdg_popup"/> | ||
91 | <arg name="surface" type="object" interface="wl_surface"/> | ||
92 | <arg name="parent" type="object" interface="wl_surface"/> | ||
93 | <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/> | ||
94 | <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/> | ||
95 | <arg name="x" type="int"/> | ||
96 | <arg name="y" type="int"/> | ||
97 | <arg name="flags" type="uint"/> | ||
98 | </request> | ||
99 | |||
100 | <event name="ping"> | ||
101 | <description summary="check if the client is alive"> | ||
102 | The ping event asks the client if it's still alive. Pass the | ||
103 | serial specified in the event back to the compositor by sending | ||
104 | a "pong" request back with the specified serial. | ||
105 | |||
106 | Compositors can use this to determine if the client is still | ||
107 | alive. It's unspecified what will happen if the client doesn't | ||
108 | respond to the ping request, or in what timeframe. Clients should | ||
109 | try to respond in a reasonable amount of time. | ||
110 | </description> | ||
111 | <arg name="serial" type="uint" summary="pass this to the callback"/> | ||
112 | </event> | ||
113 | |||
114 | <request name="pong"> | ||
115 | <description summary="respond to a ping event"> | ||
116 | A client must respond to a ping event with a pong request or | ||
117 | the client may be deemed unresponsive. | ||
118 | </description> | ||
119 | <arg name="serial" type="uint" summary="serial of the ping event"/> | ||
120 | </request> | ||
121 | </interface> | ||
122 | |||
123 | <interface name="xdg_surface" version="1"> | ||
124 | |||
125 | <description summary="desktop-style metadata interface"> | ||
126 | An interface that may be implemented by a wl_surface, for | ||
127 | implementations that provide a desktop-style user interface. | ||
128 | |||
129 | It provides requests to treat surfaces like windows, allowing to set | ||
130 | properties like maximized, fullscreen, minimized, and to move and resize | ||
131 | them, and associate metadata like title and app id. | ||
132 | |||
133 | On the server side the object is automatically destroyed when | ||
134 | the related wl_surface is destroyed. On client side, | ||
135 | xdg_surface.destroy() must be called before destroying | ||
136 | the wl_surface object. | ||
137 | </description> | ||
138 | |||
139 | <request name="destroy" type="destructor"> | ||
140 | <description summary="remove xdg_surface interface"> | ||
141 | The xdg_surface interface is removed from the wl_surface object | ||
142 | that was turned into a xdg_surface with | ||
143 | xdg_shell.get_xdg_surface request. The xdg_surface properties, | ||
144 | like maximized and fullscreen, are lost. The wl_surface loses | ||
145 | its role as a xdg_surface. The wl_surface is unmapped. | ||
146 | </description> | ||
147 | </request> | ||
148 | |||
149 | <request name="set_parent"> | ||
150 | <description summary="surface is a child of another surface"> | ||
151 | Child surfaces are stacked above their parents, and will be | ||
152 | unmapped if the parent is unmapped too. They should not appear | ||
153 | on task bars and alt+tab. | ||
154 | </description> | ||
155 | <arg name="parent" type="object" interface="wl_surface" allow-null="true"/> | ||
156 | </request> | ||
157 | |||
158 | <request name="set_title"> | ||
159 | <description summary="set surface title"> | ||
160 | Set a short title for the surface. | ||
161 | |||
162 | This string may be used to identify the surface in a task bar, | ||
163 | window list, or other user interface elements provided by the | ||
164 | compositor. | ||
165 | |||
166 | The string must be encoded in UTF-8. | ||
167 | </description> | ||
168 | <arg name="title" type="string"/> | ||
169 | </request> | ||
170 | |||
171 | <request name="set_app_id"> | ||
172 | <description summary="set surface class"> | ||
173 | Set an id for the surface. | ||
174 | |||
175 | The app id identifies the general class of applications to which | ||
176 | the surface belongs. | ||
177 | |||
178 | It should be the ID that appears in the new desktop entry | ||
179 | specification, the interface name. | ||
180 | </description> | ||
181 | <arg name="app_id" type="string"/> | ||
182 | </request> | ||
183 | |||
184 | <request name="show_window_menu"> | ||
185 | <description summary="show the window menu"> | ||
186 | Clients implementing client-side decorations might want to show | ||
187 | a context menu when right-clicking on the decorations, giving the | ||
188 | user a menu that they can use to maximize or minimize the window. | ||
189 | |||
190 | This request asks the compositor to pop up such a window menu at | ||
191 | the given position, relative to the parent surface. There are | ||
192 | no guarantees as to what the window menu contains. | ||
193 | |||
194 | Your surface must have focus on the seat passed in to pop up the | ||
195 | window menu. | ||
196 | </description> | ||
197 | |||
198 | <arg name="seat" type="object" interface="wl_seat" summary="the seat to pop the window up on"/> | ||
199 | <arg name="serial" type="uint" summary="serial of the event to pop up the window for"/> | ||
200 | <arg name="x" type="int" summary="the x position to pop up the window menu at"/> | ||
201 | <arg name="y" type="int" summary="the y position to pop up the window menu at"/> | ||
202 | </request> | ||
203 | |||
204 | <request name="move"> | ||
205 | <description summary="start an interactive move"> | ||
206 | Start a pointer-driven move of the surface. | ||
207 | |||
208 | This request must be used in response to a button press event. | ||
209 | The server may ignore move requests depending on the state of | ||
210 | the surface (e.g. fullscreen or maximized). | ||
211 | </description> | ||
212 | <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/> | ||
213 | <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/> | ||
214 | </request> | ||
215 | |||
216 | <enum name="resize_edge"> | ||
217 | <description summary="edge values for resizing"> | ||
218 | These values are used to indicate which edge of a surface | ||
219 | is being dragged in a resize operation. The server may | ||
220 | use this information to adapt its behavior, e.g. choose | ||
221 | an appropriate cursor image. | ||
222 | </description> | ||
223 | <entry name="none" value="0"/> | ||
224 | <entry name="top" value="1"/> | ||
225 | <entry name="bottom" value="2"/> | ||
226 | <entry name="left" value="4"/> | ||
227 | <entry name="top_left" value="5"/> | ||
228 | <entry name="bottom_left" value="6"/> | ||
229 | <entry name="right" value="8"/> | ||
230 | <entry name="top_right" value="9"/> | ||
231 | <entry name="bottom_right" value="10"/> | ||
232 | </enum> | ||
233 | |||
234 | <request name="resize"> | ||
235 | <description summary="start an interactive resize"> | ||
236 | Start a pointer-driven resizing of the surface. | ||
237 | |||
238 | This request must be used in response to a button press event. | ||
239 | The server may ignore resize requests depending on the state of | ||
240 | the surface (e.g. fullscreen or maximized). | ||
241 | </description> | ||
242 | <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/> | ||
243 | <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/> | ||
244 | <arg name="edges" type="uint" summary="which edge or corner is being dragged"/> | ||
245 | </request> | ||
246 | |||
247 | <enum name="state"> | ||
248 | <description summary="types of state on the surface"> | ||
249 | The different state values used on the surface. This is designed for | ||
250 | state values like maximized, fullscreen. It is paired with the | ||
251 | configure event to ensure that both the client and the compositor | ||
252 | setting the state can be synchronized. | ||
253 | |||
254 | States set in this way are double-buffered. They will get applied on | ||
255 | the next commit. | ||
256 | |||
257 | Desktop environments may extend this enum by taking up a range of | ||
258 | values and documenting the range they chose in this description. | ||
259 | They are not required to document the values for the range that they | ||
260 | chose. Ideally, any good extensions from a desktop environment should | ||
261 | make its way into standardization into this enum. | ||
262 | |||
263 | The current reserved ranges are: | ||
264 | |||
265 | 0x0000 - 0x0FFF: xdg-shell core values, documented below. | ||
266 | 0x1000 - 0x1FFF: GNOME | ||
267 | </description> | ||
268 | <entry name="maximized" value="1" summary="the surface is maximized"> | ||
269 | The surface is maximized. The window geometry specified in the configure | ||
270 | event must be obeyed by the client. | ||
271 | </entry> | ||
272 | <entry name="fullscreen" value="2" summary="the surface is fullscreen"> | ||
273 | The surface is fullscreen. The window geometry specified in the configure | ||
274 | event must be obeyed by the client. | ||
275 | </entry> | ||
276 | <entry name="resizing" value="3"> | ||
277 | The surface is being resized. The window geometry specified in the | ||
278 | configure event is a maximum; the client cannot resize beyond it. | ||
279 | Clients that have aspect ratio or cell sizing configuration can use | ||
280 | a smaller size, however. | ||
281 | </entry> | ||
282 | <entry name="activated" value="4"> | ||
283 | Client window decorations should be painted as if the window is | ||
284 | active. Do not assume this means that the window actually has | ||
285 | keyboard or pointer focus. | ||
286 | </entry> | ||
287 | </enum> | ||
288 | |||
289 | <event name="configure"> | ||
290 | <description summary="suggest a surface change"> | ||
291 | The configure event asks the client to resize its surface. | ||
292 | |||
293 | The width and height arguments specify a hint to the window | ||
294 | about how its surface should be resized in window geometry | ||
295 | coordinates. The states listed in the event specify how the | ||
296 | width/height arguments should be interpreted. | ||
297 | |||
298 | A client should arrange a new surface, and then send a | ||
299 | ack_configure request with the serial sent in this configure | ||
300 | event before attaching a new surface. | ||
301 | |||
302 | If the client receives multiple configure events before it | ||
303 | can respond to one, it is free to discard all but the last | ||
304 | event it received. | ||
305 | </description> | ||
306 | |||
307 | <arg name="width" type="int"/> | ||
308 | <arg name="height" type="int"/> | ||
309 | <arg name="states" type="array"/> | ||
310 | <arg name="serial" type="uint"/> | ||
311 | </event> | ||
312 | |||
313 | <request name="ack_configure"> | ||
314 | <description summary="ack a configure event"> | ||
315 | When a configure event is received, a client should then ack it | ||
316 | using the ack_configure request to ensure that the compositor | ||
317 | knows the client has seen the event. | ||
318 | |||
319 | By this point, the state is confirmed, and the next attach should | ||
320 | contain the buffer drawn for the configure event you are acking. | ||
321 | </description> | ||
322 | <arg name="serial" type="uint" summary="a serial to configure for"/> | ||
323 | </request> | ||
324 | |||
325 | <request name="set_window_geometry"> | ||
326 | <description summary="set the new window geometry"> | ||
327 | The window geometry of a window is its "visible bounds" from the | ||
328 | user's perspective. Client-side decorations often have invisible | ||
329 | portions like drop-shadows which should be ignored for the | ||
330 | purposes of aligning, placing and constraining windows. | ||
331 | |||
332 | The default value is the full bounds of the surface, including any | ||
333 | subsurfaces. Once the window geometry of the surface is set once, | ||
334 | it is not possible to unset it, and it will remain the same until | ||
335 | set_window_geometry is called again, even if a new subsurface or | ||
336 | buffer is attached. | ||
337 | |||
338 | If responding to a configure event, the window geometry in here | ||
339 | must respect the sizing negotiations specified by the states in | ||
340 | the configure event. | ||
341 | </description> | ||
342 | <arg name="x" type="int"/> | ||
343 | <arg name="y" type="int"/> | ||
344 | <arg name="width" type="int"/> | ||
345 | <arg name="height" type="int"/> | ||
346 | </request> | ||
347 | |||
348 | <request name="set_maximized" /> | ||
349 | <request name="unset_maximized" /> | ||
350 | |||
351 | <request name="set_fullscreen"> | ||
352 | <description summary="set the window as fullscreen on a monitor"> | ||
353 | Make the surface fullscreen. | ||
354 | |||
355 | You can specify an output that you would prefer to be fullscreen. | ||
356 | If this value is NULL, it's up to the compositor to choose which | ||
357 | display will be used to map this surface. | ||
358 | </description> | ||
359 | <arg name="output" type="object" interface="wl_output" allow-null="true"/> | ||
360 | </request> | ||
361 | <request name="unset_fullscreen" /> | ||
362 | |||
363 | <request name="set_minimized" /> | ||
364 | |||
365 | <event name="close"> | ||
366 | <description summary="surface wants to be closed"> | ||
367 | The close event is sent by the compositor when the user | ||
368 | wants the surface to be closed. This should be equivalent to | ||
369 | the user clicking the close button in client-side decorations, | ||
370 | if your application has any... | ||
371 | |||
372 | This is only a request that the user intends to close your | ||
373 | window. The client may choose to ignore this request, or show | ||
374 | a dialog to ask the user to save their data... | ||
375 | </description> | ||
376 | </event> | ||
377 | </interface> | ||
378 | |||
379 | <interface name="xdg_popup" version="1"> | ||
380 | <description summary="desktop-style metadata interface"> | ||
381 | An interface that may be implemented by a wl_surface, for | ||
382 | implementations that provide a desktop-style popups/menus. A popup | ||
383 | surface is a transient surface with an added pointer grab. | ||
384 | |||
385 | An existing implicit grab will be changed to owner-events mode, | ||
386 | and the popup grab will continue after the implicit grab ends | ||
387 | (i.e. releasing the mouse button does not cause the popup to be | ||
388 | unmapped). | ||
389 | |||
390 | The popup grab continues until the window is destroyed or a mouse | ||
391 | button is pressed in any other clients window. A click in any of | ||
392 | the clients surfaces is reported as normal, however, clicks in | ||
393 | other clients surfaces will be discarded and trigger the callback. | ||
394 | |||
395 | The x and y arguments specify the locations of the upper left | ||
396 | corner of the surface relative to the upper left corner of the | ||
397 | parent surface, in surface local coordinates. | ||
398 | |||
399 | xdg_popup surfaces are always transient for another surface. | ||
400 | </description> | ||
401 | |||
402 | <request name="destroy" type="destructor"> | ||
403 | <description summary="remove xdg_surface interface"> | ||
404 | The xdg_surface interface is removed from the wl_surface object | ||
405 | that was turned into a xdg_surface with | ||
406 | xdg_shell.get_xdg_surface request. The xdg_surface properties, | ||
407 | like maximized and fullscreen, are lost. The wl_surface loses | ||
408 | its role as a xdg_surface. The wl_surface is unmapped. | ||
409 | </description> | ||
410 | </request> | ||
411 | |||
412 | <event name="popup_done"> | ||
413 | <description summary="popup interaction is done"> | ||
414 | The popup_done event is sent out when a popup grab is broken, | ||
415 | that is, when the users clicks a surface that doesn't belong | ||
416 | to the client owning the popup surface. | ||
417 | </description> | ||
418 | <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/> | ||
419 | </event> | ||
420 | |||
421 | </interface> | ||
422 | </protocol> | ||