Commit graph

836 commits

Author SHA1 Message Date
Kristian Høgsberg
a8d5236189 Add patch chunks missing from previous commmit
For some reason the changes to wayland-client.h and wayland-client.pc
didn't get committed with the other versioning changes.
2012-04-14 13:21:41 -04:00
Neil Roberts
f0afa0fd8b Add a public header for the version number
This adds a public header so that applications can get the Wayland
version number at compile time. This can be used to make applications
that support compiling against multiple versions of Wayland.

There is a separate installed header called cogl-version.h which gets
included by both wayland-client.h and wayland-server.h

The canonical place for the version number is the configure.ac script
which splits it into three separate m4 defines for the major, minor
and micro version. These are copied into the generated
wayland-version.h header using AC_SUBST. There is also a string form
of the complete version number.

The version number is now also automatically copied into the two .pc
files.

Because the major, minor and micro parts are required it is no longer
possible to leave the version number as 'master' when building from
git. Most projects seem to immediately bump the git repo to a fake
version number (usually odd) after making a release so that there is
always a relative number that can be used for comparison. This patch
sets the git version to 0.99.0 under the assumption that the next
release will be 1.0.0.
2012-04-12 18:08:19 -04:00
Neil Roberts
17a2d4adeb Add wl_display_disconnect to the client header
Commit fdbbc38a added a wl_display_disconnect function to the 0.85
branch so that Mesa can continue to build against both that branch and
master. However it was missing a declaration in the header so Mesa
would still fail to build when -Werror is enabled.
2012-04-12 17:50:06 -04:00
Kristian Høgsberg
fdbbc38a6d client: Add wl_display_disconnect() so mesa master can link against 0.85 2012-04-05 16:48:38 -04:00
Pekka Paalanen
80cf9cb44d connection: fix signedness warnings
Fix two of
warning: comparison between signed and unsigned integer expressions

If the pointer difference somehow ended up negative, these comparisons
would break as the difference was implicitly casted to unsigned.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-23 15:20:03 +02:00
Pekka Paalanen
3b7cdcb5c6 Fix harmless signedness warnings
Trivially silence all the harmless (i.e. would have been correct also
without this fix) compiler warnings:
warning: comparison between signed and unsigned integer expressions

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-23 15:20:03 +02:00
Pekka Paalanen
cc4750b7df scanner: fix a signedness warning
Trivial fix to a
warning: comparison between signed and unsigned integer expressions

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-23 15:20:03 +02:00
Peter Hutterer
a4b36d70eb scanner: Remove unused variable 'len'
scanner.c: In function ‘desc_dump’:
scanner.c:142:42: warning: unused variable ‘len’ [-Wunused-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-23 15:20:03 +02:00
Pekka Paalanen
58d6d3afcc shm: fix cosmetic gcc warnings
Fix warning: 'static' is not at beginning of declaration

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-23 15:20:03 +02:00
Pekka Paalanen
0c249064a5 server: fix signedness in wl_client_connection_data
The variables opcode and size were unsigned, which lead to warnings
about comparisons of signed vs. unsigned.

Change these variable to signed. Their usage never relies on being
unsigned.

This also fixes (an assumed) printf format string problem, where these
were printed with %d, not %u.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-23 13:49:30 +02:00
Pekka Paalanen
11b141cb18 configure: add -Wextra -Wno-unused-parameter
This adds more gcc warnings that should be useful, and suppresses the
unused parameter warnings that are not wanted.

Most importantly, this change enables warnings about comparison between
signed and unsigned.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-23 13:49:07 +02:00
Kristian Høgsberg
28e3cbc654 Release 0.85.0 2012-02-09 13:15:35 -05:00
Kristian Høgsberg
7c6dac8740 Use dist-xz for tarballs 2012-02-09 11:15:33 -05:00
Kristian Høgsberg
c6b37ac055 Set version to 'master' on git master branch 2012-02-09 11:12:18 -05:00
Tiago Vignatti
8f9de83f7b scanner: don't print new line when no descriptions are provided
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-02-09 10:06:18 -05:00
Tiago Vignatti
899652201f protocol: fix typo
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-02-09 09:42:18 -05:00
Tiago Vignatti
3cce6be20d spec: fix typo
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-02-09 09:42:13 -05:00
Kristian Høgsberg
0bcb30a9a0 Drop warning when we receive an event for zombie objects
Business as usual, but the message is confusing.
2012-02-09 08:28:52 -05:00
Kristian Høgsberg
fa525622e3 wayland-util.h: Avoid un-namespaced _container_of
Yes, there are worse offenders in that file, but this one isn't used in
the code and it makes Xorg angry.
2012-02-09 08:28:51 -05:00
Jesse Barnes
10eefa4947 spec: list core interfaces with short descriptions
Plus fix up misc. grammar.
2012-01-19 17:40:30 -05:00
Jesse Barnes
fb84662f61 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.
2012-01-19 17:40:28 -05:00
Jesse Barnes
f66aa1d08f scanner: allow summary attributes in args and <description> in <protocol>
Add support for arg summaries for use by detailed structure element
descriptions.
2012-01-19 17:16:39 -05:00
Kristian Høgsberg
032b957698 protocol: Convert comments to new documentation tags 2012-01-18 19:17:23 -05:00
Jesse Barnes
5cd0471311 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);
};
2012-01-18 18:22:25 -05:00
Richard Hughes
4b5871e2b8 Fix 'make dist' as connection.h no longer exists 2012-01-13 12:58:52 -05:00
Neil Roberts
e0b6af03ca 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.
2012-01-12 10:59:07 -05:00
Kristian Høgsberg
151ca457b4 shm: Drop non-premul format, use less ambiguous ARGB8888 naming convention
This also matches the new wl_drm format names.
2012-01-11 14:19:54 -05:00
Kristian Høgsberg
b2e619c740 Add new wl_shell popup surface type 2012-01-06 11:40:02 -05:00
Kristian Høgsberg
b6b3d07c83 Move data device implementation into wayland-server 2012-01-06 11:40:02 -05:00
Kristian Høgsberg
dbb3ba7269 Move default grab implementation to wayland-server 2012-01-06 11:40:02 -05:00
Kristian Høgsberg
5ffe9f4708 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.
2012-01-06 11:30:08 -05:00
Kristian Høgsberg
44b529f2e4 server: Allocate server ID for when resource->object.id is 0 2012-01-04 09:13:27 -05:00
Pekka Paalanen
c7473897fc server: remove wl_display::callback_list as unused
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03 11:23:17 -05:00
Pekka Paalanen
2755847fce 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()
2012-01-03 11:22:58 -05:00
Kristian Høgsberg
d6465c5b40 Fix WL_EVENT_WRITEABLE typo 2011-12-28 22:51:34 -05:00
Kristian Høgsberg
c1b9203e5a Drop unused hash table
We now just use a table for looking up object IDs so we should drop the
hash table.
2011-12-27 13:58:56 -05:00
Kristian Høgsberg
bc79f1f820 Rename all instances of typeof 2011-12-22 15:32:37 -05:00
Kristian Høgsberg
5e078bfa5a Use __typeof__ instead of typeof
Thiago Macieira compiles with -std=c++11.
2011-12-22 15:24:20 -05:00
Pekka Paalanen
aad1e19058 server: destroy the socket event source on display destroy
On wl_display_add_socket(), the listening socket fd is added to the
event loop. However, wl_event_source object is not stored and hence
cannot be freed, resulting in a minor leak.

