Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 1 | Weston |
| 2 | ====== |
Kristian Høgsberg | a6f6999 | 2010-09-14 12:41:26 -0400 | [diff] [blame] | 3 | |
Kristian Høgsberg | 72e023c | 2012-07-20 12:26:23 -0400 | [diff] [blame] | 4 | Weston is the reference implementation of a Wayland compositor, and a |
| 5 | useful compositor in its own right. Weston has various backends that |
| 6 | lets it run on Linux kernel modesetting and evdev input as well as |
| 7 | under X11. Weston ships with a few example clients, from simple |
| 8 | clients that demonstrate certain aspects of the protocol to more |
| 9 | complete clients and a simplistic toolkit. There is also a quite |
| 10 | capable terminal emulator (weston-terminal) and an toy/example desktop |
| 11 | shell. Finally, weston also provides integration with the Xorg server |
Bryce Harrington | e4cb3c2 | 2016-07-07 10:53:17 -0700 | [diff] [blame] | 12 | and can pull X clients into the Wayland desktop and act as an X window |
Kristian Høgsberg | 72e023c | 2012-07-20 12:26:23 -0400 | [diff] [blame] | 13 | manager. |
| 14 | |
Bryce W. Harrington | c74ab15 | 2014-02-03 21:37:06 +0000 | [diff] [blame] | 15 | Refer to http://wayland.freedesktop.org/building.html for building |
Kristian Høgsberg | 72e023c | 2012-07-20 12:26:23 -0400 | [diff] [blame] | 16 | weston and its dependencies. |
Bryce W. Harrington | c74ab15 | 2014-02-03 21:37:06 +0000 | [diff] [blame] | 17 | |
| 18 | The test suite can be invoked via `make check`; see |
| 19 | http://wayland.freedesktop.org/testing.html for additional details. |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 20 | |
Jon A. Cruz | 179c186 | 2015-07-15 19:22:43 -0700 | [diff] [blame] | 21 | Developer documentation can be built via `make doc`. Output will be in |
| 22 | the build root under |
| 23 | |
| 24 | docs/developer/html/index.html |
| 25 | docs/tools/html/index.html |
| 26 | |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 27 | |
| 28 | |
| 29 | Libweston |
| 30 | ========= |
| 31 | |
| 32 | Libweston is an effort to separate the re-usable parts of Weston into |
| 33 | a library. Libweston provides most of the boring and tedious bits of |
| 34 | correctly implementing core Wayland protocols and interfacing with |
| 35 | input and output systems, so that people who just want to write a new |
| 36 | "Wayland window manager" (WM) or a small desktop environment (DE) can |
| 37 | focus on the WM part. |
| 38 | |
Pekka Paalanen | 7241697 | 2016-08-10 14:54:08 +0300 | [diff] [blame] | 39 | Libweston was first introduced in Weston 1.12, and is expected to |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 40 | continue evolving through many Weston releases before it achieves a |
| 41 | stable API and feature completeness. |
| 42 | |
| 43 | |
Emil Velikov | 2d01e91 | 2016-07-04 15:23:50 +0100 | [diff] [blame] | 44 | API/ABI (in)stability and parallel installability |
| 45 | ------------------------------------------------- |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 46 | |
| 47 | As libweston's API surface is huge, it is impossible to get it right |
Pekka Paalanen | 7241697 | 2016-08-10 14:54:08 +0300 | [diff] [blame] | 48 | in one go. Therefore developers reserve the right to break the API/ABI and bump |
| 49 | the major version to signify that. For git snapshots of the master branch, the |
| 50 | API/ABI can break any time without warning. |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 51 | |
Pekka Paalanen | 7241697 | 2016-08-10 14:54:08 +0300 | [diff] [blame] | 52 | Libweston major can be bumped only once during a development cycle. This should |
| 53 | happen on the first patch that breaks the API or ABI. Further breaks before the |
| 54 | next Weston major.0.0 release do not cause a bump. This means that libweston |
| 55 | API and ABI are allowed to break also after an alpha release, up to the final |
| 56 | release. However, breaks after alpha should be judged by the usual practices |
| 57 | for allowing minor features, fixes only, or critical fixes only. |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 58 | |
Emil Velikov | 2d01e91 | 2016-07-04 15:23:50 +0100 | [diff] [blame] | 59 | To make things tolerable for libweston users despite API/ABI breakages, |
Pekka Paalanen | 7241697 | 2016-08-10 14:54:08 +0300 | [diff] [blame] | 60 | different libweston major versions are designed to be perfectly |
| 61 | parallel-installable. This way external projects can easily depend on a |
| 62 | particular API/ABI-version. Thus they do not have to fight over which |
| 63 | ABI-version is installed in a user's system. This allows a user to install many |
| 64 | different compositors each requiring a different libweston ABI-version without |
| 65 | tricks or conflicts. |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 66 | |
| 67 | Note, that versions of Weston itself will not be parallel-installable, |
| 68 | only libweston is. |
| 69 | |
| 70 | For more information about parallel installability, see |
| 71 | http://ometer.com/parallel.html |
| 72 | |
| 73 | |
Emil Velikov | aa48592 | 2016-07-22 14:51:50 +0100 | [diff] [blame] | 74 | Versioning scheme |
| 75 | ----------------- |
| 76 | |
| 77 | In order to provide consistent, easy to use versioning, libweston |
| 78 | follows the rules in the Apache Portable Runtime Project |
| 79 | http://apr.apache.org/versioning.html. |
| 80 | |
| 81 | The document provides the full details, with the gist summed below: |
| 82 | - Major - backward incompatible changes. |
| 83 | - Minor - new backward compatible features. |
| 84 | - Patch - internal (implementation specific) fixes. |
| 85 | |
Pekka Paalanen | 7241697 | 2016-08-10 14:54:08 +0300 | [diff] [blame] | 86 | Weston and libweston have separate version numbers in configure.ac. All |
| 87 | releases are made by the Weston version number. Libweston version number |
| 88 | matches the Weston version number in all releases except maybe pre-releases. |
| 89 | Pre-releases have the Weston micro version 91 or greater. |
| 90 | |
| 91 | A pre-release is allowed to install a libweston version greater than the Weston |
| 92 | version in case libweston major was bumped. In that case, the libweston version |
| 93 | must be Weston major + 1 and with minor and patch versions zero. |
| 94 | |
| 95 | Pkg-config files are named after libweston major, but carry the Weston version |
| 96 | number. This means that Weston pre-release 2.1.91 may install libweston-3.pc |
| 97 | for the future libweston 3.0.0, but the .pc file says the version is still |
| 98 | 2.1.91. When a libweston user wants to depend on the fully stable API and ABI |
| 99 | of a libweston major, he should use (e.g. for major 3): |
| 100 | |
| 101 | PKG_CHECK_MODULES(LIBWESTON, [libweston-3 >= 3.0.0]) |
| 102 | |
| 103 | Depending only on libweston-3 without a specific version number still allows |
| 104 | pre-releases which might have different API or ABI. |
| 105 | |
Emil Velikov | aa48592 | 2016-07-22 14:51:50 +0100 | [diff] [blame] | 106 | |
| 107 | Forward compatibility |
| 108 | --------------------- |
| 109 | |
| 110 | Inspired by ATK, Qt and KDE programs/libraries, libjpeg-turbo, GDK, |
| 111 | NetworkManager, js17, lz4 and many others, libweston uses a macro to restrict |
| 112 | the API visible to the developer - REQUIRE_LIBWESTON_API_VERSION. |
| 113 | |
| 114 | Note that different projects focus on different aspects - upper and/or lower |
| 115 | version check, default to visible/hidden old/new symbols and so on. |
| 116 | |
| 117 | libweston aims to guard all newly introduced API, in order to prevent subtle |
| 118 | breaks that a simple recompile (against a newer version) might cause. |
| 119 | |
| 120 | The macro is of the format 0x$MAJOR$MINOR and does not include PATCH version. |
| 121 | As mentioned in the Versioning scheme section, the latter does not reflect any |
| 122 | user visible API changes, thus should be not considered part of the API version. |
| 123 | |
| 124 | All new symbols should be guarded by the macro like the example given below: |
| 125 | |
| 126 | #if REQUIRE_LIBWESTON_API_VERSION >= 0x0101 |
| 127 | |
| 128 | bool |
| 129 | weston_ham_sandwich(void); |
| 130 | |
| 131 | #endif |
| 132 | |
| 133 | In order to use the said symbol, the one will have a similar code in their |
| 134 | configure.ac: |
| 135 | |
Emil Velikov | 2eda27b | 2016-08-15 16:31:11 +0100 | [diff] [blame] | 136 | PKG_CHECK_MODULES(LIBWESTON, [libweston-1 >= 1.1]) |
Emil Velikov | aa48592 | 2016-07-22 14:51:50 +0100 | [diff] [blame] | 137 | AC_DEFINE(REQUIRE_LIBWESTON_API_VERSION, [0x0101]) |
| 138 | |
| 139 | If the user is _not_ interested in forward compatibility, they can use 0xffff |
| 140 | or similar high value. Yet doing so is not recommended. |
| 141 | |
| 142 | |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 143 | Libweston design goals |
| 144 | ---------------------- |
| 145 | |
Emil Velikov | 99ac623 | 2016-07-04 15:23:49 +0100 | [diff] [blame] | 146 | The high-level goal of libweston is to decouple the compositor from |
| 147 | the shell implementation (what used to be shell plugins). |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 148 | |
Emil Velikov | 99ac623 | 2016-07-04 15:23:49 +0100 | [diff] [blame] | 149 | Thus, instead of launching 'weston' with various arguments to choose the |
Bryce Harrington | 585eef3 | 2016-07-06 14:50:15 -0700 | [diff] [blame] | 150 | shell, one would launch the shell itself, e.g. 'weston-desktop', |
| 151 | 'weston-ivi', 'orbital', etc. The main executable (the hosting program) |
Emil Velikov | 99ac623 | 2016-07-04 15:23:49 +0100 | [diff] [blame] | 152 | will implement the shell, while libweston will be used for a fundamental |
| 153 | compositor implementation. |
| 154 | |
| 155 | Libweston is also intended for use by other project developers who want |
| 156 | to create new "Wayland WMs". |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 157 | |
| 158 | Details: |
| 159 | |
| 160 | - All configuration and user interfaces will be outside of libweston. |
| 161 | This includes command line parsing, configuration files, and runtime |
| 162 | (graphical) UI. |
| 163 | |
| 164 | - The hosting program (main executable) will be in full control of all |
| 165 | libweston options. Libweston should not have user settable options |
| 166 | that would work behind the hosting program's back, except perhaps |
| 167 | debugging features and such. |
| 168 | |
| 169 | - Signal handling will be outside of libweston. |
| 170 | |
| 171 | - Child process execution and management will be outside of libweston. |
| 172 | |
| 173 | - The different backends (drm, fbdev, x11, etc) will be an internal |
| 174 | detail of libweston. Libweston will not support third party |
| 175 | backends. However, hosting programs need to handle |
| 176 | backend-specific configuration due to differences in behaviour and |
| 177 | available features. |
| 178 | |
| 179 | - Renderers will be libweston internal details too, though again the |
| 180 | hosting program may affect the choice of renderer if the backend |
| 181 | allows, and maybe set renderer-specific options. |
| 182 | |
| 183 | - plugin design ??? |
| 184 | |
| 185 | - xwayland ??? |
| 186 | |
Pekka Paalanen | 58f98c9 | 2016-06-03 16:45:21 +0300 | [diff] [blame] | 187 | - weston-launch is still with libweston even though it can only launch |
| 188 | Weston and nothing else. We would like to allow it to launch any compositor, |
| 189 | but since it gives by design root access to input devices and DRM, how can |
| 190 | we restrict it to intended programs? |
| 191 | |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 192 | There are still many more details to be decided. |
| 193 | |
| 194 | |
| 195 | For packagers |
| 196 | ------------- |
| 197 | |
| 198 | Always build Weston with --with-cairo=image. |
| 199 | |
| 200 | The Weston project is (will be) intended to be split into several |
| 201 | binary packages, each with its own dependencies. The maximal split |
| 202 | would be roughly like this: |
| 203 | |
| 204 | - libweston (minimal dependencies): |
| 205 | + headless backend |
| 206 | + wayland backend |
| 207 | |
| 208 | - gl-renderer (depends on GL libs etc.) |
| 209 | |
| 210 | - drm-backend (depends on libdrm, libgbm, libudev, libinput, ...) |
| 211 | |
| 212 | - x11-backend (depends of X11/xcb libs) |
| 213 | |
| 214 | - xwayland (depends on X11/xcb libs) |
| 215 | |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 216 | - fbdev-backend (depends on libudev...) |
| 217 | |
| 218 | - rdp-backend (depends on freerdp) |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 219 | |
| 220 | - weston (the executable, not parallel-installable): |
| 221 | + desktop shell |
| 222 | + ivi-shell |
| 223 | + fullscreen shell |
| 224 | + weston-info, weston-terminal, etc. we install by default |
Pekka Paalanen | 58f98c9 | 2016-06-03 16:45:21 +0300 | [diff] [blame] | 225 | + screen-share |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 226 | |
| 227 | - weston demos (not parallel-installable) |
| 228 | + weston-simple-* programs |
| 229 | + possibly all the programs we build but do not install by |
| 230 | default |
| 231 | |
| 232 | - and possibly more... |
| 233 | |
Emil Velikov | 2d01e91 | 2016-07-04 15:23:50 +0100 | [diff] [blame] | 234 | Everything should be parallel-installable across libweston major |
| 235 | ABI-versions (libweston-1.so, libweston-2.so, etc.), except those |
| 236 | explicitly mentioned. |
Pekka Paalanen | 2abe445 | 2015-07-14 13:05:34 +0300 | [diff] [blame] | 237 | |
| 238 | Weston's build may not sanely allow this yet, but this is the |
| 239 | intention. |