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

wayland: Changes to 'upstream-experimental'



Rebased ref, commits from common ancestor:
commit 52d971c924d0147d6949096c9cf001d75828a054
Author: Bryce Harrington <bryce@osg.samsung.com>
Date:   Fri Feb 6 17:56:44 2015 -0800

    configure.ac: bump to version 1.6.93 for rc2 release

diff --git a/configure.ac b/configure.ac
index 5a8e915..7ef77eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([wayland_major_version], [1])
 m4_define([wayland_minor_version], [6])
-m4_define([wayland_micro_version],  [92])
+m4_define([wayland_micro_version],  [93])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit 371a9e0aefcc2bdef9c044a59d613ce6c175ed73
Author: Bill Spitzak <spitzak@gmail.com>
Date:   Tue Feb 3 14:26:58 2015 -0800

    configure.ac: Fallback to older detection code if pkg-config can't find expat
    
    This paritally reverts commit a4afd90f9f0c27ed5f3f313b915c260673f8be34.
    
    On older expat versions (ie the one on Ubuntu 12.04) there is no pkg-config
    file, so fall back to a test for the header and library. In addition the
    source for expat does not seem to be in a git repository but in cvs instead
    and it seems preferrable to not require cvs to build wayland.
    
    The restored test has been updated to use AC_SEARCH_LIBS. This version
    uses empty square brackets for the unused branches, similar to many other
    if statements in configure.ac.
    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
    Reviewed-by: Andrew Oakley <aoakley@espial.com>

diff --git a/configure.ac b/configure.ac
index 0426b53..5a8e915 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,16 @@ AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
 AC_SUBST([ICONDIR])
 
 if test "x$enable_scanner" = "xyes"; then
