profile/ivi/wayland.git
11 years agoconfigure.ac: Bump version to 1.1.0 upstream
Kristian Høgsberg [Tue, 16 Apr 2013 00:55:33 +0000 (20:55 -0400)]
configure.ac: Bump version to 1.1.0

11 years agodocs: Create html-pdf directories too
Kristian Høgsberg [Tue, 16 Apr 2013 00:50:52 +0000 (20:50 -0400)]
docs: Create html-pdf directories too

Fixes make dist here.

11 years agodoc: use a dynamic list of man pages
Peter Hutterer [Thu, 4 Apr 2013 01:29:01 +0000 (11:29 +1000)]
doc: use a dynamic list of man pages

This requires that doxygen is run before the man target so find can actually
find the man pages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Improve "Library" and "Compositors" chapter
Peter Hutterer [Thu, 4 Apr 2013 01:29:00 +0000 (11:29 +1000)]
doc: Improve "Library" and "Compositors" chapter

Originally written Tiago Vignatti <tiago.vignatti@intel.com>

Some modifications to adjust for previously merged conflicting patches and link
to the sections (instead of <emphasis>).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: create a fake make target to de-duplicate the xml merging process
Peter Hutterer [Thu, 4 Apr 2013 01:28:59 +0000 (11:28 +1000)]
doc: create a fake make target to de-duplicate the xml merging process

The only difference between the server and client xml files is the
directories and files being named *server* and *client*, respectively. Add a
new make target to get that process done to avoid duplication

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: generate server documentation from XML too
Peter Hutterer [Thu, 4 Apr 2013 01:28:58 +0000 (11:28 +1000)]
doc: generate server documentation from XML too

Same as WaylandClientAPI.xml we now also generate WaylandServerAPI.xml for
publication. Most of this hunk is just adding a client/ or server/ into the
xml path to keep the two separate.

The change in wayland.doxygen now causes a standard doxygen call to not
generate anything - what is generated is specified through the options
passed by make.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Capitalize all Wayland occurrences
Tiago Vignatti [Thu, 4 Apr 2013 01:28:57 +0000 (11:28 +1000)]
doc: Capitalize all Wayland occurrences

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
[re-run of search/replace after rebasing]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoprotocol: input documentation fixes
Peter Hutterer [Thu, 4 Apr 2013 01:06:02 +0000 (11:06 +1000)]
protocol: input documentation fixes

Fix summary for wl_touch::motion, extend summary for wl_touch::down to match
up/motion a bit better.

Fix a typo in wl_touch, and claim that it's zero or more update events, not
one or more.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agowayland-client: Avoid null dereference when handling deletion
Rob Bradford [Thu, 4 Apr 2013 16:26:57 +0000 (17:26 +0100)]
wayland-client: Avoid null dereference when handling deletion

If an unknown id is deleted then the lookup in the map will return NULL and
so we should avoid dereferencing that.

As this is unexpected behaviour log a message about the problem too.

11 years agodocs: Use MIT for documentation license
Kristian Høgsberg [Wed, 3 Apr 2013 20:26:14 +0000 (16:26 -0400)]
docs: Use MIT for documentation license

11 years agoconfigure.ac: Fix publican version check
Kristian Høgsberg [Wed, 3 Apr 2013 20:22:44 +0000 (16:22 -0400)]
configure.ac: Fix publican version check

This sure is ugly - we feed output of publican -v into bc to compare
against minimum required version, 2.8.  That's bad enough, but when
publican suddenly report 3.0.0, bc starts complaining...

Use sed to filter out 3.0 from the 'version=3.0.0' output from publican
instead.  Seem a little more robust, but it's just a matter of time before
something else breaks this flaky setup.

Hey, publican, how about shipping .pc files?

11 years agodoc: rename "Wayland" to "publican"
Peter Hutterer [Wed, 3 Apr 2013 19:43:34 +0000 (15:43 -0400)]
doc: rename "Wayland" to "publican"

This directory was called Wayland during my early tries with publican where
the source layout was different and it needed to be set to the same name as
the publican output directory. This reason doesn't exist anymore, so re-name
it to publican to make it more obvious what's hiding in here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: generate man pages from doxygen
Peter Hutterer [Tue, 2 Apr 2013 01:08:59 +0000 (11:08 +1000)]
doc: generate man pages from doxygen

