Lines Matching full:resource

136 log_closure(struct wl_resource *resource,  in log_closure()  argument
139 struct wl_object *object = &resource->object; in log_closure()
140 struct wl_display *display = resource->client->display; in log_closure()
148 message.resource = resource; in log_closure()
164 wl_resource_post_event_array(struct wl_resource *resource, uint32_t opcode, in wl_resource_post_event_array() argument
168 struct wl_object *object = &resource->object; in wl_resource_post_event_array()
174 resource->client->error = 1; in wl_resource_post_event_array()
178 if (wl_closure_send(closure, resource->client->connection)) in wl_resource_post_event_array()
179 resource->client->error = 1; in wl_resource_post_event_array()
181 log_closure(resource, closure, true); in wl_resource_post_event_array()
187 wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...) in wl_resource_post_event() argument
190 struct wl_object *object = &resource->object; in wl_resource_post_event()
198 wl_resource_post_event_array(resource, opcode, args); in wl_resource_post_event()
203 wl_resource_queue_event_array(struct wl_resource *resource, uint32_t opcode, in wl_resource_queue_event_array() argument
207 struct wl_object *object = &resource->object; in wl_resource_queue_event_array()
213 resource->client->error = 1; in wl_resource_queue_event_array()
217 if (wl_closure_queue(closure, resource->client->connection)) in wl_resource_queue_event_array()
218 resource->client->error = 1; in wl_resource_queue_event_array()
220 log_closure(resource, closure, true); in wl_resource_queue_event_array()
226 wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...) in wl_resource_queue_event() argument
229 struct wl_object *object = &resource->object; in wl_resource_queue_event()
237 wl_resource_queue_event_array(resource, opcode, args); in wl_resource_queue_event()
241 wl_resource_post_error(struct wl_resource *resource, in wl_resource_post_error() argument
244 struct wl_client *client = resource->client; in wl_resource_post_error()
256 * which means the display resource is destroyed first. If destruction in wl_resource_post_error()
265 WL_DISPLAY_ERROR, resource, code, buffer); in wl_resource_post_error()
273 struct wl_resource *resource; in wl_client_connection_data() local
314 resource = wl_map_lookup(&client->objects, p[0]); in wl_client_connection_data()
316 if (resource == NULL) { in wl_client_connection_data()
323 object = &resource->object; in wl_client_connection_data()
337 resource->version > 0 && resource->version < since) { in wl_client_connection_data()
342 opcode, resource->version, since, in wl_client_connection_data()
353 wl_resource_post_no_memory(resource); in wl_client_connection_data()
367 log_closure(resource, closure, false); in wl_client_connection_data()
370 resource->dispatcher == NULL) { in wl_client_connection_data()
374 wl_closure_dispatch(closure, resource->dispatcher, in wl_client_connection_data()
594 wl_resource_post_no_memory(struct wl_resource *resource) in wl_resource_post_no_memory() argument
596 wl_resource_post_error(resource->client->display_resource, in wl_resource_post_no_memory()
603 struct wl_resource *resource = element; in destroy_resource() local
604 struct wl_client *client = resource->client; in destroy_resource()
607 wl_signal_emit(&resource->destroy_signal, resource); in destroy_resource()
609 flags = wl_map_lookup_flags(&client->objects, resource->object.id); in destroy_resource()
610 if (resource->destroy) in destroy_resource()
611 resource->destroy(resource); in destroy_resource()
614 free(resource); in destroy_resource()
620 wl_resource_destroy(struct wl_resource *resource) in wl_resource_destroy() argument
622 struct wl_client *client = resource->client; in wl_resource_destroy()
625 id = resource->object.id; in wl_resource_destroy()
626 destroy_resource(resource, NULL); in wl_resource_destroy()
640 wl_resource_get_id(struct wl_resource *resource) in wl_resource_get_id() argument
642 return resource->object.id; in wl_resource_get_id()
646 wl_resource_get_link(struct wl_resource *resource) in wl_resource_get_link() argument
648 return &resource->link; in wl_resource_get_link()
654 struct wl_resource *resource; in wl_resource_from_link() local
656 return wl_container_of(link, resource, link); in wl_resource_from_link()
662 struct wl_resource *resource; in wl_resource_find_for_client() local
667 wl_list_for_each(resource, list, link) { in wl_resource_find_for_client()
668 if (resource->client == client) in wl_resource_find_for_client()
669 return resource; in wl_resource_find_for_client()
676 wl_resource_get_client(struct wl_resource *resource) in wl_resource_get_client() argument
678 return resource->client; in wl_resource_get_client()
682 wl_resource_set_user_data(struct wl_resource *resource, void *data) in wl_resource_set_user_data() argument
684 resource->data = data; in wl_resource_set_user_data()
688 wl_resource_get_user_data(struct wl_resource *resource) in wl_resource_get_user_data() argument
690 return resource->data; in wl_resource_get_user_data()
694 wl_resource_get_version(struct wl_resource *resource) in wl_resource_get_version() argument
696 return resource->version; in wl_resource_get_version()
700 wl_resource_set_destructor(struct wl_resource *resource, in wl_resource_set_destructor() argument
703 resource->destroy = destroy; in wl_resource_set_destructor()
707 wl_resource_instance_of(struct wl_resource *resource, in wl_resource_instance_of() argument
711 return wl_interface_equal(resource->object.interface, interface) && in wl_resource_instance_of()
712 resource->object.implementation == implementation; in wl_resource_instance_of()
716 wl_resource_add_destroy_listener(struct wl_resource *resource, in wl_resource_add_destroy_listener() argument
719 wl_signal_add(&resource->destroy_signal, listener); in wl_resource_add_destroy_listener()
723 wl_resource_get_destroy_listener(struct wl_resource *resource, in wl_resource_get_destroy_listener() argument
726 return wl_signal_get(&resource->destroy_signal, notify); in wl_resource_get_destroy_listener()
729 /** Retrieve the interface name (class) of a resource object.
731 * \param resource The resource object
736 wl_resource_get_class(struct wl_resource *resource) in wl_resource_get_class() argument
738 return resource->object.interface->name; in wl_resource_get_class()
774 struct wl_resource *resource, uint32_t name, in registry_bind() argument
778 struct wl_display *display = resource->data; in registry_bind()
785 wl_resource_post_error(resource, in registry_bind()
789 wl_resource_post_error(resource, in registry_bind()
794 wl_resource_post_error(resource, in registry_bind()
808 struct wl_resource *resource, uint32_t id) in display_sync() argument
825 unbind_resource(struct wl_resource *resource) in unbind_resource() argument
827 wl_list_remove(&resource->link); in unbind_resource()
832 struct wl_resource *resource, uint32_t id) in display_get_registry() argument
834 struct wl_display *display = resource->data; in display_get_registry()
866 destroy_client_display_resource(struct wl_resource *resource) in destroy_client_display_resource() argument
868 resource->client->display_resource = NULL; in destroy_client_display_resource()
878 * resource to which it could post the event */ in bind_display()
1008 struct wl_resource *resource; in wl_global_create() local
1036 wl_list_for_each(resource, &display->registry_resource_list, link) in wl_global_create()
1037 wl_resource_post_event(resource, in wl_global_create()
1050 struct wl_resource *resource; in wl_global_destroy() local
1052 wl_list_for_each(resource, &display->registry_resource_list, link) in wl_global_destroy()
1053 wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE, in wl_global_destroy()
1441 wl_resource_set_implementation(struct wl_resource *resource, in wl_resource_set_implementation() argument
1445 resource->object.implementation = implementation; in wl_resource_set_implementation()
1446 resource->data = data; in wl_resource_set_implementation()
1447 resource->destroy = destroy; in wl_resource_set_implementation()
1448 resource->dispatcher = NULL; in wl_resource_set_implementation()
1452 wl_resource_set_dispatcher(struct wl_resource *resource, in wl_resource_set_dispatcher() argument
1457 resource->dispatcher = dispatcher; in wl_resource_set_dispatcher()
1458 resource->object.implementation = implementation; in wl_resource_set_dispatcher()
1459 resource->data = data; in wl_resource_set_dispatcher()
1460 resource->destroy = destroy; in wl_resource_set_dispatcher()
1463 /** Create a new resource object
1465 * \param client The client owner of the new resource.
1466 * \param interface The interface of the new resource.
1467 * \param version The version of the new resource.
1468 * \param id The id of the new resource. If 0, an available id will be used.
1480 struct wl_resource *resource; in wl_resource_create() local
1482 resource = malloc(sizeof *resource); in wl_resource_create()
1483 if (resource == NULL) in wl_resource_create()
1489 resource->object.id = id; in wl_resource_create()
1490 resource->object.interface = interface; in wl_resource_create()
1491 resource->object.implementation = NULL; in wl_resource_create()
1493 wl_signal_init(&resource->destroy_signal); in wl_resource_create()
1495 resource->destroy = NULL; in wl_resource_create()
1496 resource->client = client; in wl_resource_create()
1497 resource->data = NULL; in wl_resource_create()
1498 resource->version = version; in wl_resource_create()
1499 resource->dispatcher = NULL; in wl_resource_create()
1501 if (wl_map_insert_at(&client->objects, 0, id, resource) < 0) { in wl_resource_create()
1505 free(resource); in wl_resource_create()
1509 wl_signal_emit(&client->resource_created_signal, resource); in wl_resource_create()
1510 return resource; in wl_resource_create()
1683 /** Add a listener for the client's resource creation signal
1688 * When a new resource is created for this client the listener
1689 * will be notified, carrying the new resource as the data argument.
1709 struct wl_resource *resource = res; in resource_iterator_helper() local
1711 return context->it(resource, context->user_data); in resource_iterator_helper()
1721 * resource owned by the client. The \a user_data will be passed
1750 struct wl_resource *resource) WL_DEPRECATED;
1754 struct wl_resource *resource) in wl_client_add_resource() argument
1756 if (resource->object.id == 0) { in wl_client_add_resource()
1757 resource->object.id = in wl_client_add_resource()
1759 WL_MAP_ENTRY_LEGACY, resource); in wl_client_add_resource()
1761 resource->object.id, resource) < 0) { in wl_client_add_resource()
1765 resource->object.id); in wl_client_add_resource()
1769 resource->client = client; in wl_client_add_resource()
1770 wl_signal_init(&resource->destroy_signal); in wl_client_add_resource()
1772 return resource->object.id; in wl_client_add_resource()
1786 struct wl_resource *resource; in wl_client_add_object() local
1788 resource = wl_resource_create(client, interface, -1, id); in wl_client_add_object()
1789 if (resource == NULL) in wl_client_add_object()
1792 wl_resource_set_implementation(resource, in wl_client_add_object()
1795 return resource; in wl_client_add_object()
1808 struct wl_resource *resource; in wl_client_new_object() local
1810 resource = wl_resource_create(client, interface, -1, 0); in wl_client_new_object()
1811 if (resource == NULL) in wl_client_new_object()
1814 wl_resource_set_implementation(resource, in wl_client_new_object()
1817 return resource; in wl_client_new_object()