-	PKG_CHECK_MODULES(EXPAT, [expat])
+	PKG_CHECK_MODULES(EXPAT, [expat], [],
+		[AC_CHECK_HEADERS(expat.h, [],
+			[AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
+		 SAVE_LIBS="$LIBS"
+		 AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
+			[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+		 EXPAT_LIBS="$LIBS"
+		 LIBS="$SAVE_LIBS"
+		 AC_SUBST(EXPAT_LIBS)
+		])
 fi
 
 AC_PATH_PROG(XSLTPROC, xsltproc)

commit 76fe89ed535be7ff20e39d5d2ec3b26cb3fae37e
Author: Bryce Harrington <bryce@osg.samsung.com>
Date:   Wed Jan 7 11:56:54 2015 -0800

    tests: Fix FAIL in sanity-test (*timeout*) when Yama LSM enabled
    
    This fixes a regression in the testsuite since c3653f7f, where four of
    the timeout tests fail with "Timeouts suppressed" messages.
    
    The timeouts are being suppressed because the testsuite is erroneously
    detecting that a debugger is attached.  This detection mechanism
    (adopted from libinput) uses ptrace to test if there is a debugger
    parent process that can be attached.  Unfortunately, this is an
    unreliable test: Kernel security policies exist to restrict the scope of
    ptrace to prevent processes from snooping on one another.[1] This
    security policy is set as the default on Ubuntu, and potentially other
    Linux distributions.[2]
    
    The Yama documentation suggests, "For software that has defined
    application-specific relationships between a debugging process and its
    inferior (crash handlers, etc), prctl(PR_SET_PTRACER, pid, ...) can be
    used.  An inferior can declare which other process (and its descendents)
    are allowed to call PTRACE_ATTACH against it."  This prctl call has no
    effect if Yama LSM is not loaded.
    
    The child needs to be synchronized to the client to prevent a race
    condition where the child might try to operate before the parent has
    finished its prctl call.  This synchronization is done via pipes.
    
    This patch can be tested by running sanity-test with
    /proc/sys/kernel/yama/ptrace_scope set to 0 or 1; the test must pass for
    either value.
    
    1: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2d514487faf188938a4ee4fb3464eeecfbdcf8eb
    2: https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection
    
    Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
    Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
    Reviewed-by: Daniel Stone <daniels@collabora.com>
    Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
    
    v4: Allow parent to communicate error state to child to prevent leaving
    child in zombie state if parent hits an error.
    
    v5: Check errno instead of rc for error.  Don't waitpid on ppid.
    Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

diff --git a/tests/test-runner.c b/tests/test-runner.c
index 0412e85..1e5f587 100644
--- a/tests/test-runner.c
+++ b/tests/test-runner.c
@@ -34,6 +34,10 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/ptrace.h>
+#include <sys/prctl.h>
+#ifndef PR_SET_PTRACER
+# define PR_SET_PTRACER 0x59616d61
+#endif
 
 #include "test-runner.h"
 
@@ -267,29 +271,65 @@ stderr_reset_color(void)
 
 /* this function is taken from libinput/test/litest.c
  * (rev 028513a0a723e97941c39)
+ *
+ * Returns: 1 if a debugger is confirmed present; 0 if no debugger is
+ * present or if it can't be determined.
  */
 static int
 is_debugger_attached(void)
 {
 	int status;
 	int rc;
-	pid_t pid = fork();
+	pid_t pid;
+	int pipefd[2];
 
-	if (pid == -1)
+	if (pipe(pipefd) == -1) {
+		perror("pipe");
 		return 0;
+	}
 
-	if (pid == 0) {
+	pid = fork();
+	if (pid == -1) {
+		perror("fork");
+		close(pipefd[0]);
+		close(pipefd[1]);
+		return 0;
+	} else if (pid == 0) {
+		char buf;
 		pid_t ppid = getppid();
-		if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) == 0) {
-			waitpid(ppid, NULL, 0);
-			ptrace(PTRACE_CONT, NULL, NULL);
-			ptrace(PTRACE_DETACH, ppid, NULL, NULL);
-			rc = 0;
+
+		/* Wait until parent is ready */
+		close(pipefd[1]);  /* Close unused write end */
+		read(pipefd[0], &buf, 1);
+		close(pipefd[0]);
+		if (buf == '-')
+			_exit(1);
+		if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) != 0)
+			_exit(1);
+		if (!waitpid(-1, NULL, 0))
+			_exit(1);
+		ptrace(PTRACE_CONT, NULL, NULL);
+		ptrace(PTRACE_DETACH, ppid, NULL, NULL);
+		_exit(0);
+	} else {
+		close(pipefd[0]);
+
+		/* Enable child to ptrace the parent process */
+		rc = prctl(PR_SET_PTRACER, pid);
+		if (rc != 0 && errno != EINVAL) {
+			/* An error prevents us from telling if a debugger is attached.
+			 * Instead of propagating the error, assume no debugger present.
+			 * But note the error to the log as a clue for troubleshooting.
+			 * Then flag the error state to the client by sending '-'.
+			 */
+			perror("prctl");
+			write(pipefd[1], "-", 1);
 		} else {
-			rc = 1;
+			/* Signal to client that parent is ready by passing '+' */
+			write(pipefd[1], "+", 1);
 		}
-		_exit(rc);
-	} else {
+		close(pipefd[1]);
+
 		waitpid(pid, &status, 0);
 		rc = WEXITSTATUS(status);
 	}

commit 310fea467cf714d3ed7d66747c463790246f9be1
Author: Bryce Harrington <bryce@osg.samsung.com>
Date:   Tue Jan 27 16:32:16 2015 -0800

    doc: Fill in high level description for Surfaces
    
    Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
    Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>

diff --git a/doc/publican/sources/Protocol.xml b/doc/publican/sources/Protocol.xml
index 5f3e852..477063b 100644
--- a/doc/publican/sources/Protocol.xml
+++ b/doc/publican/sources/Protocol.xml
@@ -282,9 +282,16 @@
   <section id="sect-Protocol-Surface">
     <title>Surfaces</title>
     <para>
-      Surfaces are created by the client.
-      Clients don't know the global position of their surfaces, and
-      cannot access other clients surfaces.
+      A surface manages a rectangular grid of pixels that clients create
+      for displaying their content to the screen.  Clients don't know
+      the global position of their surfaces, and cannot access other
+      clients' surfaces.
+    </para>
+    <para>
+      Once the client has finished writing pixels, it 'commits' the
+      buffer; this permits the compositor to access the buffer and read
+      the pixels.  When the compositor is finished, it releases the
+      buffer back to the client.
     </para>
     <para>
       See <xref linkend="protocol-spec-wl_surface"/> for the protocol

commit 8094426a4168b78b924210e97ef178c78c1d296f
Author: Marek Chalupa <mchqwerty@gmail.com>
Date:   Mon Feb 2 10:40:21 2015 +0100

    test-runner: wait for concrete pid
    
    After running a test in fork, we were waiting for any child to terminate.
    It is OK unless the child forks again. If the child calls fork, the waitid can
    catch the child's child termination, stop block and run another test
    while the former test is still running. This is racy i. e. when adding socket.
    Since we have test compositor which uses fork, this situation can occur
    pretty frequently.
    
    Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
    Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
    Reviewed-by: Daniel Stone <daniels@collabora.com>

diff --git a/tests/test-runner.c b/tests/test-runner.c
index 70fa0ae..0412e85 100644
--- a/tests/test-runner.c
+++ b/tests/test-runner.c
@@ -351,7 +351,7 @@ int main(int argc, char *argv[])
 		if (pid == 0)
 			run_test(t); /* never returns */
 
-		if (waitid(P_ALL, 0, &info, WEXITED)) {
+		if (waitid(P_PID, pid, &info, WEXITED)) {
 			stderr_set_color(RED);
 			fprintf(stderr, "waitid failed: %m\n");
 			stderr_reset_color();

commit 48bf640d16b9f3a6920220e216d55665b42dc0c6
Author: Bryce Harrington <bryce@osg.samsung.com>
Date:   Fri Jan 30 19:04:07 2015 -0800

    configure.ac: re-bump version to 1.6.92 for rc1 release

diff --git a/configure.ac b/configure.ac
index 97222f0..0426b53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([wayland_major_version], [1])
 m4_define([wayland_minor_version], [6])
-m4_define([wayland_micro_version], [92])
+m4_define([wayland_micro_version],  [92])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit 23a57b69ffaad990172958ff1f64a687b8374a2d
Author: Jon Cruz <jonc@osg.samsung.com>
Date:   Fri Jan 30 18:07:24 2015 -0800

    doc: Fix out-of-tree build and also distcheck
    
    Corrects an issue that would cause out-of-tree builds to fail and also
    a few items that would cause distcheck to fail.
    
    Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>

diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index 283e077..edf3652 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -24,7 +24,7 @@ scanned_src_files_man =					\
 	$(top_srcdir)/src/wayland-client.c	\
 	$(top_srcdir)/src/wayland-client.h
 
-diagramsdir := dot
+diagramsdir := $(srcdir)/dot
 diagramssrc := $(wildcard $(diagramsdir)/*.gv)
 diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
 diagram_maps := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.map))
@@ -72,3 +72,5 @@ all-local: man/man3/wl_display.3
 clean-local:
 	rm -rf xml/
 	rm -rf man/
+
+EXTRA_DIST = $(diagramssrc)
diff --git a/doc/publican/Makefile.am b/doc/publican/Makefile.am
index c16a716..57728a0 100644
--- a/doc/publican/Makefile.am
+++ b/doc/publican/Makefile.am
@@ -158,4 +158,9 @@ uninstall-local:
 endif
 endif
 
-EXTRA_DIST = $(publican_sources) $(css_sources) $(img_sources) protocol-to-docbook.xsl protocol-interfaces-to-docbook.xsl doxygen-to-publican.xsl
+EXTRA_DIST = \
+	$(publican_sources) $(processed_sources) $(css_sources) $(img_sources) \
+	protocol-to-docbook.xsl \
+	protocol-interfaces-to-docbook.xsl \
+	doxygen-to-publican.xsl \
+	merge-mapcoords.xsl

commit 768724495e2d15af0b9ea8303fe776201e6d49de
Author: Bryce Harrington <bryce@osg.samsung.com>
Date:   Fri Jan 30 14:57:53 2015 -0800

    configure.ac: bump version to 1.6.92 for rc1 release

diff --git a/configure.ac b/configure.ac
index 6c3d611..97222f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([wayland_major_version], [1])
 m4_define([wayland_minor_version], [6])
-m4_define([wayland_micro_version], [91])
+m4_define([wayland_micro_version], [92])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit ccb17a05a3114414cebed49ce4af7725d705e205
Author: Bryce Harrington <bryce@osg.samsung.com>
Date:   Thu Jan 29 17:25:16 2015 -0800

    gitignore:  Add the new cpp-compile-test

diff --git a/.gitignore b/.gitignore
index 4e0f5d9..defe625 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,7 @@ Makefile.in
 array-test
 client-test
 connection-test
+cpp-compile-test
 display-test
 event-loop-test
 exec-fd-leak-checker

commit 6be2d9aaef6b59c475d27592d97cfad3d5dd777c
Author: Bill Spitzak <spitzak@gmail.com>
Date:   Wed Jan 28 18:44:08 2015 -0800

    doc: Intro text for doxygen output in it's own file
    
    (This patch has been modified to apply atop current master)
    
    This makes it considerably easier to edit the text and make it different
    for each library.
    
    To address previous concerns with this patch, I wrote some more complete
    introductory text. This is based on my understanding of these libraries, which
    may not be correct, and is pretty rudimentary for libwayland-server!
    
    However this intro text demonstrates how to create links to the
    doxygen-generated text. It looks like you cannot link to methods easily as the
    link name contains a hash number, but links to objects and classes work.
    Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
    Tested-by: Jon A. Cruz <jonc@osg.samsung.com>

diff --git a/doc/publican/Makefile.am b/doc/publican/Makefile.am
index 4a7f225..c16a716 100644
--- a/doc/publican/Makefile.am
+++ b/doc/publican/Makefile.am
@@ -26,7 +26,9 @@ publican_sources = \
 	$(srcdir)/sources/Protocol.xml \
 	$(srcdir)/sources/Compositors.xml \
 	$(srcdir)/sources/images/icon.svg  \
-	$(srcdir)/sources/images/wayland.png
+	$(srcdir)/sources/images/wayland.png \
+	$(srcdir)/sources/Client.xml \
+	$(srcdir)/sources/Server.xml
 
 processed_sources := \
 	$(srcdir)/sources/Architecture.xml \
diff --git a/doc/publican/doxygen-to-publican.xsl b/doc/publican/doxygen-to-publican.xsl
index cbcb281..7c3b507 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -4,49 +4,16 @@
 <xsl:param name="which" />
 
 <xsl:template match="/">
-  <!-- insert docbook's DOCTYPE blurb -->
-    <xsl:text disable-output-escaping = "yes"><![CDATA[
-<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
-  <!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
-%BOOK_ENTITIES;
-]>
-]]></xsl:text>
-
-  <appendix id="sect-Library-$which">
-    <xsl:attribute name="id">sect-Library-<xsl:value-of select="$which"/></xsl:attribute>
-    <title><xsl:value-of select="$which"/> API</title>
-
-    <para>
-      The open-source reference implementation of Wayland protocol is
-      split in two C libraries, <link
-      linkend="sect-Library-Client">libwayland-client</link> and <link
-      linkend="sect-Library-Server">libwayland-server</link>. Their
-      main responsibility is to handle the Inter-process communication
-      (<emphasis>IPC</emphasis>) with each other, therefore
-      guaranteeing the protocol objects marshaling and messages
-      synchronization.
-    </para>
-
-    <para>
-      Following is the Wayland library classes for the
-      <emphasis>libwayland-<xsl:value-of select="translate($which,
-      'SC', 'sc')"/></emphasis>.  This appendix describes in detail
-      the library's methods and their helpers, aiming implementors who
-      are building a Wayland <xsl:value-of select="translate($which,
-      'SC', 'sc')"/>.
-    </para>
-
-    <xsl:apply-templates select="/doxygen/compounddef[@kind!='file' and @kind!='dir']" />
-
-    <section id="{$which}-Functions">
-      <title>Functions</title>
-      <para />
-      <variablelist>
-        <xsl:apply-templates select="/doxygen/compounddef[@kind='file']/sectiondef/memberdef" />
-      </variablelist>
-    </section>
+  <xsl:apply-templates select="/doxygen/compounddef[@kind!='file' and @kind!='dir']" />
+
+  <section id="{$which}-Functions">
+    <title>Functions</title>
+    <para />
+    <variablelist>
+      <xsl:apply-templates select="/doxygen/compounddef[@kind='file']/sectiondef/memberdef" />
+    </variablelist>
+  </section>
 
-  </appendix>
 </xsl:template>
 
 <xsl:template match="parameteritem">
diff --git a/doc/publican/sources/Client.xml b/doc/publican/sources/Client.xml
new file mode 100644
index 0000000..a1e3341
--- /dev/null
+++ b/doc/publican/sources/Client.xml
@@ -0,0 +1,92 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
+  <!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
+  <!ENTITY doxygen SYSTEM "ClientAPI.xml">
+%BOOK_ENTITIES;
+]>
+<appendix id="sect-Library-Client">
+  <title>Client API</title>
+  <section><title>Introduction</title>
+  <para>
+    The open-source reference implementation of Wayland protocol is
+    split in two C libraries, libwayland-client and <link
+    linkend="sect-Library-Server">libwayland-server</link>. Their main
+    responsibility is to handle the Inter-process communication
+    (<emphasis>IPC</emphasis>) with each other, therefore guaranteeing
+    the protocol objects marshaling and messages synchronization.
+  </para>
+  <para>
+    A client uses libwayland-client to communicate with one or more
+    wayland servers. A <link
+    linkend="Client-classwl__display">wl_display</link> object is
+    created and manages each open connection to a server. At least one
+    <link linkend="Client-classwl__event__queue">wl_event_queue</link>
+    object is created for each wl_display, this holds events as they
+    are recieved from the server until they can be
+    processed. Multi-threading is supported by creating an additional
+    wl_event_queue for each additional thread, each object can have
+    it's events placed in a particular queue, so potentially a
+    different thread could be made to handle the events for each
+    object created.
+  </para>
+  <para>
+    Though some conveinence functions are provided, libwayland-client
+    is designed to allow the calling code to wait for events, so that
+    different polling mechanisms can be used. A file descriptor is
+    provided, when it becomes ready for reading the calling code can
+    ask libwayland-client to read the available events from it into
+    the wl_event_queue objects.
+  </para>
+  <para>
+    The library only provides low-level access to the wayland objects.
+    Each object created by the client is represented by a <link
+    linkend="Client-classwl__proxy">wl_proxy</link> object that this
+    library creates. This includes the id that is actually
+    communicated over the socket to the server, a void* data pointer
+    that is intended to point at a client's representation of the
+    object, and a pointer to a static <link
+    linkend="Client-structwl__interface">wl_interface</link> object,
+    which is generated from the xml and identifies the object's class
+    and can be used for introspection into the messages and events.
+  </para>
+  <para>
+    Messages are sent by calling wl_proxy_marshal. This will write a
+    message to the socket, by using the message id and the
+    wl_interface to identify the types of each argument and convert
+    them into stream format.  Most software will call type-safe
+    wrappers generated from the xml description of the <link
+    linkend="appe-Wayland-Protocol">Wayland protocols</link>. For
+    instance the C header file generated from the xml defines the
+    following inline function to transmit the <link
+    linkend="protocol-spec-wl_surface-request-attach">wl_surface::attach</link>
+    message:
+  </para>
+  <programlisting>static inline void
+wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)
+{
+  wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_ATTACH, buffer, x, y);
+}</programlisting>
+  <para>
+    Events (messages from the server) are handled by calling a
+    "dispatcher" callback the client stores in the wl_proxy for each
+    event. A language binding for a string-based interpreter, such as
+    CPython, might have a dispatcher that uses the event name from the
+    wl_interface to identify the function to call. The default
+    dispatcher uses the message id number to index an array of
+    functions pointers, called a wl_listener, and the wl_interface to
+    convert data from the stream into arguments to the function. The
+    C header file generated from the xml defines a per-class structure
+    that forces the function pointers to be of the correct type, for
+    instance the <link
+    linkend="protocol-spec-wl_surface-event-enter">wl_surface::enter</link>
+    event defines this pointer in the wl_surface_listener object:
+  </para>
+  <programlisting>struct wl_surface_listener {
+  void (*enter)(void *data, struct wl_surface *, struct wl_output *);
+  ...
+}</programlisting>
+  <para>
+  </para>
+  </section>
+  &doxygen;
+</appendix>
diff --git a/doc/publican/sources/Server.xml b/doc/publican/sources/Server.xml
new file mode 100644
index 0000000..f627d64
--- /dev/null
+++ b/doc/publican/sources/Server.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
+  <!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
+  <!ENTITY doxygen SYSTEM "ServerAPI.xml">
+%BOOK_ENTITIES;
+]>
+<appendix id="sect-Library-Server">
+  <title>Server API</title>
+  <section><title>Introduction</title>
+  <para>
+    The open-source reference implementation of Wayland protocol is
+    split in two C libraries, <link
+    linkend="sect-Library-Client">libwayland-client</link> and
+    libwayland-server. Their main responsibility is to handle the
+    Inter-process communication (<emphasis>IPC</emphasis>) with each
+    other, therefore guaranteeing the protocol objects marshaling and
+    messages synchronization.
+  </para>
+  <para>
+    The server library is designed to work much like libwayland-client,
+    although it is considerably complicated due to the server needing
+    to support multiple versions of the protocol. It is best to learn
+    libwayland-client first.
+  </para>
+  <para>
+    Each open socket to a client is represented by a <link
+    linkend="Server-structwl__client">wl_client</link>.  The equvalent
+    of the <link linkend="Client-classwl__proxy">wl_proxy</link> that
+    libwayland-client uses to represent an object is <link
+    linkend="Server-structwl__resource">wl_resource</link> for
+    client-created objects, and <link
+    linkend="Server-structwl__global">wl_global</link> for objects
+    created by the server.
+  </para>
+  <para>
+    Often a server is also a client for another Wayland server, and
+    thus must link with both libwayland-client and libwayland-server.
+    This produces some type name conflicts (such as the <link
+    linkend="Client-classwl__display">client wl_display</link> and
+    <link linkend="Server-structwl__display">server wl_display</link>,
+    but the duplicate-but-not-the-same types are opaque, and accessed
+    only inside the correct library where it came from. Naturally that
+    means that the program writer needs to always know if a pointer to
+    a wl_display is for the server or client side and use the
+    corresponding functions.
+  </para>
+  </section>
+  &doxygen;
+</appendix>
diff --git a/doc/publican/sources/Wayland.xml b/doc/publican/sources/Wayland.xml
index 5ae90bb..2f47f13 100644
--- a/doc/publican/sources/Wayland.xml
+++ b/doc/publican/sources/Wayland.xml
@@ -12,7 +12,6 @@
   <xi:include href="Architecture.xml" xmlns:xi="http://www.w3.org/2001/XInclude"; />
   <xi:include href="Protocol.xml" xmlns:xi="http://www.w3.org/2001/XInclude"; />
   <xi:include href="ProtocolSpec.xml" xmlns:xi="http://www.w3.org/2001/XInclude"; />
-  <xi:include href="ClientAPI.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-  <xi:include href="ServerAPI.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="Client.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="Server.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 </book>
-

commit a4afd90f9f0c27ed5f3f313b915c260673f8be34
Author: Andrew Oakley <aoakley@espial.com>
Date:   Tue Jan 27 17:18:13 2015 +0000

    configure.ac: use pkg-config to find expat
    
    This is now done in the same way as the libffi dependency and still
    allows the library to be installed in a non-standard location (with
    PKG_CONFIG_PATH).

diff --git a/Makefile.am b/Makefile.am
index 43b741a..0fccf86 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,6 +65,7 @@ if ENABLE_SCANNER
 wayland_scanner = $(top_builddir)/wayland-scanner
 bin_PROGRAMS = wayland-scanner
 wayland_scanner_SOURCES = src/scanner.c
+wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
 wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
 $(BUILT_SOURCES) : wayland-scanner
 pkgconfig_DATA += src/wayland-scanner.pc
diff --git a/configure.ac b/configure.ac
index b0a959a..6c3d611 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,17 +84,8 @@ AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
 		     [  ICONDIR=${datadir}/icons])
 AC_SUBST([ICONDIR])
 
-EXPAT_LIB=""
-AC_ARG_WITH(expat, [  --with-expat=<dir>      Use expat from here],
-		   [ expat=$withval
-		     CPPFLAGS="$CPPFLAGS -I$withval/include"
-		     LDFLAGS="$LDFLAGS -L$withval/lib" ] )
 if test "x$enable_scanner" = "xyes"; then
-	AC_CHECK_HEADERS(expat.h, [AC_DEFINE(HAVE_EXPAT_H)],
-			 [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
-	AC_CHECK_LIB(expat, XML_ParserCreate, [EXPAT_LIBS="-lexpat"],
-		     [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
-	AC_SUBST(EXPAT_LIBS)
+	PKG_CHECK_MODULES(EXPAT, [expat])
 fi
 
 AC_PATH_PROG(XSLTPROC, xsltproc)

commit cd0cf5a106b0578da9706f9eb3ceac3ff07c26ee
Author: Rui Matos <tiagomatos@gmail.com>
Date:   Tue Jan 6 17:35:56 2015 +0100

    doc/publican/Makefile.am: Add a missing order-only prerequisite
    
    Otherwise a parallel make invocation could fail due to the directory
    not existing.
    
    Signed-off-by: Rui Matos <tiagomatos@gmail.com>
    Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>

diff --git a/doc/publican/Makefile.am b/doc/publican/Makefile.am
index 7e4fc48..4a7f225 100644
--- a/doc/publican/Makefile.am
+++ b/doc/publican/Makefile.am
@@ -96,7 +96,7 @@ $(builddir)/en-US/ProtocolSpec.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)
 	$(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-to-docbook.xsl \
 		$(top_srcdir)/protocol/wayland.xml > $@
 
-$(builddir)/en-US/ProtocolInterfaces.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-interfaces-to-docbook.xsl
+$(builddir)/en-US/ProtocolInterfaces.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-interfaces-to-docbook.xsl | $(builddir)/en-US
 	$(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-interfaces-to-docbook.xsl \
 		$(top_srcdir)/protocol/wayland.xml > $@
 

commit 5ec8062df26f21cfe7a031eaf83a1b4d99085f36
Author: Derek Foreman <derekf@osg.samsung.com>
Date:   Wed Jan 28 09:25:03 2015 -0600

    event-loop: Dispatch idle callbacks twice
    
    To fix a shutdown crash in weston's x11 compositor I want to move the
    weston X window close to an idle handler.
    
    Since idle handlers are processed at the start of an event loop, the
    handler that deals with window close will run at the start of the
    next input_loop dispatch, after which the dispatcher blocks on epoll
    forever (since all input events that will ever occur have been consumed).
    
    Dispatching idle callbacks both at the start and end of event-loop
    processing will prevent this permanent blocking.
    
    Note that just moving the callback dispatch could theoretically
    result in an idle callback being delayed indefinitely while waiting
    for epoll_wait() to complete.
    
    Callbacks are removed from the list when they're run, so the second
    dispatch won't result in any extra calls.
    
    Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
    Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>

diff --git a/src/event-loop.c b/src/event-loop.c
index 1f571ba..d257d78 100644
--- a/src/event-loop.c
+++ b/src/event-loop.c
@@ -421,10 +421,12 @@ wl_event_loop_dispatch(struct wl_event_loop *loop, int timeout)
 
 	wl_event_loop_process_destroy_list(loop);
 
+	wl_event_loop_dispatch_idle(loop);
+
 	do {
 		n = post_dispatch_check(loop);
 	} while (n > 0);
-		
+
 	return 0;
 }
 

commit 7575e2ea19dcb6012a6fd4729197d12a68b89025
Author: Jon Cruz <jonc@osg.samsung.com>
Date:   Wed Jan 28 17:24:06 2015 -0800

    doc: update diagrams for compatibility.
    
    Change attribute separators for compatiblity with graphviz older than 2.30.
    
    Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>

diff --git a/doc/doxygen/dot/wayland-architecture.gv b/doc/doxygen/dot/wayland-architecture.gv
index b86f4b5..2d5db84 100644
--- a/doc/doxygen/dot/wayland-architecture.gv
+++ b/doc/doxygen/dot/wayland-architecture.gv
@@ -1,39 +1,39 @@
 digraph arch_wayland {
     edge[
-        fontname="DejaVu Sans";
-        dir="both";
-        arrowtail="dot";
-        arrowsize=.5;
-        fontname="DejaVu Sans"
-        fontsize="18";
+        fontname="DejaVu Sans",
+        dir="both",
+        arrowtail="dot",
+        arrowsize=.5,
+        fontname="DejaVu Sans",
+        fontsize="18",
     ]
 
     node[
-        shape="Mrecord";
-        color=none;
-        fillcolor="#ffbc00";
-        style="filled";
-        fontname="DejaVu Sans"
-        fontsize="18";
+        shape="Mrecord",
+        color=none,
+        fillcolor="#ffbc00",
+        style="filled",
+        fontname="DejaVu Sans",
+        fontsize="18",
    ]
 
-    c1 [label="Wayland Client"; URL="#c1"]
-    c2 [label="Wayland Client"; URL="#c2"]
+    c1 [label="Wayland Client", URL="#c1"]
+    c2 [label="Wayland Client", URL="#c2"]
 
-    comp [tooltip="Wayland Compositor" label="|{|Wayland\nCompositor|}|"; URL="#comp"]
+    comp [tooltip="Wayland Compositor", label="|{|Wayland\nCompositor|}|", URL="#comp"]
 
-    impl [tooltip="KMS evdev Kernel" label="|{{KMS|evdev}|Kernel}|"; URL="#impl"]
+    impl [tooltip="KMS evdev Kernel", label="|{{KMS|evdev}|Kernel}|", URL="#impl"]
 
 
-    c1 -> comp [taillabel="③"; labeldistance=2.5; URL="#step_3"];
+    c1 -> comp [taillabel="③", labeldistance=2.5, URL="#step_3"];
     c2 -> comp;
 
-    comp -> c1 [label="②"; URL="#step_2"];
+    comp -> c1 [label="②", URL="#step_2"];
     comp -> c2;
 
-    comp -> impl [xlabel = "④"; URL="#step_4"];
-    comp -> impl [style = invis; label="    "];
-    impl -> comp [xlabel = "①"; URL="#step_1"];
+    comp -> impl [xlabel = "④", URL="#step_4"];
+    comp -> impl [style = invis, label="    "];
+    impl -> comp [xlabel = "①", URL="#step_1"];
 
     c1 -> c2 [style=invis];
- }
+}
diff --git a/doc/doxygen/dot/x-architecture.gv b/doc/doxygen/dot/x-architecture.gv
index 85c98a3..4ea49bf 100644
--- a/doc/doxygen/dot/x-architecture.gv
+++ b/doc/doxygen/dot/x-architecture.gv
@@ -1,52 +1,52 @@
 digraph arch_x {
     edge[
-        fontname="DejaVu Sans";
-        dir="both";
-        arrowtail="dot";
-        arrowsize=.5;
-        fontname="DejaVu Sans"
-        fontsize="18";
+        fontname="DejaVu Sans",
+        dir="both",
+        arrowtail="dot",
+        arrowsize=.5,
+        fontname="DejaVu Sans",
+        fontsize="18",
     ]
 
     node[
-        shape="Mrecord";
-        color=none;
-        fillcolor="#ffbc00";
-        style="filled";
-        fontname="DejaVu Sans"
-        fontsize="18";
+        shape="Mrecord",
+        color=none,
+        fillcolor="#ffbc00",
+        style="filled",
+        fontname="DejaVu Sans",
+        fontsize="18",
     ]
 
     {
         rank=same;
-        c1 [label="X Client"; URL="#c1"]
-        c3 [label="X Client"; URL="#c3"]
+        c1 [label="X Client", URL="#c1"]
+        c3 [label="X Client", URL="#c3"]
     }
-    c2 [label="X Client"; URL="#c2"]
+    c2 [label="X Client", URL="#c2"]
 
     {
         rank=same;
-        xserver [tooltip="X Server" label="|{|X Server|}|"; URL="#xserver"]
-        comp [tooltip="Compositor" label="|{|Compositor|}|"; URL="#comp"]
+        xserver [tooltip="X Server", label="|{|X Server|}|", URL="#xserver"]
+        comp [tooltip="Compositor", label="|{|Compositor|}|", URL="#comp"]
     }
 
-    impl [tooltip="KMS evdev Kernel" label="|{{KMS|evdev}|Kernel}|"; URL="#impl"]
+    impl [tooltip="KMS evdev Kernel", label="|{{KMS|evdev}|Kernel}|", URL="#impl"]
 
-    c1 -> xserver [taillabel="③"; labeldistance=2; URL="#step_3"];
+    c1 -> xserver [taillabel="③", labeldistance=2, URL="#step_3"];
     c2 -> xserver;
     c3 -> xserver;
 
-    xserver -> c1 [taillabel="②"; labeldistance=2; URL="#step_2"];
+    xserver -> c1 [taillabel="②", labeldistance=2, URL="#step_2"];
     xserver -> c2;
     xserver -> c3;
 
-    xserver -> impl [taillabel = "⑥"; labeldistance=1.75; URL="#step_6"];
-    xserver -> impl [style = invis; label="    "];
-    impl -> xserver [taillabel = "①"; labeldistance=1.75; URL="#step_1"];
+    xserver -> impl [taillabel="⑥", labeldistance=1.75, URL="#step_6"];
+    xserver -> impl [style=invis, label="    "];
+    impl -> xserver [taillabel="①", labeldistance=1.75, URL="#step_1"];
 
     xserver -> comp [style=invis];
-    xserver -> comp [taillabel="④"; labeldistance=1.75; labelangle=-45; URL="#step_4"];
-    comp -> xserver [taillabel="⑤"; URL="#step_5"];
+    xserver -> comp [taillabel="④", labeldistance=1.75, labelangle=-45, URL="#step_4"];
+    comp -> xserver [taillabel="⑤", URL="#step_5"];
     comp -> xserver [style=invis]
 
     c1 -> c2 [style=invis];

commit 8cf9a367c98756d4bdacc987573e23f13faf28e6
Author: Jon Cruz <jonc@osg.samsung.com>
Date:   Wed Jan 28 17:24:05 2015 -0800

    doc: Create hot-linked areas in documents.
    
    Added xslt processing to give DocBook output diagram image maps/hot-linked
    areas consistent with those automatically generated by Doxygen.
    
    Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>

diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index ea206b9..283e077 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -1,5 +1,5 @@
 
-.SUFFIXES = .gv .png
+.SUFFIXES = .gv .png .map
 
 noinst_DATA = xml/Client/index.xml xml/Server/index.xml
 dist_noinst_DATA = wayland.doxygen.in
@@ -27,6 +27,7 @@ scanned_src_files_man =					\
 diagramsdir := dot
 diagramssrc := $(wildcard $(diagramsdir)/*.gv)
 diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
+diagram_maps := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.map))
 
 # find all man/man3/wl_foo.3 pages
 # for this to work, we need to create them before the man target (hence
@@ -38,7 +39,9 @@ alldirs := xml xml/Client xml/Server man/man3
 
 $(diagrams): $(diagramssrc)
 
-xml/%/index.xml: $(scanned_src_files_%) wayland.doxygen $(diagrams) | xml/%
+$(diagram_maps):  $(diagramssrc)
+
+xml/%/index.xml: $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | xml/%
 	$(AM_V_GEN)(cat wayland.doxygen; \
           echo "GENERATE_XML=YES"; \
           echo "XML_OUTPUT=xml/$*"; \
@@ -56,6 +59,9 @@ man/man3/wl_display.3: $(scanned_src_files_man) wayland.doxygen | man/man3
 xml/%.png: $(diagramsdir)/%.gv | xml
 	$(AM_V_GEN)$(DOT) -Tpng -o$@ $<
 
+xml/%.map: $(diagramsdir)/%.gv | xml
+	$(AM_V_GEN)$(DOT) -Tcmapx_np -o$@ $<
+
 # general rule to create one of the listed directories.
 $(alldirs):
 	$(AM_V_GEN)$(MKDIR_P) $@
diff --git a/doc/publican/Makefile.am b/doc/publican/Makefile.am
index a4d6d58..7e4fc48 100644
--- a/doc/publican/Makefile.am
+++ b/doc/publican/Makefile.am
@@ -23,13 +23,15 @@ publican_sources = \
 	$(srcdir)/sources/Foreword.xml \
 	$(srcdir)/sources/Preface.xml \
 	$(srcdir)/sources/Revision_History.xml \
-	$(srcdir)/sources/Introduction.xml \
-	$(srcdir)/sources/Architecture.xml \
 	$(srcdir)/sources/Protocol.xml \
 	$(srcdir)/sources/Compositors.xml \
 	$(srcdir)/sources/images/icon.svg  \
 	$(srcdir)/sources/images/wayland.png
 
+processed_sources := \
+	$(srcdir)/sources/Architecture.xml \
+	$(srcdir)/sources/Introduction.xml
+
 css_sources = \
 	$(srcdir)/sources/css/brand.css \
 	$(srcdir)/sources/css/common.css \
@@ -45,6 +47,10 @@ doxygen_img_sources := \
 	$(doxydir)/xml/wayland-architecture.png \
 	$(doxydir)/xml/x-architecture.png
 
+map_sources := \
+	$(doxydir)/xml/x-architecture.map \
+	$(doxydir)/xml/wayland-architecture.map
+


Reply to: