"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/wayland-client.c" between
wayland-1.17.0.tar.xz and wayland-1.18.0.tar.xz

About: Wayland is a computer display server protocol for a compositor to talk to its clients and a library for Linux implementing that protocol.

wayland-client.c  (wayland-1.17.0.tar.xz):wayland-client.c  (wayland-1.18.0.tar.xz)
skipping to change at line 72 skipping to change at line 72
struct wl_proxy { struct wl_proxy {
struct wl_object object; struct wl_object object;
struct wl_display *display; struct wl_display *display;
struct wl_event_queue *queue; struct wl_event_queue *queue;
uint32_t flags; uint32_t flags;
int refcount; int refcount;
void *user_data; void *user_data;
wl_dispatcher_func_t dispatcher; wl_dispatcher_func_t dispatcher;
uint32_t version; uint32_t version;
const char * const *tag;
}; };
struct wl_event_queue { struct wl_event_queue {
struct wl_list event_list; struct wl_list event_list;
struct wl_display *display; struct wl_display *display;
}; };
struct wl_display { struct wl_display {
struct wl_proxy proxy; struct wl_proxy proxy;
struct wl_connection *connection; struct wl_connection *connection;
skipping to change at line 301 skipping to change at line 302
wl_proxy_unref(closure->proxy); wl_proxy_unref(closure->proxy);
wl_closure_destroy(closure); wl_closure_destroy(closure);
} }
static void static void
wl_event_queue_release(struct wl_event_queue *queue) wl_event_queue_release(struct wl_event_queue *queue)
{ {
struct wl_closure *closure; struct wl_closure *closure;
while (!wl_list_empty(&queue->event_list)) { while (!wl_list_empty(&queue->event_list)) {
closure = container_of(queue->event_list.next, closure = wl_container_of(queue->event_list.next,
struct wl_closure, link); closure, link);
wl_list_remove(&closure->link); wl_list_remove(&closure->link);
destroy_queued_closure(closure); destroy_queued_closure(closure);
} }
} }
/** Destroy an event queue /** Destroy an event queue
* *
* \param queue The event queue to be destroyed * \param queue The event queue to be destroyed
* *
* Destroy the given event queue. Any pending event on that queue is * Destroy the given event queue. Any pending event on that queue is
skipping to change at line 741 skipping to change at line 742
message = &proxy->object.interface->methods[opcode]; message = &proxy->object.interface->methods[opcode];
if (interface) { if (interface) {
new_proxy = create_outgoing_proxy(proxy, message, new_proxy = create_outgoing_proxy(proxy, message,
args, interface, args, interface,
version); version);
if (new_proxy == NULL) if (new_proxy == NULL)
goto err_unlock; goto err_unlock;
} }
if (proxy->display->last_error) {
goto err_unlock;
}
closure = wl_closure_marshal(&proxy->object, opcode, args, message); closure = wl_closure_marshal(&proxy->object, opcode, args, message);
if (closure == NULL) if (closure == NULL) {
wl_abort("Error marshalling request: %s\n", strerror(errno)); wl_log("Error marshalling request: %s\n", strerror(errno));
display_fatal_error(proxy->display, errno);
goto err_unlock;
}
if (debug_client) if (debug_client)
wl_closure_print(closure, &proxy->object, true); wl_closure_print(closure, &proxy->object, true);
if (wl_closure_send(closure, proxy->display->connection)) if (wl_closure_send(closure, proxy->display->connection)) {
wl_abort("Error sending request: %s\n", strerror(errno)); wl_log("Error sending request: %s\n", strerror(errno));
display_fatal_error(proxy->display, errno);
}
wl_closure_destroy(closure); wl_closure_destroy(closure);
err_unlock: err_unlock:
pthread_mutex_unlock(&proxy->display->mutex); pthread_mutex_unlock(&proxy->display->mutex);
return new_proxy; return new_proxy;
} }
/** Prepare a request to be sent to the compositor /** Prepare a request to be sent to the compositor
skipping to change at line 1363 skipping to change at line 1373
struct wl_zombie *zombie = wl_map_lookup(&display->objects, id); struct wl_zombie *zombie = wl_map_lookup(&display->objects, id);
if (zombie && zombie->fd_count[opcode]) if (zombie && zombie->fd_count[opcode])
wl_connection_close_fds_in(display->connection, wl_connection_close_fds_in(display->connection,
zombie->fd_count[opcode]); zombie->fd_count[opcode]);
wl_connection_consume(display->connection, size); wl_connection_consume(display->connection, size);
return size; return size;
} }
if (opcode >= proxy->object.interface->event_count) {
wl_log("interface '%s' has no event %u\n",
proxy->object.interface->name, opcode);
return -1;
}
message = &proxy->object.interface->events[opcode]; message = &proxy->object.interface->events[opcode];
closure = wl_connection_demarshal(display->connection, size, closure = wl_connection_demarshal(display->connection, size,
&display->objects, message); &display->objects, message);
if (!closure) if (!closure)
return -1; return -1;
if (create_proxies(proxy, closure) < 0) { if (create_proxies(proxy, closure) < 0) {
wl_closure_destroy(closure); wl_closure_destroy(closure);
return -1; return -1;
} }
skipping to change at line 1400 skipping to change at line 1416
} }
static void static void
dispatch_event(struct wl_display *display, struct wl_event_queue *queue) dispatch_event(struct wl_display *display, struct wl_event_queue *queue)
{ {
struct wl_closure *closure; struct wl_closure *closure;
struct wl_proxy *proxy; struct wl_proxy *proxy;
int opcode; int opcode;
bool proxy_destroyed; bool proxy_destroyed;
closure = container_of(queue->event_list.next, closure = wl_container_of(queue->event_list.next, closure, link);
struct wl_closure, link);
wl_list_remove(&closure->link); wl_list_remove(&closure->link);
opcode = closure->opcode; opcode = closure->opcode;
/* Verify that the receiving object is still valid by checking if has /* Verify that the receiving object is still valid by checking if has
* been destroyed by the application. */ * been destroyed by the application. */
validate_closure_objects(closure); validate_closure_objects(closure);
proxy = closure->proxy; proxy = closure->proxy;
proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED); proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED);
if (proxy_destroyed) { if (proxy_destroyed) {
destroy_queued_closure(closure); destroy_queued_closure(closure);
skipping to change at line 2059 skipping to change at line 2074
* \return The id the object associated with the proxy * \return The id the object associated with the proxy
* *
* \memberof wl_proxy * \memberof wl_proxy
*/ */
WL_EXPORT uint32_t WL_EXPORT uint32_t
wl_proxy_get_id(struct wl_proxy *proxy) wl_proxy_get_id(struct wl_proxy *proxy)
{ {
return proxy->object.id; return proxy->object.id;
} }
/** Set the tag of a proxy object
*
* A toolkit or application can set a unique tag on a proxy in order to
* identify whether an object is managed by itself or some external part.
*
* To create a tag, the recommended way is to define a statically allocated
* constant char array containing some descriptive string. The tag will be the
* pointer to the non-const pointer to the beginning of the array.
*
* For example, to define and set a tag on a surface managed by a certain
* subsystem:
*
* static const char *my_tag = "my tag";
*
* wl_proxy_set_tag((struct wl_proxy *) surface, &my_tag);
*
* Then, in a callback with wl_surface as an argument, in order to check
* whether it's a surface managed by the same subsystem.
*
* const char * const *tag;
*
* tag = wl_proxy_get_tag((struct wl_proxy *) surface);
* if (tag != &my_tag)
* return;
*
* ...
*
* For debugging purposes, a tag should be suitable to be included in a debug
* log entry, e.g.
*
* const char * const *tag;
*
* tag = wl_proxy_get_tag((struct wl_proxy *) surface);
* printf("Got a surface with the tag %p (%s)\n",
* tag, (tag && *tag) ? *tag : "");
*
* \param proxy The proxy object
* \param tag The tag
*
* \memberof wl_proxy
* \since 1.17.90
*/
WL_EXPORT void
wl_proxy_set_tag(struct wl_proxy *proxy,
const char * const *tag)
{
proxy->tag = tag;
}
/** Get the tag of a proxy object
*
* See wl_proxy_set_tag for details.
*
* \param proxy The proxy object
*
* \memberof wl_proxy
* \since 1.17.90
*/
WL_EXPORT const char * const *
wl_proxy_get_tag(struct wl_proxy *proxy)
{
return proxy->tag;
}
/** Get the interface name (class) of a proxy object /** Get the interface name (class) of a proxy object
* *
* \param proxy The proxy object * \param proxy The proxy object
* \return The interface name of the object associated with the proxy * \return The interface name of the object associated with the proxy
* *
* \memberof wl_proxy * \memberof wl_proxy
*/ */
WL_EXPORT const char * WL_EXPORT const char *
wl_proxy_get_class(struct wl_proxy *proxy) wl_proxy_get_class(struct wl_proxy *proxy)
{ {
 End of changes. 8 change blocks. 
8 lines changed or deleted 87 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)