Create client-side and server-side man pages from doxygen. The doxygen
config options are virtually the same as for the XML output, but we do pass
in the specific options via stdin.

WL_EXPORT is predefined to the empty string, it makes the man page look
confusing and provides no value here anyway. This applies for both xml and
man output.

JAVADOC_AUTOBRIEF is disabled for man pages, the formatting in the resulting
man page is IMO hard to read.

Most of the server man pages are virtually empty, there's just not enough
documentation in the source files.

Interesting issue: the usage of @code in the protocol to reference the
parameter breaks the expansion of WL_EXPORT, thus leaving us with WL_EXPORT
in all the man pages.
Presumably this is an issue with doxygen interpreting this as a @code
command, but I already wasted enough time narrowing this down.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoprotocol: fix two protocol description 'typos'
Peter Hutterer [Wed, 3 Apr 2013 19:27:43 +0000 (15:27 -0400)]
protocol: fix two protocol description 'typos'

Remove "mice, for example", it's described in the wl_pointer interface in
detail. And remove space before the full stop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoprotocol: document wl_pointer, wl_keyboard, wl_touch
Peter Hutterer [Mon, 1 Apr 2013 23:58:17 +0000 (09:58 +1000)]
protocol: document wl_pointer, wl_keyboard, wl_touch

Most of this should be clear, but let's spell a few things out.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoprotocol: use "summary", not "description" for xkb_v1 format
Peter Hutterer [Mon, 1 Apr 2013 23:58:16 +0000 (09:58 +1000)]
protocol: use "summary", not "description" for xkb_v1 format

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: don't start a variable list if we have no sub-elements
Peter Hutterer [Tue, 2 Apr 2013 00:09:12 +0000 (10:09 +1000)]
doc: don't start a variable list if we have no sub-elements

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: improve formatting of client-side documentation
Peter Hutterer [Tue, 2 Apr 2013 00:09:11 +0000 (10:09 +1000)]
doc: improve formatting of client-side documentation

A bunch of changes to the xsl transformation stylesheet to make Chapter 4
(Client API) look nicer and more readable.

Main changes:
- function synopsis listed
- lists for parameters and return values
- long function descriptions
- misc other hooks for "see also", "note", etc

The long description is a sore point. doxygen xml output is difficult to
parse with the output being in the form of
<detailed description>
  <para>
   <parameterlist> .... </parameterlist>
<simplesect kind="return">... </simplesect>
First paragraph of long description
  </para>
  <para>
   Second paragraph of long <sometag>description</sometag>
  </para>
</detaileddescription>

So we need to ignore parameterlist and simplesect, but extract the text from
everything else. Any improvements on that welcome.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: change wording in section introduction
Peter Hutterer [Tue, 2 Apr 2013 00:09:10 +0000 (10:09 +1000)]
doc: change wording in section introduction

If we don't have descriptions of classes, the "And" is awkward.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: add wayland.doxygen as target dependency
Peter Hutterer [Tue, 2 Apr 2013 00:09:09 +0000 (10:09 +1000)]
doc: add wayland.doxygen as target dependency

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoRename en_US to sources
Peter Hutterer [Wed, 3 Apr 2013 19:02:29 +0000 (15:02 -0400)]
Rename en_US to sources

The reason this directory exists is because we need to copy it into
$builddir so we can combine it with generated sources (we can't pass
multiple source paths into publican).

So instead of having en_US, renamed to en-US stop the confusion and rename
the sources to "sources". That gets copied to en-US which will then contain
the actual output.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: explain the publican build process
Peter Hutterer [Tue, 2 Apr 2013 00:09:07 +0000 (10:09 +1000)]
doc: explain the publican build process

This makefile is a bit hard to read due to some publican requirements and
the need to generate some files through XSLT. Explain the lot, so that those
looking at this roughly know what will hit them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: clarify how ClientAPI.xml is built
Peter Hutterer [Tue, 2 Apr 2013 00:09:06 +0000 (10:09 +1000)]
doc: clarify how ClientAPI.xml is built