Store wl_event_source pointer in struct wl_socket so we can track it,
and destroy it on wl_display_destroy(). The event loop itself must be
destroyed after destroying the event sources linked to it.

Fixes a Valgrind reported memory leak.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 10:40:39 -05:00
Tiago Vignatti
1f58d155da protocol: update touch_down with focus surface
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-21 13:57:27 -05:00
Kristian Høgsberg
e68529b52f protocol: Add a bit of documentation 2011-12-19 13:15:06 -05:00
Kristian Høgsberg
1b31149f92 connection: Fix printf format warnings 2011-12-17 16:05:44 -05:00
Laszlo Agocs
34901868b8 Increase closure buffer size and fail gracefully for too big closures.
Buffer size changed from 256 to 1024 bytes. Marshalling will now stop
if the buffer is not big enough.
2011-12-17 16:02:05 -05:00
Andy Nichols
f598691831 Removed superfluous call to wl_copy_connection
The only purpose those code seems to serve is to introduce a buffer
overflow when events contain more than 128 bytes of data.
2011-12-14 12:44:12 -05:00
Jørgen Lind
187eace613 Make wl_list_for_each* work for c++ 2011-12-14 09:16:20 -05:00
Pekka Paalanen
e631ab6cde client: fix a strdup memory leak
Memory leak found by valgrinding simple-shm client.
struct wl_global::interface is a strdup()'d string that was never freed.

Make a function for freeing a wl_global, and use it.

krh: Edit to name wl_global destructor wl_global_destroy.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-13 10:01:37 -05:00
Pekka Paalanen
58bb064afa client: unset WAYLAND_SOCKET env variable
WAYLAND_SOCKET contains a file descriptor that is an open connection to
a Wayland server. It is private to us, and makes no sense to relay the
same value (or any value) to our child processes.

Unset the environment variable to prevent it from being accidentally
relayed to other processes.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-05 09:52:09 -05:00
Pekka Paalanen
cf89b40c4c server: do not send delete_id to a dead client
During client tear-down, all objects are destroyed in id order.
Therefore the display object is destroyed first.

If the destroy listeners of any object destroy another object by calling
wl_resoruce_destroy(), we try to send a delete_id event to the client.
This leads to a segmentation fault without a display object.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-29 14:46:49 +02:00
Pekka Paalanen
42eed3235a protocol: introduce wl_shell_surface
Requests like 'move' and 'set_toplevel' are really methods of a surface,
not methods of a global shell object. Move all these methods to a new
interface, wl_shell_surface.

The global object wl_shell will contain only 'get_shell_surface'
request, which creates and associates a wl_shell_surface object to a
given wl_surface object.

This will also give the shell plugin (if you look at the demo
compositor) means to store per-surface private data in a natural way.

Due to a limitation in delete_id event handling on client side, the
client must destroy its wl_shell_surface object before destroying the
wl_surface object. Otherwise it may just leak an id.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-29 14:46:49 +02:00
Pekka Paalanen
e04c137e86 server: document wl_resource_post_event() arguments
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-29 14:46:49 +02:00