Lines Matching +full:introspection +full:- +full:subsystem
2 * Copyright © 2008-2012 Kristian Høgsberg
3 * Copyright © 2010-2012 Intel Corporation
45 #include "wayland-util.h"
46 #include "wayland-os.h"
47 #include "wayland-client.h"
48 #include "wayland-private.h"
145 const char *signature = closure->message->signature; in adjust_closure_args_for_logging()
151 for (i = 0; i < closure->count; i++) { in adjust_closure_args_for_logging()
156 proxy = (struct wl_proxy *)closure->args[i].o; in adjust_closure_args_for_logging()
157 closure->args[i].n = proxy ? proxy->object.id : 0; in adjust_closure_args_for_logging()
201 struct wl_display *display = proxy->display; in closure_log()
205 if (!debug_client && wl_list_empty(&display->observers)) in closure_log()
219 wl_closure_print(&adjusted_closure, &proxy->object, send, in closure_log()
222 if (!wl_list_empty(&display->observers)) { in closure_log()
236 wl_list_for_each(observer, &display->observers, link) { in closure_log()
237 observer->func(observer->user_data, type, &message); in closure_log()
263 if (!debug_client && wl_list_empty(&display->observers)) in log_unknown_message()
274 unknown_proxy.refcount = -1; in log_unknown_message()
291 * waiting for display->reader_cond (i. e. when reading is done,
294 * NOTE: must be called with display->mutex locked
304 ++display->read_serial; in display_wakeup_threads()
306 pthread_cond_broadcast(&display->reader_cond); in display_wakeup_threads()
320 if (display->last_error) in display_fatal_error()
326 display->last_error = error; in display_fatal_error()
349 if (display->last_error) in display_protocol_error()
372 pthread_mutex_lock(&display->mutex); in display_protocol_error()
374 display->last_error = err; in display_protocol_error()
376 display->protocol_error.code = code; in display_protocol_error()
377 display->protocol_error.id = id; in display_protocol_error()
378 display->protocol_error.interface = intf; in display_protocol_error()
390 pthread_mutex_unlock(&display->mutex); in display_protocol_error()
396 wl_list_init(&queue->event_list); in wl_event_queue_init()
397 wl_list_init(&queue->proxy_list); in wl_event_queue_init()
398 queue->display = display; in wl_event_queue_init()
404 assert(proxy->refcount > 0); in wl_proxy_unref()
405 if (--proxy->refcount > 0) in wl_proxy_unref()
410 assert(proxy->flags & WL_PROXY_FLAG_DESTROYED); in wl_proxy_unref()
422 signature = closure->message->signature; in validate_closure_objects()
429 proxy = (struct wl_proxy *) closure->args[i].o; in validate_closure_objects()
430 if (proxy && proxy->flags & WL_PROXY_FLAG_DESTROYED) in validate_closure_objects()
431 closure->args[i].o = NULL; in validate_closure_objects()
450 signature = closure->message->signature; in destroy_queued_closure()
457 proxy = (struct wl_proxy *) closure->args[i].o; in destroy_queued_closure()
466 wl_proxy_unref(closure->proxy); in destroy_queued_closure()
475 if (!wl_list_empty(&queue->proxy_list)) { in wl_event_queue_release()
478 if (queue != &queue->display->default_queue) { in wl_event_queue_release()
483 wl_list_for_each_safe(proxy, tmp, &queue->proxy_list, in wl_event_queue_release()
485 if (queue != &queue->display->default_queue) { in wl_event_queue_release()
487 proxy->object.interface->name, in wl_event_queue_release()
488 proxy->object.id); in wl_event_queue_release()
490 proxy->queue = NULL; in wl_event_queue_release()
491 wl_list_remove(&proxy->queue_link); in wl_event_queue_release()
492 wl_list_init(&proxy->queue_link); in wl_event_queue_release()
496 while (!wl_list_empty(&queue->event_list)) { in wl_event_queue_release()
497 closure = wl_container_of(queue->event_list.next, in wl_event_queue_release()
499 wl_list_remove(&closure->link); in wl_event_queue_release()
520 struct wl_display *display = queue->display; in wl_event_queue_destroy()
522 pthread_mutex_lock(&display->mutex); in wl_event_queue_destroy()
525 pthread_mutex_unlock(&display->mutex); in wl_event_queue_destroy()
569 const struct wl_interface *interface = proxy->object.interface; in prepare_zombie()
578 for (i = 0; i < interface->event_count; i++) { in prepare_zombie()
579 message = &interface->events[i]; in prepare_zombie()
580 count = message_count_fds(message->signature); in prepare_zombie()
587 (interface->event_count * sizeof(int))); in prepare_zombie()
591 zombie->event_count = interface->event_count; in prepare_zombie()
592 zombie->fd_count = (int *) &zombie[1]; in prepare_zombie()
595 zombie->fd_count[i] = count; in prepare_zombie()
615 struct wl_display *display = factory->display; in proxy_create()
621 proxy->object.interface = interface; in proxy_create()
622 proxy->display = display; in proxy_create()
623 proxy->queue = factory->queue; in proxy_create()
624 proxy->refcount = 1; in proxy_create()
625 proxy->version = version; in proxy_create()
627 proxy->object.id = wl_map_insert_new(&display->objects, 0, proxy); in proxy_create()
628 if (proxy->object.id == 0) { in proxy_create()
633 wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); in proxy_create()
651 * \note This should not normally be used by non-generated code.
660 struct wl_display *display = factory->display; in wl_proxy_create()
663 pthread_mutex_lock(&display->mutex); in wl_proxy_create()
664 proxy = proxy_create(factory, interface, factory->version); in wl_proxy_create()
665 pthread_mutex_unlock(&display->mutex); in wl_proxy_create()
676 struct wl_display *display = factory->display; in wl_proxy_create_for_id()
682 proxy->object.interface = interface; in wl_proxy_create_for_id()
683 proxy->object.id = id; in wl_proxy_create_for_id()
684 proxy->display = display; in wl_proxy_create_for_id()
685 proxy->queue = factory->queue; in wl_proxy_create_for_id()
686 proxy->refcount = 1; in wl_proxy_create_for_id()
687 proxy->version = factory->version; in wl_proxy_create_for_id()
689 if (wl_map_insert_at(&display->objects, 0, id, proxy) == -1) { in wl_proxy_create_for_id()
694 wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); in wl_proxy_create_for_id()
702 if (proxy->flags & WL_PROXY_FLAG_ID_DELETED) { in proxy_destroy()
703 wl_map_remove(&proxy->display->objects, proxy->object.id); in proxy_destroy()
704 } else if (proxy->object.id < WL_SERVER_ID_START) { in proxy_destroy()
709 wl_map_insert_at(&proxy->display->objects, in proxy_destroy()
711 proxy->object.id, in proxy_destroy()
714 wl_map_insert_at(&proxy->display->objects, 0, in proxy_destroy()
715 proxy->object.id, NULL); in proxy_destroy()
718 proxy->flags |= WL_PROXY_FLAG_DESTROYED; in proxy_destroy()
720 proxy->queue = NULL; in proxy_destroy()
721 wl_list_remove(&proxy->queue_link); in proxy_destroy()
722 wl_list_init(&proxy->queue_link); in proxy_destroy()
730 if (proxy->flags & WL_PROXY_FLAG_WRAPPER) in wl_proxy_destroy_caller_locks()
752 struct wl_display *display = proxy->display; in wl_proxy_destroy()
754 pthread_mutex_lock(&display->mutex); in wl_proxy_destroy()
758 pthread_mutex_unlock(&display->mutex); in wl_proxy_destroy()
766 * \return 0 on success or -1 on failure
784 if (proxy->flags & WL_PROXY_FLAG_WRAPPER) in wl_proxy_add_listener()
787 if (proxy->object.implementation || proxy->dispatcher) { in wl_proxy_add_listener()
789 return -1; in wl_proxy_add_listener()
792 proxy->object.implementation = implementation; in wl_proxy_add_listener()
793 proxy->user_data = data; in wl_proxy_add_listener()
814 return proxy->object.implementation; in wl_proxy_get_listener()
821 * \param implementation The dispatcher-specific listener implementation
823 * \return 0 on success or -1 on failure
826 * dispatcher_data as its dispatcher-specific implementation and its user data
842 if (proxy->flags & WL_PROXY_FLAG_WRAPPER) in wl_proxy_add_dispatcher()
845 if (proxy->object.implementation || proxy->dispatcher) { in wl_proxy_add_dispatcher()
847 return -1; in wl_proxy_add_dispatcher()
850 proxy->object.implementation = implementation; in wl_proxy_add_dispatcher()
851 proxy->dispatcher = dispatcher; in wl_proxy_add_dispatcher()
852 proxy->user_data = data; in wl_proxy_add_dispatcher()
867 signature = message->signature; in create_outgoing_proxy()
878 args[i].o = &new_proxy->object; in create_outgoing_proxy()
897 * For new-id arguments, this function will allocate a new wl_proxy
903 * non-generated code.
916 proxy->version); in wl_proxy_marshal_array_constructor()
932 * For new-id arguments, this function will allocate a new wl_proxy
938 * non-generated code.
967 * For new-id arguments, this function will allocate a new wl_proxy
977 * \note This should not normally be used by non-generated code.
990 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal_flags()
1010 * For new-id arguments, this function will allocate a new wl_proxy
1021 * non-generated code.
1035 struct wl_display *disp = proxy->display; in wl_proxy_marshal_array_flags()
1037 pthread_mutex_lock(&disp->mutex); in wl_proxy_marshal_array_flags()
1039 message = &proxy->object.interface->methods[opcode]; in wl_proxy_marshal_array_flags()
1048 if (proxy->display->last_error) { in wl_proxy_marshal_array_flags()
1052 closure = wl_closure_marshal(&proxy->object, opcode, args, message); in wl_proxy_marshal_array_flags()
1055 display_fatal_error(proxy->display, errno); in wl_proxy_marshal_array_flags()
1061 if (wl_closure_send(closure, proxy->display->connection)) { in wl_proxy_marshal_array_flags()
1063 display_fatal_error(proxy->display, errno); in wl_proxy_marshal_array_flags()
1072 pthread_mutex_unlock(&disp->mutex); in wl_proxy_marshal_array_flags()
1085 * it doesn't create proxies for new-id arguments.
1087 * \note This should not normally be used by non-generated code.
1100 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal()
1120 * For new-id arguments, this function will allocate a new wl_proxy
1125 * \note This should not normally be used by non-generated code.
1137 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal_constructor()
1158 * For new-id arguments, this function will allocate a new wl_proxy
1163 * \note This should not normally be used by non-generated code.
1176 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal_constructor_versioned()
1192 * it doesn't create proxies for new-id arguments.
1195 * non-generated code.
1219 proxy->object.interface->name, in display_handle_error()
1220 proxy->object.id, in display_handle_error()
1223 object_id = proxy->object.id; in display_handle_error()
1224 interface = proxy->object.interface; in display_handle_error()
1241 pthread_mutex_lock(&display->mutex); in display_handle_delete_id()
1243 proxy = wl_map_lookup(&display->objects, id); in display_handle_delete_id()
1245 if (wl_object_is_zombie(&display->objects, id)) { in display_handle_delete_id()
1247 * event-information structure, which we can free. */ in display_handle_delete_id()
1249 wl_map_remove(&display->objects, id); in display_handle_delete_id()
1251 proxy->flags |= WL_PROXY_FLAG_ID_DELETED; in display_handle_delete_id()
1256 pthread_mutex_unlock(&display->mutex); in display_handle_delete_id()
1276 name = "wayland-0"; in connect_to_socket()
1286 return -1; in connect_to_socket()
1291 return -1; in connect_to_socket()
1319 return -1; in connect_to_socket()
1326 return -1; in connect_to_socket()
1359 display->fd = fd; in wl_display_connect_to_fd()
1360 wl_map_init(&display->objects, WL_MAP_CLIENT_SIDE); in wl_display_connect_to_fd()
1361 wl_event_queue_init(&display->default_queue, display); in wl_display_connect_to_fd()
1362 wl_event_queue_init(&display->display_queue, display); in wl_display_connect_to_fd()
1363 pthread_mutex_init(&display->mutex, NULL); in wl_display_connect_to_fd()
1364 pthread_cond_init(&display->reader_cond, NULL); in wl_display_connect_to_fd()
1365 display->reader_count = 0; in wl_display_connect_to_fd()
1366 wl_list_init(&display->observers); in wl_display_connect_to_fd()
1368 if (wl_map_insert_at(&display->objects, 0, 0, NULL) == -1) in wl_display_connect_to_fd()
1371 display->proxy.object.id = in wl_display_connect_to_fd()
1372 wl_map_insert_new(&display->objects, 0, display); in wl_display_connect_to_fd()
1374 if (display->proxy.object.id == 0) in wl_display_connect_to_fd()
1377 display->proxy.object.interface = &wl_display_interface; in wl_display_connect_to_fd()
1378 display->proxy.display = display; in wl_display_connect_to_fd()
1379 display->proxy.object.implementation = (void(**)(void)) &display_listener; in wl_display_connect_to_fd()
1380 display->proxy.user_data = display; in wl_display_connect_to_fd()
1381 display->proxy.queue = &display->default_queue; in wl_display_connect_to_fd()
1382 display->proxy.flags = 0; in wl_display_connect_to_fd()
1383 display->proxy.refcount = 1; in wl_display_connect_to_fd()
1402 display->proxy.version = 0; in wl_display_connect_to_fd()
1404 display->connection = wl_connection_create(display->fd); in wl_display_connect_to_fd()
1405 if (display->connection == NULL) in wl_display_connect_to_fd()
1411 pthread_mutex_destroy(&display->mutex); in wl_display_connect_to_fd()
1412 pthread_cond_destroy(&display->reader_cond); in wl_display_connect_to_fd()
1413 wl_map_release(&display->objects); in wl_display_connect_to_fd()
1414 close(display->fd); in wl_display_connect_to_fd()
1427 * variable if it is set, otherwise display "wayland-0" will be used.
1431 * as-is and \c name is ignored.
1436 * If \c name is an absolute path, then that path is used as-is for
1441 * is set to an absolute pathname, then that pathname is used as-is
1464 if (flags == -1 && errno == EBADF) in wl_display_connect()
1466 else if (flags != -1) in wl_display_connect()
1491 wl_connection_destroy(display->connection); in wl_display_disconnect()
1492 wl_map_for_each(&display->objects, free_zombies, NULL); in wl_display_disconnect()
1493 wl_map_release(&display->objects); in wl_display_disconnect()
1494 wl_event_queue_release(&display->default_queue); in wl_display_disconnect()
1495 wl_event_queue_release(&display->display_queue); in wl_display_disconnect()
1496 wl_list_remove(&display->observers); in wl_display_disconnect()
1497 pthread_mutex_destroy(&display->mutex); in wl_display_disconnect()
1498 pthread_cond_destroy(&display->reader_cond); in wl_display_disconnect()
1499 close(display->fd); in wl_display_disconnect()
1517 return display->fd; in wl_display_get_fd()
1537 * \return The number of dispatched events on success or -1 on failure
1564 return -1; in wl_display_roundtrip_queue()
1571 return -1; in wl_display_roundtrip_queue()
1577 if (ret == -1 && !done) in wl_display_roundtrip_queue()
1586 * \return The number of dispatched events on success or -1 on failure
1604 return wl_display_roundtrip_queue(display, &display->default_queue); in wl_display_roundtrip()
1617 signature = closure->message->signature; in create_proxies()
1623 id = closure->args[i].n; in create_proxies()
1625 closure->args[i].o = NULL; in create_proxies()
1629 closure->message->types[i]); in create_proxies()
1631 return -1; in create_proxies()
1632 closure->args[i].o = (struct wl_object *)proxy; in create_proxies()
1650 signature = closure->message->signature; in increase_closure_args_refcount()
1657 proxy = (struct wl_proxy *) closure->args[i].o; in increase_closure_args_refcount()
1659 proxy->refcount++; in increase_closure_args_refcount()
1666 closure->proxy->refcount++; in increase_closure_args_refcount()
1680 wl_connection_copy(display->connection, p, sizeof p); in queue_event()
1689 proxy = wl_map_lookup(&display->objects, id); in queue_event()
1690 if (!proxy || wl_object_is_zombie(&display->objects, id)) { in queue_event()
1691 struct wl_zombie *zombie = wl_map_lookup(&display->objects, id); in queue_event()
1692 num_zombie_fds = (zombie && opcode < zombie->event_count) ? in queue_event()
1693 zombie->fd_count[opcode] : 0; in queue_event()
1699 wl_connection_close_fds_in(display->connection, in queue_event()
1702 wl_connection_consume(display->connection, size); in queue_event()
1706 if (opcode >= proxy->object.interface->event_count) { in queue_event()
1708 proxy->object.interface->name, opcode); in queue_event()
1709 return -1; in queue_event()
1712 message = &proxy->object.interface->events[opcode]; in queue_event()
1713 closure = wl_connection_demarshal(display->connection, size, in queue_event()
1714 &display->objects, message); in queue_event()
1716 return -1; in queue_event()
1720 return -1; in queue_event()
1723 if (wl_closure_lookup_objects(closure, &display->objects) != 0) { in queue_event()
1725 return -1; in queue_event()
1728 closure->proxy = proxy; in queue_event()
1731 if (proxy == &display->proxy) in queue_event()
1732 queue = &display->display_queue; in queue_event()
1734 queue = proxy->queue; in queue_event()
1739 wl_list_insert(queue->event_list.prev, &closure->link); in queue_event()
1752 closure = wl_container_of(queue->event_list.next, closure, link); in dispatch_event()
1753 wl_list_remove(&closure->link); in dispatch_event()
1754 opcode = closure->opcode; in dispatch_event()
1759 proxy = closure->proxy; in dispatch_event()
1760 proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED); in dispatch_event()
1764 } else if (proxy->dispatcher) { in dispatch_event()
1768 pthread_mutex_unlock(&display->mutex); in dispatch_event()
1769 wl_closure_dispatch(closure, proxy->dispatcher, in dispatch_event()
1770 &proxy->object, opcode); in dispatch_event()
1771 pthread_mutex_lock(&display->mutex); in dispatch_event()
1772 } else if (proxy->object.implementation) { in dispatch_event()
1776 pthread_mutex_unlock(&display->mutex); in dispatch_event()
1778 &proxy->object, opcode, proxy->user_data); in dispatch_event()
1779 pthread_mutex_lock(&display->mutex); in dispatch_event()
1794 display->reader_count--; in read_events()
1795 if (display->reader_count == 0) { in read_events()
1796 total = wl_connection_read(display->connection); in read_events()
1797 if (total == -1) { in read_events()
1807 return -1; in read_events()
1814 return -1; in read_events()
1817 for (rem = total; rem >= 8; rem -= size) { in read_events()
1819 if (size == -1) { in read_events()
1821 return -1; in read_events()
1829 serial = display->read_serial; in read_events()
1830 while (display->read_serial == serial) in read_events()
1831 pthread_cond_wait(&display->reader_cond, in read_events()
1832 &display->mutex); in read_events()
1834 if (display->last_error) { in read_events()
1835 errno = display->last_error; in read_events()
1836 return -1; in read_events()
1846 display->reader_count--; in cancel_read()
1847 if (display->reader_count == 0) in cancel_read()
1854 * \return 0 on success or -1 on error. In case of error errno will
1891 pthread_mutex_lock(&display->mutex); in wl_display_read_events()
1893 if (display->last_error) { in wl_display_read_events()
1895 pthread_mutex_unlock(&display->mutex); in wl_display_read_events()
1897 errno = display->last_error; in wl_display_read_events()
1898 return -1; in wl_display_read_events()
1903 pthread_mutex_unlock(&display->mutex); in wl_display_read_events()
1913 if (display->last_error) in dispatch_queue()
1917 while (!wl_list_empty(&display->display_queue.event_list)) { in dispatch_queue()
1918 dispatch_event(display, &display->display_queue); in dispatch_queue()
1919 if (display->last_error) in dispatch_queue()
1924 while (!wl_list_empty(&queue->event_list)) { in dispatch_queue()
1926 if (display->last_error) in dispatch_queue()
1934 errno = display->last_error; in dispatch_queue()
1936 return -1; in dispatch_queue()
1943 * \return 0 on success or -1 if event queue was not empty
1950 * This only succeeds if the event queue is empty, and if not -1 is returned and
1958 * toolkit event loop in a race-free way. A correct usage would be (with most
1966 * ret = poll(fds, nfds, -1);
1999 pthread_mutex_lock(&display->mutex); in wl_display_prepare_read_queue()
2001 if (!wl_list_empty(&queue->event_list)) { in wl_display_prepare_read_queue()
2003 ret = -1; in wl_display_prepare_read_queue()
2005 display->reader_count++; in wl_display_prepare_read_queue()
2009 pthread_mutex_unlock(&display->mutex); in wl_display_prepare_read_queue()
2017 * \return 0 on success or -1 if event queue was not empty
2028 return wl_display_prepare_read_queue(display, &display->default_queue); in wl_display_prepare_read()
2046 pthread_mutex_lock(&display->mutex); in wl_display_cancel_read()
2050 pthread_mutex_unlock(&display->mutex); in wl_display_cancel_read()
2059 pfd[0].fd = display->fd; in wl_display_poll()
2062 ret = poll(pfd, 1, -1); in wl_display_poll()
2063 } while (ret == -1 && errno == EINTR); in wl_display_poll()
2072 * \return The number of dispatched events on success or -1 on failure
2079 * dispatched. On failure -1 is returned and errno set appropriately.
2099 * That means that this function can return non-0 value even when it
2113 if (wl_display_prepare_read_queue(display, queue) == -1) in wl_display_dispatch_queue()
2119 if (ret != -1 || errno != EAGAIN) in wl_display_dispatch_queue()
2122 if (wl_display_poll(display, POLLOUT) == -1) { in wl_display_dispatch_queue()
2124 return -1; in wl_display_dispatch_queue()
2132 return -1; in wl_display_dispatch_queue()
2135 if (wl_display_poll(display, POLLIN) == -1) { in wl_display_dispatch_queue()
2137 return -1; in wl_display_dispatch_queue()
2140 if (wl_display_read_events(display) == -1) in wl_display_dispatch_queue()
2141 return -1; in wl_display_dispatch_queue()
2150 * \return The number of dispatched events on success or -1 on failure
2153 * event queue. On failure -1 is returned and errno set appropriately.
2165 pthread_mutex_lock(&display->mutex); in wl_display_dispatch_queue_pending()
2169 pthread_mutex_unlock(&display->mutex); in wl_display_dispatch_queue_pending()
2177 * \return The number of dispatched events on success or -1 on failure
2184 * are dispatched. On failure -1 is returned and errno set appropriately.
2210 return wl_display_dispatch_queue(display, &display->default_queue); in wl_display_dispatch()
2216 * \return The number of dispatched events or -1 on failure
2231 &display->default_queue); in wl_display_dispatch_pending()
2242 * \note Errors are \b fatal. If this function returns non-zero the display
2252 pthread_mutex_lock(&display->mutex); in wl_display_get_error()
2254 ret = display->last_error; in wl_display_get_error()
2256 pthread_mutex_unlock(&display->mutex); in wl_display_get_error()
2291 pthread_mutex_lock(&display->mutex); in wl_display_get_protocol_error()
2293 ret = display->protocol_error.code; in wl_display_get_protocol_error()
2296 *interface = display->protocol_error.interface; in wl_display_get_protocol_error()
2298 *id = display->protocol_error.id; in wl_display_get_protocol_error()
2300 pthread_mutex_unlock(&display->mutex); in wl_display_get_protocol_error()
2309 * \return The number of bytes sent on success or -1 on failure
2314 * failure, this function returns -1 and errno is set appropriately.
2318 * to EAGAIN and -1 returned. In that case, use poll on the display
2328 pthread_mutex_lock(&display->mutex); in wl_display_flush()
2330 if (display->last_error) { in wl_display_flush()
2331 errno = display->last_error; in wl_display_flush()
2332 ret = -1; in wl_display_flush()
2338 ret = wl_connection_flush(display->connection); in wl_display_flush()
2343 pthread_mutex_unlock(&display->mutex); in wl_display_flush()
2361 proxy->user_data = user_data; in wl_proxy_set_user_data()
2374 return proxy->user_data; in wl_proxy_get_user_data()
2396 return proxy->version; in wl_proxy_get_version()
2409 return proxy->object.id; in wl_proxy_get_id()
2419 * pointer to the non-const pointer to the beginning of the array.
2422 * subsystem:
2429 * whether it's a surface managed by the same subsystem.
2458 proxy->tag = tag; in wl_proxy_set_tag()
2473 return proxy->tag; in wl_proxy_get_tag()
2486 return proxy->object.interface->name; in wl_proxy_get_class()
2502 * This is particularly important for multi-threaded setups, where it is
2520 pthread_mutex_lock(&proxy->display->mutex); in wl_proxy_set_queue()
2522 wl_list_remove(&proxy->queue_link); in wl_proxy_set_queue()
2525 assert(proxy->display == queue->display); in wl_proxy_set_queue()
2526 proxy->queue = queue; in wl_proxy_set_queue()
2528 proxy->queue = &proxy->display->default_queue; in wl_proxy_set_queue()
2531 wl_list_insert(&proxy->queue->proxy_list, &proxy->queue_link); in wl_proxy_set_queue()
2533 pthread_mutex_unlock(&proxy->display->mutex); in wl_proxy_set_queue()
2536 /** Create a proxy wrapper for making queue assignments thread-safe
2594 pthread_mutex_lock(&wrapped_proxy->display->mutex); in wl_proxy_create_wrapper()
2596 wrapper->object.interface = wrapped_proxy->object.interface; in wl_proxy_create_wrapper()
2597 wrapper->object.id = wrapped_proxy->object.id; in wl_proxy_create_wrapper()
2598 wrapper->version = wrapped_proxy->version; in wl_proxy_create_wrapper()
2599 wrapper->display = wrapped_proxy->display; in wl_proxy_create_wrapper()
2600 wrapper->queue = wrapped_proxy->queue; in wl_proxy_create_wrapper()
2601 wrapper->flags = WL_PROXY_FLAG_WRAPPER; in wl_proxy_create_wrapper()
2602 wrapper->refcount = 1; in wl_proxy_create_wrapper()
2604 wl_list_insert(&wrapper->queue->proxy_list, &wrapper->queue_link); in wl_proxy_create_wrapper()
2606 pthread_mutex_unlock(&wrapped_proxy->display->mutex); in wl_proxy_create_wrapper()
2621 if (!(wrapper->flags & WL_PROXY_FLAG_WRAPPER)) in wl_proxy_wrapper_destroy()
2622 wl_abort("Tried to destroy non-wrapper proxy with " in wl_proxy_wrapper_destroy()
2625 assert(wrapper->refcount == 1); in wl_proxy_wrapper_destroy()
2627 pthread_mutex_lock(&wrapper->display->mutex); in wl_proxy_wrapper_destroy()
2629 wl_list_remove(&wrapper->queue_link); in wl_proxy_wrapper_destroy()
2631 pthread_mutex_unlock(&wrapper->display->mutex); in wl_proxy_wrapper_destroy()
2644 * array, and that need to do further introspection on the ".o" field, as it
2691 observer->display = display; in wl_display_create_client_observer()
2692 observer->func = func; in wl_display_create_client_observer()
2693 observer->user_data = user_data; in wl_display_create_client_observer()
2695 pthread_mutex_lock(&display->mutex); in wl_display_create_client_observer()
2697 wl_list_insert(&display->observers, &observer->link); in wl_display_create_client_observer()
2699 pthread_mutex_unlock(&display->mutex); in wl_display_create_client_observer()
2716 pthread_mutex_lock(&observer->display->mutex); in wl_client_observer_destroy()
2718 wl_list_remove(&observer->link); in wl_client_observer_destroy()
2720 pthread_mutex_unlock(&observer->display->mutex); in wl_client_observer_destroy()