I found the comment a bit confusing and it's quite hard to read. re-explain
with a simple step-by-step list

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Format Chapter 4 paragraphs correctly
Tiago Vignatti [Tue, 2 Apr 2013 00:09:05 +0000 (10:09 +1000)]
doc: Format Chapter 4 paragraphs correctly

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agodoc: minor title wording fix
Peter Hutterer [Tue, 2 Apr 2013 00:09:03 +0000 (10:09 +1000)]
doc: minor title wording fix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Change chapter title to a more descriptive one
Tiago Vignatti [Tue, 2 Apr 2013 00:09:00 +0000 (10:09 +1000)]
doc: Change chapter title to a more descriptive one

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Rename Overview.xml to Introduction.xml
Tiago Vignatti [Tue, 2 Apr 2013 00:08:59 +0000 (10:08 +1000)]
doc: Rename Overview.xml to Introduction.xml

Rename Overview.xml to Introduction.xml, reflecting the previous commit.
Organize also Wayland.xml order of the includes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Improve the first chapter text and definitions
Tiago Vignatti [Tue, 2 Apr 2013 00:08:58 +0000 (10:08 +1000)]
doc: Improve the first chapter text and definitions

In the beginning of the chapter, it was defined what is the so called "X"
thing and was removed the "Wayland" and "Weston" definitions cause we're
defining later at 1.2 anyway.

"Introduction", "Motivation" and "Compositing manager as the display server"
names sound better a bit than "Overview", "Replacing X11" and "Make the
compositing manager the display server" respectively. That was changed also.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Set book edition number to the "1"
Tiago Vignatti [Tue, 2 Apr 2013 00:08:57 +0000 (10:08 +1000)]
doc: Set book edition number to the "1"

"1" sounds better when we mention about the "first" edition or say the
"publishing" edition.

If needed, we might want to increase the edition numbers automatically later,
for instance based on the micro version of the protocol or something like
that.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: Add a Foreword and a Preface
Tiago Vignatti [Tue, 2 Apr 2013 00:08:56 +0000 (10:08 +1000)]
doc: Add a Foreword and a Preface

In particular, the preface defines the scope of this document we're building
-- is the definition there enough with respect to what we want with this?

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: don't add a para for an empty summary
Peter Hutterer [Tue, 2 Apr 2013 00:08:55 +0000 (10:08 +1000)]
doc: don't add a para for an empty summary

Removes enough empty lines to cut the PDF down by 4 pages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoutils: const-ify some function arguments
Giulio Camuffo [Wed, 3 Apr 2013 15:29:16 +0000 (17:29 +0200)]
utils: const-ify some function arguments

11 years agowayland-server: Listen for pointer current surface destruction
Rob Bradford [Wed, 3 Apr 2013 14:20:49 +0000 (15:20 +0100)]
wayland-server: Listen for pointer current surface destruction

Add a destroy listener so that when the current surface associated with the
pointer is destroyed we can reset the pointer to the current surface. In order
to achieve this add a wl_pointer_set_current() which handles assigning the
surface and creating the listener.

This resolves a use-after-free error triggered with nested popup surfaces

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=696946

11 years agodocs: Document non-blocking behaviour of wl_display_flush()
Kristian Høgsberg [Wed, 3 Apr 2013 01:31:02 +0000 (21:31 -0400)]
docs: Document non-blocking behaviour of wl_display_flush()

11 years agoserver: use void* instead of function pointer for wl_object.implementation
Giulio Camuffo [Thu, 28 Mar 2013 13:55:51 +0000 (14:55 +0100)]
server: use void* instead of function pointer for wl_object.implementation

This is needed to make C++ programs that include wayland-server.h build:
C++ does not allow conversions from data pointers to function pointers.

11 years agoserver: use the right function pointer type in wl_signal_get
Giulio Camuffo [Tue, 2 Apr 2013 20:29:46 +0000 (22:29 +0200)]
server: use the right function pointer type in wl_signal_get

use the wl_notify_func type, and not void *, or else wl_signal_get
will not be usable by a c++ plugin because it will not cast
void * to a function pointer.

