Lines Matching refs:resource
145 log_closure(struct wl_resource *resource, in log_closure() argument
148 struct wl_object *object = &resource->object; in log_closure()
149 struct wl_display *display = resource->client->display; in log_closure()
157 message.resource = resource; in log_closure()
173 verify_objects(struct wl_resource *resource, uint32_t opcode, in verify_objects() argument
176 struct wl_object *object = &resource->object; in verify_objects()
189 if (res && res->client != resource->client) { in verify_objects()
203 handle_array(struct wl_resource *resource, uint32_t opcode, in handle_array() argument
208 struct wl_object *object = &resource->object; in handle_array()
210 if (resource->client->error) in handle_array()
213 if (!verify_objects(resource, opcode, args)) { in handle_array()
214 resource->client->error = 1; in handle_array()
222 resource->client->error = 1; in handle_array()
226 log_closure(resource, closure, true); in handle_array()
228 if (send_func(closure, resource->client->connection)) in handle_array()
229 resource->client->error = 1; in handle_array()
235 wl_resource_post_event_array(struct wl_resource *resource, uint32_t opcode, in wl_resource_post_event_array() argument
238 handle_array(resource, opcode, args, wl_closure_send); in wl_resource_post_event_array()
242 wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...) in wl_resource_post_event() argument
245 struct wl_object *object = &resource->object; in wl_resource_post_event()
253 wl_resource_post_event_array(resource, opcode, args); in wl_resource_post_event()
258 wl_resource_queue_event_array(struct wl_resource *resource, uint32_t opcode, in wl_resource_queue_event_array() argument
261 handle_array(resource, opcode, args, wl_closure_queue); in wl_resource_queue_event_array()
265 wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...) in wl_resource_queue_event() argument
268 struct wl_object *object = &resource->object; in wl_resource_queue_event()
276 wl_resource_queue_event_array(resource, opcode, args); in wl_resource_queue_event()
280 wl_resource_post_error_vargs(struct wl_resource *resource, in wl_resource_post_error_vargs() argument
283 struct wl_client *client = resource->client; in wl_resource_post_error_vargs()
299 WL_DISPLAY_ERROR, resource, code, buffer); in wl_resource_post_error_vargs()
305 wl_resource_post_error(struct wl_resource *resource, in wl_resource_post_error() argument
311 wl_resource_post_error_vargs(resource, code, msg, ap); in wl_resource_post_error()
327 struct wl_resource *resource; in wl_client_connection_data() local
375 resource = wl_map_lookup(&client->objects, p[0]); in wl_client_connection_data()
377 if (resource == NULL) { in wl_client_connection_data()
384 object = &resource->object; in wl_client_connection_data()
398 resource->version > 0 && resource->version < since) { in wl_client_connection_data()
403 opcode, resource->version, since, in wl_client_connection_data()
414 wl_resource_post_no_memory(resource); in wl_client_connection_data()
428 log_closure(resource, closure, false); in wl_client_connection_data()
431 resource->dispatcher == NULL) { in wl_client_connection_data()
435 wl_closure_dispatch(closure, resource->dispatcher, in wl_client_connection_data()
681 wl_resource_post_no_memory(struct wl_resource *resource) in wl_resource_post_no_memory() argument
683 wl_resource_post_error(resource->client->display_resource, in wl_resource_post_no_memory()
700 resource_is_deprecated(struct wl_resource *resource) in resource_is_deprecated() argument
702 struct wl_map *map = &resource->client->objects; in resource_is_deprecated()
703 int id = resource->object.id; in resource_is_deprecated()
715 struct wl_resource *resource = element; in destroy_resource() local
717 wl_signal_emit(&resource->deprecated_destroy_signal, resource); in destroy_resource()
720 if (!resource_is_deprecated(resource)) in destroy_resource()
721 wl_priv_signal_final_emit(&resource->destroy_signal, resource); in destroy_resource()
723 if (resource->destroy) in destroy_resource()
724 resource->destroy(resource); in destroy_resource()
727 free(resource); in destroy_resource()
733 wl_resource_destroy(struct wl_resource *resource) in wl_resource_destroy() argument
735 struct wl_client *client = resource->client; in wl_resource_destroy()
739 id = resource->object.id; in wl_resource_destroy()
741 destroy_resource(resource, NULL, flags); in wl_resource_destroy()
755 wl_resource_get_id(struct wl_resource *resource) in wl_resource_get_id() argument
757 return resource->object.id; in wl_resource_get_id()
761 wl_resource_get_link(struct wl_resource *resource) in wl_resource_get_link() argument
763 return &resource->link; in wl_resource_get_link()
769 struct wl_resource *resource; in wl_resource_from_link() local
771 return wl_container_of(link, resource, link); in wl_resource_from_link()
777 struct wl_resource *resource; in wl_resource_find_for_client() local
782 wl_list_for_each(resource, list, link) { in wl_resource_find_for_client()
783 if (resource->client == client) in wl_resource_find_for_client()
784 return resource; in wl_resource_find_for_client()
791 wl_resource_get_client(struct wl_resource *resource) in wl_resource_get_client() argument
793 return resource->client; in wl_resource_get_client()
797 wl_resource_set_user_data(struct wl_resource *resource, void *data) in wl_resource_set_user_data() argument
799 resource->data = data; in wl_resource_set_user_data()
803 wl_resource_get_user_data(struct wl_resource *resource) in wl_resource_get_user_data() argument
805 return resource->data; in wl_resource_get_user_data()
809 wl_resource_get_version(struct wl_resource *resource) in wl_resource_get_version() argument
811 return resource->version; in wl_resource_get_version()
815 wl_resource_set_destructor(struct wl_resource *resource, in wl_resource_set_destructor() argument
818 resource->destroy = destroy; in wl_resource_set_destructor()
822 wl_resource_instance_of(struct wl_resource *resource, in wl_resource_instance_of() argument
826 return wl_interface_equal(resource->object.interface, interface) && in wl_resource_instance_of()
827 resource->object.implementation == implementation; in wl_resource_instance_of()
831 wl_resource_add_destroy_listener(struct wl_resource *resource, in wl_resource_add_destroy_listener() argument
834 if (resource_is_deprecated(resource)) in wl_resource_add_destroy_listener()
835 wl_signal_add(&resource->deprecated_destroy_signal, listener); in wl_resource_add_destroy_listener()
837 wl_priv_signal_add(&resource->destroy_signal, listener); in wl_resource_add_destroy_listener()
841 wl_resource_get_destroy_listener(struct wl_resource *resource, in wl_resource_get_destroy_listener() argument
844 if (resource_is_deprecated(resource)) in wl_resource_get_destroy_listener()
845 return wl_signal_get(&resource->deprecated_destroy_signal, notify); in wl_resource_get_destroy_listener()
846 return wl_priv_signal_get(&resource->destroy_signal, notify); in wl_resource_get_destroy_listener()
856 wl_resource_get_class(struct wl_resource *resource) in wl_resource_get_class() argument
858 return resource->object.interface->name; in wl_resource_get_class()
877 struct wl_resource *resource; in wl_resource_from_object() local
880 return wl_container_of(object, resource, object); in wl_resource_from_object()
931 struct wl_resource *resource, uint32_t name, in registry_bind() argument
935 struct wl_display *display = resource->data; in registry_bind()
942 wl_resource_post_error(resource, in registry_bind()
946 wl_resource_post_error(resource, in registry_bind()
952 wl_resource_post_error(resource, in registry_bind()
957 wl_resource_post_error(resource, in registry_bind()
962 wl_resource_post_error(resource, in registry_bind()
975 struct wl_resource *resource, uint32_t id) in display_sync() argument
992 unbind_resource(struct wl_resource *resource) in unbind_resource() argument
994 wl_list_remove(&resource->link); in unbind_resource()
999 struct wl_resource *resource, uint32_t id) in display_get_registry() argument
1001 struct wl_display *display = resource->data; in display_get_registry()
1034 destroy_client_display_resource(struct wl_resource *resource) in destroy_client_display_resource() argument
1036 resource->client->display_resource = NULL; in destroy_client_display_resource()
1210 struct wl_resource *resource; in wl_global_create() local
1239 wl_list_for_each(resource, &display->registry_resource_list, link) in wl_global_create()
1240 wl_resource_post_event(resource, in wl_global_create()
1274 struct wl_resource *resource; in wl_global_remove() local
1281 wl_list_for_each(resource, &display->registry_resource_list, link) in wl_global_remove()
1282 wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE, in wl_global_remove()
1749 wl_resource_set_implementation(struct wl_resource *resource, in wl_resource_set_implementation() argument
1753 resource->object.implementation = implementation; in wl_resource_set_implementation()
1754 resource->data = data; in wl_resource_set_implementation()
1755 resource->destroy = destroy; in wl_resource_set_implementation()
1756 resource->dispatcher = NULL; in wl_resource_set_implementation()
1760 wl_resource_set_dispatcher(struct wl_resource *resource, in wl_resource_set_dispatcher() argument
1765 resource->dispatcher = dispatcher; in wl_resource_set_dispatcher()
1766 resource->object.implementation = implementation; in wl_resource_set_dispatcher()
1767 resource->data = data; in wl_resource_set_dispatcher()
1768 resource->destroy = destroy; in wl_resource_set_dispatcher()
1788 struct wl_resource *resource; in wl_resource_create() local
1790 resource = malloc(sizeof *resource); in wl_resource_create()
1791 if (resource == NULL) in wl_resource_create()
1797 resource->object.id = id; in wl_resource_create()
1798 resource->object.interface = interface; in wl_resource_create()
1799 resource->object.implementation = NULL; in wl_resource_create()
1801 wl_signal_init(&resource->deprecated_destroy_signal); in wl_resource_create()
1802 wl_priv_signal_init(&resource->destroy_signal); in wl_resource_create()
1804 resource->destroy = NULL; in wl_resource_create()
1805 resource->client = client; in wl_resource_create()
1806 resource->data = NULL; in wl_resource_create()
1807 resource->version = version; in wl_resource_create()
1808 resource->dispatcher = NULL; in wl_resource_create()
1810 if (wl_map_insert_at(&client->objects, 0, id, resource) < 0) { in wl_resource_create()
1814 free(resource); in wl_resource_create()
1818 wl_priv_signal_emit(&client->resource_created_signal, resource); in wl_resource_create()
1819 return resource; in wl_resource_create()
2020 struct wl_resource *resource = res; in resource_iterator_helper() local
2022 return context->it(resource, context->user_data); in resource_iterator_helper()
2196 struct wl_resource *resource) WL_DEPRECATED;
2200 struct wl_resource *resource) in wl_client_add_resource() argument
2202 if (resource->object.id == 0) { in wl_client_add_resource()
2203 resource->object.id = in wl_client_add_resource()
2205 WL_MAP_ENTRY_LEGACY, resource); in wl_client_add_resource()
2207 resource->object.id, resource) < 0) { in wl_client_add_resource()
2211 resource->object.id); in wl_client_add_resource()
2215 resource->client = client; in wl_client_add_resource()
2216 wl_signal_init(&resource->deprecated_destroy_signal); in wl_client_add_resource()
2218 return resource->object.id; in wl_client_add_resource()
2232 struct wl_resource *resource; in wl_client_add_object() local
2234 resource = wl_resource_create(client, interface, -1, id); in wl_client_add_object()
2235 if (resource == NULL) in wl_client_add_object()
2238 wl_resource_set_implementation(resource, in wl_client_add_object()
2241 return resource; in wl_client_add_object()
2254 struct wl_resource *resource; in wl_client_new_object() local
2256 resource = wl_resource_create(client, interface, -1, 0); in wl_client_new_object()
2257 if (resource == NULL) in wl_client_new_object()
2260 wl_resource_set_implementation(resource, in wl_client_new_object()
2263 return resource; in wl_client_new_object()