[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

wayland: Changes to 'ubuntu'



 ChangeLog                     |  997 +++++++++++++++++++++++++++++++++++++++++
 Makefile.am                   |    2 
 TODO                          |  104 ----
 configure.ac                  |   18 
 debian/changelog              |   14 
 debian/libwayland0.symbols.in |   78 +--
 protocol/wayland.xml          |  718 +++++++++++++++++------------
 spec/main.tex                 |  147 ++++--
 spec/wayland-architecture.png |binary
 spec/x-architecture.png       |binary
 src/.gitignore                |    4 
 src/Makefile.am               |   63 ++
 src/connection.c              |  813 +++++++++++++++++++++++++++++++++
 src/data-device.c             |  464 +++++++++++++++++++
 src/event-loop.c              |  475 +++++++++++++++++++
 src/scanner.c                 | 1013 ++++++++++++++++++++++++++++++++++++++++++
 src/scanner.mk                |    8 
 src/wayland-client.c          |  579 ++++++++++++++++++++++++
 src/wayland-client.h          |  101 ++++
 src/wayland-client.pc.in      |   10 
 src/wayland-egl.h             |   66 ++
 src/wayland-private.h         |   93 +++
 src/wayland-server.c          |  967 ++++++++++++++++++++++++++++++++++++++++
 src/wayland-server.h          |  324 +++++++++++++
 src/wayland-server.pc.in      |   10 
 src/wayland-shm.c             |  252 ++++++++++
 src/wayland-util.c            |  272 +++++++++++
 src/wayland-util.h            |  152 ++++++
 wayland/.gitignore            |    4 
 wayland/Makefile.am           |   63 --
 wayland/connection.c          |  749 -------------------------------
 wayland/connection.h          |   68 --
 wayland/event-loop.c          |  465 -------------------
 wayland/scanner.c             |  863 -----------------------------------
 wayland/scanner.mk            |    8 
 wayland/wayland-client.c      |  604 -------------------------
 wayland/wayland-client.h      |   90 ---
 wayland/wayland-client.pc.in  |   10 
 wayland/wayland-egl.h         |   68 --
 wayland/wayland-hash.c        |  296 ------------
 wayland/wayland-server.c      |  933 --------------------------------------
 wayland/wayland-server.h      |  307 ------------
 wayland/wayland-server.pc.in  |   10 
 wayland/wayland-shm.c         |  223 ---------
 wayland/wayland-util.c        |  123 -----
 wayland/wayland-util.h        |  152 ------
 46 files changed, 7286 insertions(+), 5494 deletions(-)

New commits:
commit 421527af53c1f51d1447e678fb75fcd6ac84817f
Author: Cyril Brulebois <kibi@debian.org>
Date:   Mon Jan 30 22:37:58 2012 +0100

    Upload to experimental.

diff --git a/debian/changelog b/debian/changelog
index edb09dc..bf5675e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-wayland (0.1.0~2-1) UNRELEASED; urgency=low
+wayland (0.1.0~2-1) experimental; urgency=low
 
   * New upstream snapshot.
   * Update symbols file.
 
- -- Cyril Brulebois <kibi@debian.org>  Mon, 30 Jan 2012 22:04:00 +0100
+ -- Cyril Brulebois <kibi@debian.org>  Mon, 30 Jan 2012 22:37:54 +0100
 
 wayland (0.1.0~1-1) experimental; urgency=low
 

commit e226c4d811636e39ef96973d3754ea3aaccc89a5
Author: Cyril Brulebois <kibi@debian.org>
Date:   Mon Jan 30 22:37:52 2012 +0100

    Update symbols file.

diff --git a/debian/changelog b/debian/changelog
index 26b9a54..edb09dc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 wayland (0.1.0~2-1) UNRELEASED; urgency=low
 
   * New upstream snapshot.
+  * Update symbols file.
 
  -- Cyril Brulebois <kibi@debian.org>  Mon, 30 Jan 2012 22:04:00 +0100
 
diff --git a/debian/libwayland0.symbols.in b/debian/libwayland0.symbols.in
index 5cd5df2..1ffe3d4 100644
--- a/debian/libwayland0.symbols.in
+++ b/debian/libwayland0.symbols.in
@@ -22,12 +22,6 @@ libwayland-client.so.0 libwayland0 @@currentversion@@
  wl_display_remove_global_listener@Base 0.1.0~0
  wl_display_roundtrip@Base 0.1.0~1
  wl_display_sync@Base 0.1.0~1
- wl_hash_table_create@Base 0.1.0~0
- wl_hash_table_destroy@Base 0.1.0~0
- wl_hash_table_for_each@Base 0.1.0~1
- wl_hash_table_insert@Base 0.1.0~0
- wl_hash_table_lookup@Base 0.1.0~0
- wl_hash_table_remove@Base 0.1.0~0
  wl_input_device_interface@Base 0.1.0~0
  wl_list_empty@Base 0.1.0~0
  wl_list_init@Base 0.1.0~0
@@ -72,7 +66,9 @@ libwayland-server.so.0 libwayland0 @@currentversion@@
  wl_client_new_object@Base 0.1.0~1
  wl_compositor_interface@Base 0.1.0~0
  wl_data_device_interface@Base 0.1.0~1
+ wl_data_device_manager_init@Base 0.1.0~2
  wl_data_device_manager_interface@Base 0.1.0~1
+ wl_data_device_set_keyboard_focus@Base 0.1.0~2
  wl_data_offer_interface@Base 0.1.0~1
  wl_data_source_interface@Base 0.1.0~1
  wl_display_add_global@Base 0.1.0~0
@@ -96,19 +92,14 @@ libwayland-server.so.0 libwayland0 @@currentversion@@
  wl_event_source_fd_update@Base 0.1.0~0
  wl_event_source_remove@Base 0.1.0~0
  wl_event_source_timer_update@Base 0.1.0~0
- wl_hash_table_create@Base 0.1.0~0
- wl_hash_table_destroy@Base 0.1.0~0
- wl_hash_table_for_each@Base 0.1.0~1
- wl_hash_table_insert@Base 0.1.0~0
- wl_hash_table_lookup@Base 0.1.0~0
- wl_hash_table_remove@Base 0.1.0~0
  wl_input_device_end_grab@Base 0.1.0~0
  wl_input_device_init@Base 0.1.0~0
  wl_input_device_interface@Base 0.1.0~0
+ wl_input_device_release@Base 0.1.0~2
  wl_input_device_set_keyboard_focus@Base 0.1.0~0
  wl_input_device_set_pointer_focus@Base 0.1.0~0
+ wl_input_device_set_selection@Base 0.1.0~2
  wl_input_device_start_grab@Base 0.1.0~0
- wl_input_device_update_grab@Base 0.1.0~0
  wl_list_empty@Base 0.1.0~0
  wl_list_init@Base 0.1.0~0
  wl_list_insert@Base 0.1.0~0

commit ec6d4c9e64c780927a660d1dfa5ce3f6467dc950
Author: Cyril Brulebois <kibi@debian.org>
Date:   Mon Jan 30 22:04:12 2012 +0100

    Bump changelogs.

diff --git a/ChangeLog b/ChangeLog
index 0d49cd5..f3c940d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,203 @@
+commit 10eefa49470d97948719f58dfb62a97fb4701aed
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Wed Jan 18 10:06:02 2012 -0800
+
+    spec: list core interfaces with short descriptions
+    
+    Plus fix up misc. grammar.
+
+commit fb84662f617d2d8ec3f5724d6962a4109e6fb0ea
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Wed Jan 18 09:33:34 2012 -0800
+
+    spec: update high level description, add diagrams
+    
+    Add diagrams from the Wayland architecture page and add some more high
+    level text describing X limitations and Wayland architecture.
+
+commit f66aa1d08f75c6d89b539e2942baa18b454f83bc
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Thu Jan 19 14:13:36 2012 -0800
+
+    scanner: allow summary attributes in args and <description> in <protocol>
+    
+    Add support for arg summaries for use by detailed structure element
+    descriptions.
+
+commit 032b957698e03a3e6bb19dc051ecad1792da0385
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Jan 18 19:17:23 2012 -0500
+
+    protocol: Convert comments to new documentation tags
+
+commit 5cd047131185932e937b05f6a77b9833028acbab
+Author: Jesse Barnes <jesse.barnes@intel.com>
+Date:   Wed Jan 18 14:09:47 2012 -0800
+
+    scanner: Support documentation elements
+    
+    On Wed, 18 Jan 2012 12:29:37 -0800
+    "Kristensen, Kristian H" <kristian.h.kristensen@intel.com> wrote:
+    > Yeah, that looks good.  I was thinking of a separate <description> tag
+    > to avoid stuffing too much into an attribute.
+    
+    How does this look?  It adds a summary attribute to atomic elements,
+    and a <description> tag with a summary for others.  Spits out enum
+    documentation like this:
+    
+    /**
+     * wl_display_error - global error values
+     * @WL_DISPLAY_ERROR_INVALID_OBJECT: server couldn't find object
+     * @WL_DISPLAY_ERROR_INVALID_METHOD: method doesn't exist on the specified interface
+     * @WL_DISPLAY_ERROR_NO_MEMORY: server is out of memory
+     *
+     * These errors are global and can be emitted in response to any server request.
+     */
+    enum wl_display_error {
+    	WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
+    	WL_DISPLAY_ERROR_INVALID_METHOD = 1,
+    	WL_DISPLAY_ERROR_NO_MEMORY = 2,
+    };
+    
+    and structure documentation like this:
+    
+    /**
+     * wl_display - core global object
+     * @bind: bind an object to the display
+     * @sync: (none)
+     *
+     * The core global object. This is a special singleton object. It is used for
+     * internal wayland protocol features.
+     */
+    struct wl_display_interface {
+    	void (*bind)(struct wl_client *client,
+    		     struct wl_resource *resource,
+    		     uint32_t name,
+    		     const char *interface,
+    		     uint32_t version,
+    		     uint32_t id);
+    	void (*sync)(struct wl_client *client,
+    		     struct wl_resource *resource,
+    		     uint32_t callback);
+    };
+
+commit 4b5871e2b8be59b5dc3daa6fe00eb1bee80bfad6
+Author: Richard Hughes <richard@hughsie.com>
+Date:   Fri Jan 13 09:20:48 2012 +0000
+
+    Fix 'make dist' as connection.h no longer exists
+
+commit e0b6af03cad9cb970072f39d602c85be6b4b014b
+Author: Neil Roberts <neil@linux.intel.com>
+Date:   Thu Jan 12 15:48:02 2012 +0000
+
+    server: In default grab, update focus resource after sending release
+    
+    The default grab implementation in wayland-server was updating the
+    focus resource before sending the button event. This would cause the
+    button release to be dropped from the implicit grab if the pointer is
+    moved away from the focus surface. This patch just swaps the order
+    around.
+
+commit 151ca457b4384c385c0062716b55595e22fef7ea
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Jan 11 14:19:50 2012 -0500
+
+    shm: Drop non-premul format, use less ambiguous ARGB8888 naming convention
+    
+    This also matches the new wl_drm format names.
+
+commit b2e619c7409a98936233b5f8afb8797f5ac457e9
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Thu Jan 5 08:50:25 2012 -0500
+
+    Add new wl_shell popup surface type
+
+commit b6b3d07c83481a4435a3b03f2ea6c5dfa600f8f5
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Jan 4 21:40:21 2012 -0500
+
+    Move data device implementation into wayland-server
+
+commit dbb3ba7269beea3ac441632bd502911bc439a0e3
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Jan 4 21:29:17 2012 -0500
+
+    Move default grab implementation to wayland-server
+
+commit 5ffe9f470829a80acb711950eaa3870ec20c1057
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Jan 4 21:27:26 2012 -0500
+
+    New grab API
+    
+    This commit changes the way struct wl_grab works in a couple of ways:
+    
+     - The grab itself now decides when it ends instead of hardcoding button
+       up as the terminating event.  We remove the end vfunc since a grab now
+       always know when it ends and can just clean up at that point.
+    
+     - We add a new focus vfunc that is invoked every time the pointer enters
+       a new surface, regardless of any grabs.  The callback receives the
+       surface and the surface-relative pointer coordinates.  The callback lets
+       a grab send enter/leave events and change the grab focus.
+    
+     - The grab has a focus surface, wich determines the coordinate space
+       for the motion callback coordinates.
+    
+     - The input device always tracks the current surface, ie the surface that
+       currently contains the pointer, and coordinates relative to that surface.
+    
+    With these changes, we will be able to pull the core input event delivery
+    and the drag and drop grab into the core wayland-server library.
+
+commit 44b529f2e4b953206908f73842ca76d246f715d0
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Jan 4 09:13:27 2012 -0500
+
+    server: Allocate server ID for when resource->object.id is 0
+
+commit c7473897fc6175b2a1a4af673c7ba489483a1cbb
+Author: Pekka Paalanen <ppaalanen@gmail.com>
+Date:   Tue Jan 3 16:32:41 2012 +0200
+
+    server: remove wl_display::callback_list as unused
+    
+    Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
+
+commit 2755847fce68d6ad36e180f807d06e8a6e70bce7
+Author: Pekka Paalanen <ppaalanen@gmail.com>
+Date:   Tue Jan 3 16:32:40 2012 +0200
+
+    server: add wl_input_device_release()
+    
+    Add a clean-up function for destroying all objects created in
+    wl_input_device_init(). Can be used to fix memory leaks reported by
+    Valgrind in the demos.
+    
+    The init function was also missing an explicit initialisation of the
+    'keys' array. Add the explicit array init, although it is redundant with
+    the zeroing of the whole struct.
+    
+    Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
+    
+    krh: Edited to rename function to *_release()
+
+commit d6465c5b402362c730c703f3f6dd5deddefec113
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Wed Dec 28 22:47:37 2011 -0500
+
+    Fix WL_EVENT_WRITEABLE typo
+
+commit c1b9203e5adc499677ddb69720213ff63ca66678
+Author: Kristian Høgsberg <krh@bitplanet.net>
+Date:   Tue Dec 27 13:53:59 2011 -0500
+
+    Drop unused hash table
+    
+    We now just use a table for looking up object IDs so we should drop the
+    hash table.
+
 commit bc79f1f820409fb92c158a9d2df8a99ad269018e
 Author: Kristian Høgsberg <krh@bitplanet.net>
 Date:   Thu Dec 22 15:32:37 2011 -0500
diff --git a/debian/changelog b/debian/changelog
index 2700b00..26b9a54 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+wayland (0.1.0~2-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Cyril Brulebois <kibi@debian.org>  Mon, 30 Jan 2012 22:04:00 +0100
+
 wayland (0.1.0~1-1) experimental; urgency=low
 
   * New upstream snapshot.

commit 10eefa49470d97948719f58dfb62a97fb4701aed
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Jan 18 10:06:02 2012 -0800

    spec: list core interfaces with short descriptions
    
    Plus fix up misc. grammar.

diff --git a/spec/main.tex b/spec/main.tex
index 741c4e0..756bf38 100644
--- a/spec/main.tex
+++ b/spec/main.tex
@@ -162,7 +162,7 @@ The message header has 2 words in it:
 \end{itemize}
 
 The payload describes the request/event arguments.  Every argument is always
-aligned to 32-bit.  There is no prefix that describes the type, but it is
+aligned to 32-bits.  There is no prefix that describes the type, but it is
 inferred implicitly from the xml specification.
 
 The representation of argument types are as follows:
@@ -174,7 +174,7 @@ The representation of argument types are as follows:
   32-bit boundary.
 \item "object": A 32-bit object ID.
 \item "new\_id": the 32-bit object ID.  On requests, the client
-  decides the ID.  The only event with "new\_id" is advertisements of
+  decides the ID.  The only events with "new\_id" are advertisements of
   globals, and the server will use IDs below 0x10000.
 \item "array": Starts with 32-bit array size in bytes, followed by the array
   contents verbatim, and finally padding to a 32-bit boundary.
@@ -182,6 +182,33 @@ The representation of argument types are as follows:
   the ancillary data of the UNIX domain socket message (msg\_control).
 \end{itemize}
 
+\subsection{Interfaces}
+
+The protocol includes several interfaces which are used for
+interacting with the server.  Each interface provides requests,
+events, and errors (which are really just special events) as described
+above.  Specific compositor implementations may have their own
+interfaces provided as extensions, but there are several which are
+always expected to be present.
+
+Core interfaces:
+\begin{itemize}
+\item wl_display: provides global functionality like objecting binding and fatal error events
+\item wl_callback: callback interface for dnoe events
+\item wl_compositor: core compositor interface, allows surface creation
+\item wl_shm: buffer management interface with buffer creation and format handling
+\item wl_buffer: buffer handling interface for indicating damage and object destruction, also provides buffer release events from the server
+\item wl_data_offer: for accepting and receiving specific mime types
+\item wl_data_source: for offering specific mime types
+\item wl_data_Device: lets clients manage drag & drop, provides pointer enter/leave events and motion
+\item wl_data_device_manager: for managing data sources and devices
+\item wl_shell: shell surface handling
+\item wl_shell_surface: shell surface handling and desktop-like events (e.g. set a surface to fullscreen, display a popup, etc.)
+\item wl_surface: surface management (destruction, damage, buffer attach, frame handling)
+\item wl_input_device: cursor setting, motion, button, and key events, etc.
+\item wl_output: events describing an attached output (subpixel orientation, current mode & geometry, etc.)
+\end{itemize}
+
 \subsection{Connect Time}
 
 \begin{itemize}
@@ -228,7 +255,7 @@ The compositor is a global object, advertised at connect time.
 
 \begin{itemize}
 \item a global object
-\item broadcasts drm file name, or at least a string like drm:/dev/card0
+\item broadcasts drm file name, or at least a string like drm:/dev/dri/card0
 \item commit/ack/frame protocol
 \end{itemize}
 

commit fb84662f617d2d8ec3f5724d6962a4109e6fb0ea
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Jan 18 09:33:34 2012 -0800

    spec: update high level description, add diagrams
    
    Add diagrams from the Wayland architecture page and add some more high
    level text describing X limitations and Wayland architecture.

diff --git a/spec/main.tex b/spec/main.tex
index f32e999..741c4e0 100644
--- a/spec/main.tex
+++ b/spec/main.tex
@@ -1,11 +1,12 @@
 \documentclass{article}
 \usepackage{palatino}
+\usepackage{graphicx}
 
 \author{Kristian Høgsberg\\
 \texttt{krh@bitplanet.net}
 }
 
-\title{The Wayland Display Server}
+\title{The Wayland Compositing System}
 
 \begin{document}
 
@@ -14,40 +15,97 @@
 \section{Wayland Overview}
 
 \begin{itemize}
-\item wayland is a protocol for a new display server.  
-\item wayland is an implementation
+\item wayland is a protocol for a new display server.
+\item weston is the open source project implementing a wayland based compositor
 \end{itemize}
 
 \subsection{Replacing X11}
 
-Over time, a lot of functionality have slowly moved out of the X
-server and into client-side libraries or kernel drivers. One of the
-first components to move out was font rendering, with freetype and
-fontconfig providing an alternative to the core X fonts.  Direct
-rendering OpenGL as a graphics driver in a client side library. Then
-cairo came along and provided a modern 2D rendering library
-independent of X and compositing managers took over control of the
-rendering of the desktop. Recently with GEM and KMS in the Linux
-kernel, we can do modesetting outside X and schedule several direct
-rendering clients. The end result is a highly modular graphics stack.
+In Linux and other Unix-like systems, the X stack has grown to
+encompass funcationality arguably belonging in client libraries,
+helper libraries, or the host operating system kernel.  Support for
+things like PCI resource management, display configuration management,
+direct rendering, and memory management has been integrated into the X
+stack, imposing limitations like limited support for standalone
+applications, duplication in other projects (e.g. the Linux fb layer
+or the DirectFB project), and high levels of complexity for systems
+combining multiple elements (for example radeon memory map handling
+between the fb driver and X driver, or VT switching).
+
+Moreover, X has grown to incorporate modern features like offscreen
+rendering and scene composition, but subject to the limitations of the
+X architecture.  For example, the X implementation of composition adds
+additional context switches and makes things like input redirection
+difficult.
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=70mm]{x-architecture.png}
+\caption{\small \sl X with a compositing manager.\label{fig:X architecture}}
+\end{center}
+\end{figure}
+
+The diagram above illustrates the central role of the X server and
+compositor in operations, and the steps required to get contents on to
+the screen.
+
+Over time, X developers came to understand the shortcomings of this
+approach and worked to split things up.  Over the past several years,
+a lot of functionality has moved out of the X server and into
+client-side libraries or kernel drivers. One of the first components
+to move out was font rendering, with freetype and fontconfig providing
+an alternative to the core X fonts.  Direct rendering OpenGL as a
+graphics driver in a client side library went through some iterations,
+ending up as DRI2, which abstracted most of the direct rendering
+buffer management from client code. Then cairo came along and provided
+a modern 2D rendering library independent of X, and compositing
+managers took over control of the rendering of the desktop as toolkits
+like GTK+ and Qt moved away from using X APIs for rendering. Recently,
+memory and display management have moved to the Linux kernel, further
+reducing the scope of X and its driver stack.  The end result is a
+highly modular graphics stack.
 
 \subsection{Make the compositing manager the display server}
 
-Wayland is a new display server building on top of all those
-components. We are trying to distill out the functionality in the X
-server that is still used by the modern Linux desktop. This turns out
-to be not a whole lot. Applications can allocate their own off-screen
-buffers and render their window contents by themselves. In the end,
-what’s needed is a way to present the resulting window surface to a
-compositor and a way to receive input. This is what Wayland provides,
-by piecing together the components already in the eco-system in a
-slightly different way.
+Wayland is a new display server and compositing protocol, and Weston
+is the implementation of this protocol which builds on top of all the
+components above. We are trying to distill out the functionality in
+the X server that is still used by the modern Linux desktop. This
+turns out to be not a whole lot. Applications can allocate their own
+off-screen buffers and render their window contents directly, using
+hardware accelerated libraries like libGL, or high quality software
+implementations like those found in Cairo. In the end, what’s needed
+is a way to present the resulting window surface for display, and a
+way to receive and arbitrate input among multiple clients. This is
+what Wayland provides, by piecing together the components already in
+the eco-system in a slightly different way.
 
 X will always be relevant, in the same way Fortran compilers and VRML
 browsers are, but it’s time that we think about moving it out of the
 critical path and provide it as an optional component for legacy
 applications.
 
+Overall, the philosophy of Wayland is to provide clients with a way to
+manage windows and how their contents is displayed.  Rendering is left
+to clients, and system wide memory management interfaces are used to
+pass buffer handles between clients and the compositing manager.
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=50mm]{wayland-architecture.png}
+\caption{\small \sl The Wayland system\label{fig:Wayland architecture}}
+\end{center}
+\end{figure}
+
+The figure above illustrates how Wayland clients interact with a
+Wayland server.  Note that window management and composition are
+handled entirely in the server, significantly reducing complexity
+while marginally improving performance through reduced context
+switching.  The resulting system is easier to build and extend than a
+similar X system, because often changes need only be made in one
+place.  Or in the case of protocol extensions, two (rather than 3 or 4
+in the X case where window management and/or composition handling may
+also need to be updated).
 
 \section{Wayland protocol}
 