11 years agodocs: Add information about serials and timestamps
Matthias Clasen [Sat, 30 Mar 2013 18:09:25 +0000 (14:09 -0400)]
docs: Add information about serials and timestamps

Add some information about serials, timestamps and their uses
to the Input section in the protocol overview.

11 years agodocs: Document granularity of timestamps
Matthias Clasen [Sat, 30 Mar 2013 18:09:24 +0000 (14:09 -0400)]
docs: Document granularity of timestamps

This information is necessary to make any use of these fields.

11 years agodocs: Remove mention of touch focus
Kristian Høgsberg [Tue, 2 Apr 2013 00:06:36 +0000 (20:06 -0400)]
docs: Remove mention of touch focus

There is no focused surface for a touch screen.

11 years agodocs: Add details about grabs
Matthias Clasen [Sat, 30 Mar 2013 05:11:47 +0000 (01:11 -0400)]
docs: Add details about grabs

Mention implicit grabs, (lack of) explicit grabs, and popup
windows.

11 years agodocs: Add details about surfaces
Matthias Clasen [Sat, 30 Mar 2013 05:11:46 +0000 (01:11 -0400)]
docs: Add details about surfaces

Mention some of the characteristic differences to X:
no global positions, no access to foreign windows.

11 years agodocs: Improve wl_region protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:45 +0000 (01:11 -0400)]
docs: Improve wl_region protocol docs

Just cosmetic changes, a few missing periods, and ID was
not capitalized.

11 years agodocs: Improve the wl_output protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:44 +0000 (01:11 -0400)]
docs: Improve the wl_output protocol docs

Some descriptions were missing.

11 years agodocs: Improve wl_touch protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:43 +0000 (01:11 -0400)]
docs: Improve wl_touch protocol docs

Some descriptions were missing here.

11 years agodocs: Improve wl_keyboard protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:42 +0000 (01:11 -0400)]
docs: Improve wl_keyboard protocol docs

Some descriptions were missing here.

11 years agodocs: Improve wl_pointer protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:41 +0000 (01:11 -0400)]
docs: Improve wl_pointer protocol docs

Some descriptions were missing here.

11 years agodocs: Improve the wl_seat protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:40 +0000 (01:11 -0400)]
docs: Improve the wl_seat protocol docs

Expand the main description and tell if requests don't have
an effect.

11 years agodocs: Improve wl_surface protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:39 +0000 (01:11 -0400)]
docs: Improve wl_surface protocol docs

Use NULL consistently. And add some more information in a few
places.

11 years agodocs: Improve wl_shell/wl_shell_surface docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:38 +0000 (01:11 -0400)]
docs: Improve wl_shell/wl_shell_surface docs

Add missing summaries, expand descriptions.

11 years agodocs: Improve the wl_data_* procol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:37 +0000 (01:11 -0400)]
docs: Improve the wl_data_* procol docs

Add a few missing summaries and descriptions, spell out file
descriptor, use hyphens in drag-and-drop, don't use hyphens in
'mime type', and reword a few things.

11 years agodocs: Improve wl_shm and wl_shm_pool protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:36 +0000 (01:11 -0400)]
docs: Improve wl_shm and wl_shm_pool protocol docs

Reword some paragraphs, and spell out 'file descriptor'.

11 years agodocs: Improve wl_callback protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:35 +0000 (01:11 -0400)]
docs: Improve wl_callback protocol docs

Add some information about wl_callback and its done event.

11 years agodocs: Improve the wl_registry protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:34 +0000 (01:11 -0400)]
docs: Improve the wl_registry protocol docs

Reword a few things, and add some details.

11 years agodocs: Improve wl_display protocol docs
Matthias Clasen [Sat, 30 Mar 2013 05:11:33 +0000 (01:11 -0400)]
docs: Improve wl_display protocol docs

This adds a bit of information about in-order event delivery,
removes extraneous formatting, and adds a missing period.

11 years agodocs: Consistency fixes
Matthias Clasen [Sat, 30 Mar 2013 05:11:32 +0000 (01:11 -0400)]
docs: Consistency fixes

Say 'object ID' throughout.

