summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-01-19scanner: allow summary attributes in args and <description> in <protocol>Jesse Barnes1-31/+45
Add support for arg summaries for use by detailed structure element descriptions.
2012-01-18scanner: Support documentation elementsJesse Barnes1-1/+130
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-13Fix 'make dist' as connection.h no longer existsRichard Hughes1-1/+0
2012-01-12server: In default grab, update focus resource after sending releaseNeil Roberts1-5/+5
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-11shm: Drop non-premul format, use less ambiguous ARGB8888 naming conventionKristian Høgsberg1-6/+5
This also matches the new wl_drm format names.
2012-01-06Move data device implementation into wayland-serverKristian Høgsberg4-0/+511
2012-01-06Move default grab implementation to wayland-serverKristian Høgsberg1-0/+56
2012-01-06New grab APIKristian Høgsberg2-54/+24
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-04server: Allocate server ID for when resource->object.id is 0Kristian Høgsberg1-1/+8
2012-01-03server: remove wl_display::callback_list as unusedPekka Paalanen1-2/+0
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-03server: add wl_input_device_release()Pekka Paalanen2-0/+18
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()
2011-12-28Fix WL_EVENT_WRITEABLE typoKristian Høgsberg3-6/+6
2011-12-27Drop unused hash tableKristian Høgsberg4-319/+3
We now just use a table for looking up object IDs so we should drop the hash table.
2011-12-22Rename all instances of typeofKristian Høgsberg1-1/+1
2011-12-22Use __typeof__ instead of typeofKristian Høgsberg1-2/+2
Thiago Macieira compiles with -std=c++11.
2011-12-22server: destroy the socket event source on display destroyPekka Paalanen1-4/+7
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-17connection: Fix printf format warningsKristian Høgsberg1-2/+2
2011-12-17Increase closure buffer size and fail gracefully for too big closures.Laszlo Agocs3-6/+38
Buffer size changed from 256 to 1024 bytes. Marshalling will now stop if the buffer is not big enough.
2011-12-14Removed superfluous call to wl_copy_connectionAndy Nichols1-2/+0
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-14Make wl_list_for_each* work for c++Jørgen Lind1-1/+7
2011-12-13client: fix a strdup memory leakPekka Paalanen1-3/+10
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-05client: unset WAYLAND_SOCKET env variablePekka Paalanen1-0/+1
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-11-29server: do not send delete_id to a dead clientPekka Paalanen1-3/+5
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-29server: document wl_resource_post_event() argumentsPekka Paalanen1-0/+17
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-29util: clear pointers on wl_list_remove()Pekka Paalanen1-0/+2
Set the next and prev pointers of the removed list element to NULL. This will catch programming errors that would use invalid list pointers, double-remove for instance. It also helps debugging, making it easy to see in gdb if an object is not in a list. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-29server: no errors to a dead clientPekka Paalanen1-0/+19
Do not try to send errors to an already dead client, while in the middle of cleanup. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-23New drag and drop / selection protocolKristian Høgsberg4-46/+23
This commit brings a big change to the DND and copy/paste interfaces. Most importantly the functionality is now independent of wl_shell. The wl_shell interface is intended for desktop style UI interaction and an optional and experimental interface. The new interface also allows receiving the DND data multiple times or multiple times during the drag, and the mechanism for offering and receiving data is now shared between DND and selections.
2011-11-23server: Stop special casing the compositorKristian Høgsberg2-39/+2
wl_compositor_init() was just adding the global and providing a helper bind function. Not useful enough to warrent API.
2011-11-22Add support for server allocated object IDsKristian Høgsberg5-30/+108
We set aside a range of the object ID space for use by the server. This allows the server to bind an object to an ID for a client and pass that object to the client. The client can use the object immediately and the server can emit events to the object immdiately.
2011-11-22debug: Use unsigned for object IDsKristian Høgsberg1-1/+1
2011-11-18scanner: Only strdup interface_name after making sure it's not NULLKristian Høgsberg1-2/+1
2011-11-18Move private definitions and prototypes to new wayland-private.hKristian Høgsberg7-21/+25
2011-11-18Fix unused variable warningKristian Høgsberg1-4/+2
2011-11-17Introduce wl_resource_queue_event() for sending events laterKristian Høgsberg5-8/+56
Some events, such as the display.delete_id, aren't very urgent and we would like to not always send them immdiately and cause an unnecessary context switch. The wl_resource_queue_event() function will place the event in the connection output buffer but not request the main loop to poll for writable. The effect is that the event will just sit in the output buffer until a more important event comes around and requires flushing.
2011-11-17Add display event to acknowledge ID deletionKristian Høgsberg4-3/+30
We need to make sure the client doesn't reuse an object ID until the server has seen the destroy request. When a client destroys an ID the server will now respond with the display.delete_id event, which lets the client block reuse until it receives the event.
2011-11-15util: Add wl_list_insert_list()Kristian Høgsberg2-0/+10
2011-11-15hash: Improve double hashingAndrea Canciani1-6/+2
Instead of artificially introducing collisions in the step value by replacing 0 with 1 (which causes the value 1 to have twice the frequency of any other value), the step value can simply be computed as an uniformly distributed value in the range [1, rehash], extremes included. This is safe because any step value smaller than the hash modulus is co-prime with it, hence induces an orbit which includes every integer in [0, size - 1].
2011-10-31scanner: Check name == NULL for enum entriesKristian Høgsberg1-0/+3
From a clang static analysis warning.
2011-10-31connection: Check object types in message parametersBenjamin Franzke1-0/+10
2011-10-29event-loop: Fix idle handler dispatch corner caseKristian Høgsberg1-2/+4
When the last idle handler queues another idle handler, we fail to dispatch that last handler. The wl_list_for_each_safe loop looks up the next pointer before running the handler, and at that point it points to the head of the list and the loop terminates. Instead, just loop until the list is empty.
2011-10-24scanner: Fix typo in error messageKristian Høgsberg1-1/+1
2011-10-24scanner: Catch more invalid attribute combinations for argKristian Høgsberg1-4/+12
Spotted by Jakob Bornecrantz.
2011-10-20debug: Print debug message when client wakes upKristian Høgsberg1-0/+5
This helps spot and remove extraneous round trips and context switches.
2011-10-12Silence a valgrind warningKristian Høgsberg1-1/+0
2011-10-11wayland-server: Track input_device resource for focused surfaceKristian Høgsberg1-4/+4
We no long track the focused surface, but expect the compositor to set focus when the focus changes. We do track the resource for the input device that corresponds to the current surface, in case that goes away.
2011-10-11wayland-server: Always use the display_resource for posting wl_display errorsKristian Høgsberg1-2/+2
2011-10-11wayland-server: fix resource destroyMathias Fiedler1-1/+1
Object ID was read from freed memory.
2011-10-11wayland-server: fix crash on invalid resourceMathias Fiedler1-1/+1
Using display_resource to post error about invalid resource. Reviewed-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-10-11scanner: Fix indent for *_add_listenerBenjamin Franzke1-1/+1
2011-09-06Rename motion_grab to implicit_grabKristian Høgsberg2-2/+2
Let's just use the same terms as X.