@@ -62,16 +120,16 @@ identifies which method in the interface to invoke.
 The server sends back events to the client, each event is emitted from
 an object.  Events can be error conditions.  The event includes the
 object id and the event opcode, from which the client can determine
-the type of event.  Events are generated both in response to a request
+the type of event.  Events are generated both in response to requests
 (in which case the request and the event constitutes a round trip) or
 spontaneously when the server state changes.
 
 \begin{itemize}
-\item state is broadcast on connect, events sent out when state
-  change.  client must listen for these changes and cache the state.
-  no need (or mechanism) to query server state.
+\item state is broadcast on connect, events are sent out when state
+  changes.  clients must listen for these changes and cache the state.
+  there is no need (or mechanism) to query server state.
 
-\item server will broadcast presence of a number of global objects,
+\item the server will broadcast the presence of a number of global objects,
   which in turn will broadcast their current state.
 \end{itemize}
 
@@ -82,7 +140,7 @@ This xml is used to generate the function prototypes that can be used by
 clients and compositors.
 
 The protocol entry points are generated as inline functions which just
-wraps the \verb:wl_proxy_*: functions.  The inline functions aren't
+wrap the \verb:wl_proxy_*: functions.  The inline functions aren't
 part of the library ABI and language bindings should generate their
 own stubs for the protocol entry points from the xml.
 