11 years agodoc: Improve various sections of the documentation
Matthias Clasen [Sat, 30 Mar 2013 05:11:31 +0000 (01:11 -0400)]
doc: Improve various sections of the documentation

11 years agodocs: Improve the 'Connect time' section
Matthias Clasen [Sat, 30 Mar 2013 05:11:30 +0000 (01:11 -0400)]
docs: Improve the 'Connect time' section

Turn the bullet-point list into complete sentences.

11 years agodocs: Improve the 'Types of Compositors' section
Matthias Clasen [Sat, 30 Mar 2013 05:11:29 +0000 (01:11 -0400)]
docs: Improve the 'Types of Compositors' section

Turn the bullet-point lists into full paragraphs.

11 years agodocs: Slight rewording
Matthias Clasen [Sat, 30 Mar 2013 05:11:28 +0000 (01:11 -0400)]
docs: Slight rewording

The Wayland Protocol -> Wayland Protocol Overview, to align
better with the subsequent Wayland Protocol Specification.

11 years agodocs: Reorder some sections
Matthias Clasen [Sat, 30 Mar 2013 05:11:27 +0000 (01:11 -0400)]
docs: Reorder some sections

Move the 'Types of Compositors' section right after the Overview,
and move the 'Client API' part after the protocol spec.

11 years agowayland-server: Avoid deferencing a NULL pointer in error case
Rob Bradford [Thu, 28 Mar 2013 18:48:09 +0000 (18:48 +0000)]
wayland-server: Avoid deferencing a NULL pointer in error case

Reorder the error handling in the case that closure is NULL due to ENOMEM to
ensure that we can safely call wl_closure_lookup_objects on the second test.
Prior to this reordering the closure would be deferenced in the ENOMEM case
due to the invocation of the second half of the logical OR check.

11 years agodocs: Fix the documentation build
Matthias Clasen [Thu, 28 Mar 2013 13:10:32 +0000 (09:10 -0400)]
docs: Fix the documentation build

The publican man page says that the options are actually called
--formats and --langs, and with this, the doc build succeeds.

11 years agodocs: Add a revision history
Matthias Clasen [Thu, 28 Mar 2013 13:10:31 +0000 (09:10 -0400)]
docs: Add a revision history

Publican complains if it can't find this file.

11 years agoprotocol: remove implicit attach semantics
Pekka Paalanen [Thu, 7 Mar 2013 11:10:01 +0000 (13:10 +0200)]
protocol: remove implicit attach semantics

To match the Weston commit e7144fd175d1d68b91aa0cec7ab63381b79385a9:
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Mar 4 12:11:41 2013 -0500

    compositor: Only send release event in response to wl_surface.attach

Remove the implicit attach semantics from wl_surface.commit and .attach.

Before, if you did this on a wl_surface: attach, commit, commit, you
would receive wl_buffer.release for both commits. After this change, you
will only receive wl_buffer.release for the first commit. To get a
second release, the same buffer must be attached again.

There is no need for the implicit attach on the second commit. If the
compositor needs the wl_buffer for repainting, it will not release it to
begin with. If the compositor does not need to keep the wl_buffer around
for repainting, it will not need it for a new commit either.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoAdd wl_resource_init and use it in libwayland implementations of data sharing and SHM
Jason Ekstrand [Sat, 9 Mar 2013 04:26:13 +0000 (22:26 -0600)]
Add wl_resource_init and use it in libwayland implementations of data sharing and SHM

This commit adds a wl_resource_init function for initializing wl_resource
structures similar to wl_client_add_object.

From this commit forward, wl_resource structures should not be initialized
manually, but should use wl_resource_init.  In the event of a change to the
wl_resource structure, this allows us to protect against regressions by filling
in added fields with reasonable defaults.  In this way, while changing
wl_object or wl_resource still constitutes an ABI break, compositors following
this rule will only need to be recompiled in order to properly link against the
new version.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoChange wl_closure_invoke to take an opcode instead of an actual function pointer
Jason Ekstrand [Sat, 9 Mar 2013 04:26:12 +0000 (22:26 -0600)]
Change wl_closure_invoke to take an opcode instead of an actual function pointer

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoclient: Invoke new_id closure arguments as pointers instead of integers
Jonas Ådahl [Fri, 8 Mar 2013 17:44:16 +0000 (18:44 +0100)]
client: Invoke new_id closure arguments as pointers instead of integers