diff --git a/spec/wayland-architecture.png b/spec/wayland-architecture.png
new file mode 100644
index 0000000..4f92e0f
Binary files /dev/null and b/spec/wayland-architecture.png differ
diff --git a/spec/x-architecture.png b/spec/x-architecture.png
new file mode 100644
index 0000000..098205b
Binary files /dev/null and b/spec/x-architecture.png differ

commit f66aa1d08f75c6d89b539e2942baa18b454f83bc
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Jan 19 14:13:36 2012 -0800

    scanner: allow summary attributes in args and <description> in <protocol>
    
    Add support for arg summaries for use by detailed structure element
    descriptions.

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 722da4e..cad2507 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -34,8 +34,10 @@
     </description>
     <request name="bind">
       <description summary="bind an object to the display">
+	Binds a new, client created object to the server using @name as
+	the identifier.
       </description>
-      <arg name="name" type="uint"/>
+      <arg name="name" type="uint" summary="unique number id for object"/>
       <arg name="interface" type="string"/>
       <arg name="version" type="uint"/>
       <arg name="id" type="new_id" interface="wl_object"/>
diff --git a/src/scanner.c b/src/scanner.c
index e3b4226..f88fb4d 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -38,6 +38,11 @@ usage(int ret)
 
 #define XML_BUFFER_SIZE 4096
 
+struct description {
+	char *summary;
+	char *text;
+};
+
 struct protocol {
 	char *name;
 	char *uppercase_name;
@@ -45,11 +50,7 @@ struct protocol {
 	int type_index;
 	int null_run_length;
 	char *copyright;
-};
-
-struct description {
-	char *summary;
-	char *text;
+	struct description *description;
 };
 
 struct interface {
@@ -90,6 +91,7 @@ struct arg {
 	enum arg_type type;
 	char *interface_name;
 	struct wl_list link;
+	char *summary;
 };
 
 struct enumeration {
@@ -134,18 +136,10 @@ uppercase_dup(const char *src)
 	return u;
 }
 
-static char *
-desc_dup(char *src)
+static void
+desc_dump(char *src, int startcol)
 {
-	char *u;
-	int i, j = 0, col = 0, line = 0, len;
-
-	len = strlen(src) * 2;
-	u = malloc(len); /* enough room for newlines & comments */
-	if (!u)
-		return NULL;
-
-	memset(u, 0, len);
+	int i, j = 0, col = startcol, line = 0, len;
 
 	/* Strip leading space */
 	for (i = 0; isspace(src[i]); i++)
@@ -161,21 +155,20 @@ desc_dup(char *src)
 
 		if (col > 72 && isspace(src[i])) {
 			if (src[i+1]) {
-				u[j++] = '\n';
-				u[j++] = ' ';
-				u[j++] = '*';
-				u[j++] = ' ';
+				putchar('\n');
+				for (j = 0; j < startcol; j++)
+					putchar(' ');
+				putchar(' ');
+				putchar('*');
+				putchar(' ');
 			}
 			line++;
-			col = 0;
+			col = startcol;
 		} else {
-			u[j++] = src[i];
+			putchar(src[i]);
 			col++;
 		}
 	}
-	u[j++] = '\0';
-
-	return u;
 }
 
 static void
@@ -228,6 +221,7 @@ start_element(void *data, const char *element_name, const char **atts)
 
 		ctx->protocol->name = strdup(name);
 		ctx->protocol->uppercase_name = uppercase_dup(name);
+		ctx->protocol->description = NULL;
 	} else if (strcmp(element_name, "copyright") == 0) {
 		
 	} else if (strcmp(element_name, "interface") == 0) {
@@ -258,6 +252,7 @@ start_element(void *data, const char *element_name, const char **atts)
 		message->uppercase_name = uppercase_dup(name);
 		wl_list_init(&message->arg_list);
 		message->arg_count = 0;
+		message->description = NULL;
 
 		if (strcmp(element_name, "request") == 0)
 			wl_list_insert(ctx->interface->request_list.prev,
@@ -310,6 +305,10 @@ start_element(void *data, const char *element_name, const char **atts)
 			break;
 		}
 
+		arg->summary = NULL;
+		if (summary)
+			arg->summary = strdup(summary);
+
 		wl_list_insert(ctx->message->arg_list.prev, &arg->link);
 		ctx->message->arg_count++;
 	} else if (strcmp(element_name, "enum") == 0) {
@@ -357,8 +356,7 @@ start_element(void *data, const char *element_name, const char **atts)
 		else if (ctx->interface)
 			ctx->interface->description = description;
 		else
-			fprintf(stderr,
-				"<description> found in unsupported element\n");
+			ctx->protocol->description = description;
 		ctx->description = description;
 	}
 }