This commit adds a flags parameter to wl_closure_invoke(). The so far
added flags are ment to specify if the invokation is client side or
server side. When on the server side, closure arguments of type 'new_id'
should be invoked as a integer id while on the client side they should
be invoked as a pointer to a proxy object.

This fixes a bug happening when the address of a client side 'new_id'
proxy object did not fit in a 32 bit integer.

krh: Squashed test suite compile fix from Jason Ekstrand.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoclient: Check reference count only for destroyed proxies
Jonas Ådahl [Thu, 7 Mar 2013 22:32:39 +0000 (23:32 +0100)]
client: Check reference count only for destroyed proxies

The llvm static analyzer tool reported "Use of memory after it is freed"
in dispatch_event() because the proxy is used after being freed if the
reference count reaches zero without the destroyed flag being set. This
would never happen in practice because the owner of the proxy object
always holds a reference until calling wl_proxy_destroy() which would
also set the destroyed flag.

Since this is the case, it is safe to do the reference count check only
if the destroyed flag is set, as it can never reach zero if not.

This commit doesn't change the behavior of the function, but makes the
static analyzer more happy.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=61385

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoconfigure.ac: Use wayland_version macro in bug url
Kristian Høgsberg [Sun, 17 Mar 2013 17:53:29 +0000 (13:53 -0400)]
configure.ac: Use wayland_version macro in bug url

11 years agoStylistic nitpicking
Kristian Høgsberg [Tue, 26 Feb 2013 18:40:34 +0000 (13:40 -0500)]
Stylistic nitpicking

No space between '!' and its argument,  prefer i++ over ++i.

11 years agoClean up and refactor wl_closure and associated functions
Jason Ekstrand [Tue, 26 Feb 2013 16:30:51 +0000 (11:30 -0500)]
Clean up and refactor wl_closure and associated functions

The primary purpose of this patch is to clean up wl_closure and separate
closure storage, libffi, and the wire format.  To that end, a number of changes
have been made:

 - The maximum number of closure arguments has been changed from a magic number
   to a #define WL_CLOSURE_MAX_ARGS

 - A wl_argument union has been added for storing a generalized closure
   argument and wl_closure has been converted to use wl_argument instead of the
   combination of libffi, the wire format, and a dummy extra buffer.  As of
   now, the "extra" field in wl_closure should be treated as bulk storage and
   never direclty referenced outside of wl_connection_demarshal.

 - Everything having to do with libffi has been moved into wl_closure_invoke
   and the convert_arguments_to_ffi helper function.

 - Everything having to do with the wire format has been restricted to
   wl_connection_demarshal and the new static serialize_closure function.  The
   wl_closure_send and wl_closure_queue functions are now light wrappers around
   serialize_closure.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
11 years agoclient: add wl_proxy_get_class()
Pekka Paalanen [Tue, 26 Feb 2013 13:19:44 +0000 (15:19 +0200)]
client: add wl_proxy_get_class()

This is a useful shorthand for client application debugging macros,
since you can ask the object class from the object itself.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoscanner: Fix 'destroy)' typo in check for destroy request presence
Kristian Høgsberg [Mon, 25 Feb 2013 21:01:38 +0000 (16:01 -0500)]
scanner: Fix 'destroy)' typo in check for destroy request presence

This is there to enforce that we don't have interfaces with a destroy
request that isn't a destructor.  The check never worked because of the
typo, but we also don't have any interfaces like that.

11 years agoscanner: remove list_length in favor of wl_list_length
Ran Benita [Mon, 25 Feb 2013 15:12:51 +0000 (17:12 +0200)]
scanner: remove list_length in favor of wl_list_length

11 years agoconfigure.ac: Update bug URL
Kristian Høgsberg [Thu, 14 Feb 2013 22:00:46 +0000 (17:00 -0500)]
configure.ac: Update bug URL

11 years agoMake sure that man page xml files are always disted
Armin K [Thu, 14 Feb 2013 19:44:08 +0000 (14:44 -0500)]
Make sure that man page xml files are always disted

11 years agoREADME: Fix typos
Siddharth Heroor [Thu, 14 Feb 2013 05:29:15 +0000 (10:59 +0530)]
README: Fix typos

Signed-off-by: Siddharth Heroor <heroor@gmail.com>
11 years agotests: Add a help message for the test runner
Kristian Høgsberg [Mon, 11 Feb 2013 18:58:39 +0000 (13:58 -0500)]
tests: Add a help message for the test runner

In case we forget the name of the test case or typo it, the test runner
will now list the test cases in the test binary.

11 years agoqueue-test: WEXITSTATUS() is undefined if WIFEXITED() is false
Kristian Høgsberg [Fri, 8 Feb 2013 16:38:59 +0000 (11:38 -0500)]
queue-test: WEXITSTATUS() is undefined if WIFEXITED() is false

If a child process dies from a signal, WIFEXITED() returns false and
WEXITSTATUS() isn't well-defined.  In this case, if the client segfaults,
the status is 134 and WEXITSTATUS(134) is EXIT_SUCCESS, so we mask the error.

11 years agoconnection.c: Align pointer extra storage correctly
Kristian Høgsberg [Mon, 4 Feb 2013 12:07:17 +0000 (07:07 -0500)]
connection.c: Align pointer extra storage correctly

Most extra data are just pointers, but in case of fds we store an int in
the extra space.  That can cause un-aligned access to pointers on 64 bit
architectures.  Make sure we always align pointer storage correctly.

11 years agoconfigure.ac: Lower git master version to 1.0.90
Kristian Høgsberg [Sat, 2 Feb 2013 15:44:32 +0000 (10:44 -0500)]
configure.ac: Lower git master version to 1.0.90

The idea was to use 1.1.0 for the git master version, so that git master
would always be newer than any release or 1.1.x version.  This means
we have to skip 1.1 as a release, which turns out to be confusing.

We can just use version 1.0.90 instead, which lets us call the next
release 1.1.0.

11 years agoMatch libtool version info in 1.0 branch
Kristian Høgsberg [Mon, 28 Jan 2013 20:27:27 +0000 (15:27 -0500)]
Match libtool version info in 1.0 branch

Master should always as old or older than the stable branch.  I didn't
copy over the libtool version bump when we bumped it in the 1.0 branch.

11 years agogitignore: add test-suite files
David Herrmann [Wed, 23 Jan 2013 13:20:41 +0000 (14:20 +0100)]
gitignore: add test-suite files

The *.log and *.trs files should be ignored by git as well as the GNU
autotools ./test-driver helper script.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoevent-loop: fix returning the destroy-signal listener
David Herrmann [Wed, 23 Jan 2013 13:11:19 +0000 (14:11 +0100)]
event-loop: fix returning the destroy-signal listener

We need to actually return the destroy-listener, otherwise the return
value is undefined.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoAdd a destroy signal to the wl_event_loop object
Jason Ekstrand [Sat, 12 Jan 2013 03:01:47 +0000 (21:01 -0600)]
Add a destroy signal to the wl_event_loop object

11 years agoAdded a destroy signal to the wl_display object.
Jason Ekstrand [Fri, 11 Jan 2013 20:29:32 +0000 (14:29 -0600)]
Added a destroy signal to the wl_display object.

Added a destroy signal to the wl_display object.

11 years agotest/event-loop: Check readable state on a pipe
Quentin Glidic [Sun, 6 Jan 2013 14:46:00 +0000 (15:46 +0100)]
test/event-loop: Check readable state on a pipe

When redirecting stdout to a non-readable file makes the test fail as a
false negative

11 years agoclient: remove two unused function pointer typedefs
Pekka Paalanen [Wed, 12 Dec 2012 12:19:23 +0000 (14:19 +0200)]
client: remove two unused function pointer typedefs

The need for wl_display_update_func_t was removed in

commit 53d24713a31d59d9534c1c1a84a7ad46f44ee95f
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Thu Oct 4 16:54:22 2012 -0400

    Change filedescriptor API to be thread safe

and wl_callback_func_t does not seem to have ever been used in the first place.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: rename temporary files
Pekka Paalanen [Mon, 3 Dec 2012 14:58:25 +0000 (16:58 +0200)]
tests: rename temporary files

This is libwayland, not weston, so call the temporary files
wayland-tests-*, not weston-tests-*.

This is a candidate for the stable branch.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: Don't leave temporary files behind
Sven Joachim [Sun, 2 Dec 2012 21:42:11 +0000 (22:42 +0100)]
tests: Don't leave temporary files behind

Signed-off-by: Sven Joachim <svenjoac@gmx.de>
11 years agoman, configure.ac: Only generate man pages if we can do it offline
Jonas Ådahl [Sat, 1 Dec 2012 16:33:23 +0000 (17:33 +0100)]
man, configure.ac: Only generate man pages if we can do it offline

Instead of relying on downloading the stylesheet from the Internet for
generating man pages, only generate them if the stylesheet is available
locally.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agodoc: Only generate Wayland documentation if xsltproc was found
Jonas Ådahl [Sat, 1 Dec 2012 16:33:22 +0000 (17:33 +0100)]
doc: Only generate Wayland documentation if xsltproc was found

Instead of failing to generate documentation because xsltproc doesn't
exist, don't try to generate at all.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoconfigure.ac: Update version to 1.1.0 during development on git master
Kristian Høgsberg [Fri, 30 Nov 2012 22:19:43 +0000 (17:19 -0500)]
configure.ac: Update version to 1.1.0 during development on git master

This lets dependent components, such as mesa or toolkits use git master
instead of any 1.0.x release.

11 years agoclient: Add \since tag for wl_display_dispatch_queue_pending() documentation
Kristian Høgsberg [Fri, 30 Nov 2012 19:05:32 +0000 (14:05 -0500)]
client: Add \since tag for wl_display_dispatch_queue_pending() documentation

11 years agopkgconfig: Use configure provided directories
Quentin Glidic [Tue, 27 Nov 2012 21:35:18 +0000 (22:35 +0100)]
pkgconfig: Use configure provided directories

https://bugs.freedesktop.org/show_bug.cgi?id=57630

11 years agoprotocol: Add a wl_surface request for setting buffer transformation
Ander Conselvan de Oliveira [Tue, 27 Nov 2012 15:03:41 +0000 (17:03 +0200)]
protocol: Add a wl_surface request for setting buffer transformation

This request allows a client to render its contents according to the
output transform, enabling the compositor to use optimizations such as
overlays, hardware cursors, scan out of a client buffer for
fullscreen surface, etc, even if the output is rotated.

11 years agoscanner: Fix wrong restriction on since field
Ander Conselvan de Oliveira [Tue, 27 Nov 2012 15:03:40 +0000 (17:03 +0200)]
scanner: Fix wrong restriction on since field

The scanner would not allow two consecutive requests on an interface to
have the same since number, so if a new version of an interface added
two new request the version number would have to be increased by two.

11 years agoclient: Don't cancel a roundtrip when any event is received
Jonas Ådahl [Mon, 26 Nov 2012 22:25:53 +0000 (23:25 +0100)]
client: Don't cancel a roundtrip when any event is received

Since wl_display_dispatch() returns the number of processed events or -1
on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when
wl_display_roundtrip() does an early return and the callback later
writes to the then out of scope stack allocated `done' parameter.

Introduced by 33b7637b4500a682018b503837b8aca9afae36f2.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agodoc: Fix typos
Tiago Vignatti [Thu, 22 Nov 2012 20:09:32 +0000 (18:09 -0200)]
doc: Fix typos

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoclient: Add an entry point for dispatching a queue without blocking
Ander Conselvan de Oliveira [Thu, 22 Nov 2012 13:34:48 +0000 (15:34 +0200)]
client: Add an entry point for dispatching a queue without blocking

On the client side EGL, all the wl_buffer.release events need to be
processed before buffer allocation, otherwise a third buffer might
be allocated unnecessarily. However, the buffer allocation should
not block in the case no event was received. In order to do that, a
non-blocking queue dispatch function is needed.