@@ -376,7 +374,7 @@ end_element(void *data, const XML_Char *name)
 		char *text = strndup(ctx->character_data,
 				     ctx->character_data_length);
 		if (text)
-			ctx->description->text = desc_dup(text);
+			ctx->description->text = strdup(text);
 		ctx->description = NULL;
 	} else if (strcmp(name, "request") == 0 ||
 		   strcmp(name, "event") == 0) {
@@ -605,7 +603,8 @@ emit_enumerations(struct interface *interface)
 			}
 			if (desc->text) {
 				printf(" *\n"
-				       " * %s\n", desc->text);
+				       " * ");
+				desc_dump(desc->text, 0);
 			}
 			printf(" */\n");
 		}
@@ -642,13 +641,28 @@ emit_structs(struct wl_list *message_list, struct interface *interface)
 			       "(none)");
 		}
 		printf(" *\n"
-		       " * %s\n"
-		       " */\n", desc->text);
+		       " * ");
+		desc_dump(desc->text, 0);
+		printf(" */\n");
 	}
 	printf("struct %s_%s {\n", interface->name,
 	       is_interface ? "interface" : "listener");
 
 	wl_list_for_each(m, message_list, link) {
+		struct description *mdesc = m->description;
+
+		printf("\t/**\n");
+		printf("\t * %s - %s\n", m->name, mdesc ? mdesc->summary :
+		       "(none)");
+		wl_list_for_each(a, &m->arg_list, link) {
+			printf("\t * @%s: %s\n", a->name, a->summary ?
+			       a->summary : "(none)");
+		}
+		if (mdesc) {
+			printf("\t * ");
+			desc_dump(mdesc->text, 8);
+		}
+		printf("\n\t */\n");
 		printf("\tvoid (*%s)(", m->name);
 
 		n = strlen(m->name) + 17;

commit 032b957698e03a3e6bb19dc051ecad1792da0385
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Wed Jan 18 19:17:23 2012 -0500

    protocol: Convert comments to new documentation tags

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 8d91187..722da4e 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -27,12 +27,10 @@
     THIS SOFTWARE.
   </copyright>
 
-  <!-- The core global object. This is a special singleton object.
-       It is used for internal wayland protocol features. -->
   <interface name="wl_display" version="1">
     <description summary="core global object">
-      The core global object. This is a special singleton object.
-      It is used for internal wayland protocol features.
+      The core global object.  This is a special singleton object.  It
+      is used for internal wayland protocol features.
     </description>
     <request name="bind">
       <description summary="bind an object to the display">
@@ -43,17 +41,21 @@
       <arg name="id" type="new_id" interface="wl_object"/>
     </request>
 
-    <!-- sync is an just an echo, which will reply with a key event.
-         Since requests are handled in-order, this can be used as a
-         barrier to ensure all previous requests have been handled.
-         The key argument can be used to correlate between multiple
-         sync invocations. -->
     <request name="sync">
+      <description summary="asynchronous roundtrip">
+	The sync request asks the server to invoke the 'done' request
+	on the provided wl_callback object.  Since requests are
+	handled in-order, this can be used as a barrier to ensure all
+	previous requests have been handled.
+      </description>
       <arg name="callback" type="new_id" interface="wl_callback"/>
     </request>
 
-    <!-- A fatal error has occurred. -->
     <event name="error">
+      <description summary="fatal error event">
+	The error event is sent out when a fatal (non-recoverable)
+	error has occurred.
+      </description>
       <arg name="object_id" type="object" interface="wl_object"/>
       <arg name="code" type="uint"/>
       <arg name="message" type="string"/>
@@ -72,25 +74,33 @@
 	     summary="server is out of memory"/>
     </enum>
 
-    <!-- Notify the client of global objects. These are objects that
-         are created by the server. Globals are published on the
-         initial client connection sequence, upon device hotplugs,
-         device disconnects, reconfiguration or other events.  The
-         server will always announce an object before the object sends
-         out events. -->
     <event name="global">
+      <description summary="announce global object">
+	Notify the client of global objects.  These are objects that
+	are created by the server.  Globals are published on the
+	initial client connection sequence, upon device hotplugs,
+	device disconnects, reconfiguration or other events.  A client
+	can 'bind' to a global object by using the bind request.  This
+	creates a client side handle that lets the object emit events
+	to the client and lets the client invoke requests on the
+	object.
+      </description>
       <arg name="name" type="uint"/>
       <arg name="interface" type="string"/>
       <arg name="version" type="uint"/>
     </event>
 
-    <!-- Notify the client of removed global objects. -->
     <event name="global_remove">
-      <arg name="name" type="uint" />
+      <description summary="announce removal of global object">
+	Notify the client of removed global objects.
+      </description>
+      <arg name="name" type="uint"/>
     </event>
 
-    <!-- Server has deleted the id and client can now reuse it. -->
     <event name="delete_id">
+      <description summary="acknowledge object id deletion">
+	Server has deleted the id and client can now reuse it.
+      </description>
       <arg name="id" type="uint" />
     </event>
   </interface>
@@ -101,19 +111,26 @@
     </event>
   </interface>
 
-  <!-- A compositor. This object is a global.  The compositor is in
-       charge of combining the contents of multiple surfaces into one
-       displayable output. -->
   <interface name="wl_compositor" version="1">
-    <!-- Factory request for a surface objects. A surface is akin to a
-         window. -->
+    <description summary="the compositor singleton">
+      A compositor.  This object is a singleton global.  The
+      compositor is in charge of combining the contents of multiple
+      surfaces into one displayable output.
+    </description>
+
     <request name="create_surface">
+      <description summary="create new surface">
+	Ask the compositor to create a new surface.
+      </description>
       <arg name="id" type="new_id" interface="wl_surface"/>
     </request>
   </interface>
 
-  <!-- Shared memory support -->
   <interface name="wl_shm" version="1">
+    <description summary="shared memory support">
+      Support for shared memory buffers.
+    </description>
+
     <enum name="error">
       <entry name="invalid_format" value="0"/>
       <entry name="invalid_stride" value="1"/>
@@ -125,13 +142,16 @@
       <entry name="xrgb8888" value="1"/>
     </enum>
 
-    <!-- Transfer a shm buffer to the server.  The allocated buffer
-         would include at least stride * height bytes starting at the
-         beginning of fd.  The file descriptor is transferred over the
-         socket using AF_UNIX magical features. width, height, stride
-         and format describe the respective properties of the pixel
-         data contained in the buffer. -->
     <request name="create_buffer">
+      <description summary="create a wl_buffer">
+	Transfer a shm buffer to the server.  The allocated buffer
+	would include at least stride * height bytes starting at the
+	beginning of fd.  The file descriptor is transferred over the
+	socket using AF_UNIX magical features. width, height, stride
+	and format describe the respective properties of the pixel
+	data contained in the buffer.
+      </description>
+
       <arg name="id" type="new_id" interface="wl_buffer"/>
       <arg name="fd" type="fd"/>
       <arg name="width" type="int"/>
@@ -145,36 +165,50 @@
     </event>
   </interface>
 
-
-  <!-- A pixel buffer. Created using the drm, shm or similar objects.
-       It has a size, visual and contents, but not a location on the
-       screen. -->
   <interface name="wl_buffer" version="1">
-    <!-- Notify the server that the specified area of the buffers
-         contents have changed.  To describe a more complicated area
-         of damage, break down the region into rectangles and use this
-         request several times.
-    -->
+    <description summary="content for a wl_surface">
+      A buffer provides the content for a wl_surface.  Buffers are
+      created through factory interfaces such as wl_drm, wl_shm or


Reply to: