• Home
  • Raw
  • Download

Lines Matching refs:proxy

82 	struct wl_proxy proxy;  member
231 struct wl_proxy *proxy; in decrease_closure_args_refcount() local
240 proxy = (struct wl_proxy *) closure->args[i].o; in decrease_closure_args_refcount()
241 if (proxy) { in decrease_closure_args_refcount()
242 if (proxy->flags & WL_PROXY_FLAG_DESTROYED) in decrease_closure_args_refcount()
245 proxy->refcount--; in decrease_closure_args_refcount()
246 if (!proxy->refcount) in decrease_closure_args_refcount()
247 free(proxy); in decrease_closure_args_refcount()
260 struct wl_proxy *proxy; in wl_event_queue_release() local
270 proxy = closure->proxy; in wl_event_queue_release()
271 proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED); in wl_event_queue_release()
273 proxy->refcount--; in wl_event_queue_release()
274 if (proxy_destroyed && !proxy->refcount) in wl_event_queue_release()
275 free(proxy); in wl_event_queue_release()
331 struct wl_proxy *proxy; in proxy_create() local
334 proxy = zalloc(sizeof *proxy); in proxy_create()
335 if (proxy == NULL) in proxy_create()
338 proxy->object.interface = interface; in proxy_create()
339 proxy->display = display; in proxy_create()
340 proxy->queue = factory->queue; in proxy_create()
341 proxy->refcount = 1; in proxy_create()
342 proxy->version = version; in proxy_create()
344 proxy->object.id = wl_map_insert_new(&display->objects, 0, proxy); in proxy_create()
346 return proxy; in proxy_create()
372 struct wl_proxy *proxy; in wl_proxy_create() local
375 proxy = proxy_create(factory, interface, factory->version); in wl_proxy_create()
378 return proxy; in wl_proxy_create()
386 struct wl_proxy *proxy; in wl_proxy_create_for_id() local
389 proxy = zalloc(sizeof *proxy); in wl_proxy_create_for_id()
390 if (proxy == NULL) in wl_proxy_create_for_id()
393 proxy->object.interface = interface; in wl_proxy_create_for_id()
394 proxy->object.id = id; in wl_proxy_create_for_id()
395 proxy->display = display; in wl_proxy_create_for_id()
396 proxy->queue = factory->queue; in wl_proxy_create_for_id()
397 proxy->refcount = 1; in wl_proxy_create_for_id()
398 proxy->version = factory->version; in wl_proxy_create_for_id()
400 wl_map_insert_at(&display->objects, 0, id, proxy); in wl_proxy_create_for_id()
402 return proxy; in wl_proxy_create_for_id()
406 proxy_destroy(struct wl_proxy *proxy) in proxy_destroy() argument
408 if (proxy->flags & WL_PROXY_FLAG_ID_DELETED) in proxy_destroy()
409 wl_map_remove(&proxy->display->objects, proxy->object.id); in proxy_destroy()
410 else if (proxy->object.id < WL_SERVER_ID_START) in proxy_destroy()
411 wl_map_insert_at(&proxy->display->objects, 0, in proxy_destroy()
412 proxy->object.id, WL_ZOMBIE_OBJECT); in proxy_destroy()
414 wl_map_insert_at(&proxy->display->objects, 0, in proxy_destroy()
415 proxy->object.id, NULL); in proxy_destroy()
418 proxy->flags |= WL_PROXY_FLAG_DESTROYED; in proxy_destroy()
420 proxy->refcount--; in proxy_destroy()
421 if (!proxy->refcount) in proxy_destroy()
422 free(proxy); in proxy_destroy()
434 wl_proxy_destroy(struct wl_proxy *proxy) in wl_proxy_destroy() argument
436 struct wl_display *display = proxy->display; in wl_proxy_destroy()
438 if (proxy->flags & WL_PROXY_FLAG_WRAPPER) in wl_proxy_destroy()
442 proxy_destroy(proxy); in wl_proxy_destroy()
466 wl_proxy_add_listener(struct wl_proxy *proxy, in wl_proxy_add_listener() argument
469 if (proxy->flags & WL_PROXY_FLAG_WRAPPER) in wl_proxy_add_listener()
470 wl_abort("Proxy %p is a wrapper\n", proxy); in wl_proxy_add_listener()
472 if (proxy->object.implementation || proxy->dispatcher) { in wl_proxy_add_listener()
473 wl_log("proxy %p already has listener\n", proxy); in wl_proxy_add_listener()
477 proxy->object.implementation = implementation; in wl_proxy_add_listener()
478 proxy->user_data = data; in wl_proxy_add_listener()
497 wl_proxy_get_listener(struct wl_proxy *proxy) in wl_proxy_get_listener() argument
499 return proxy->object.implementation; in wl_proxy_get_listener()
523 wl_proxy_add_dispatcher(struct wl_proxy *proxy, in wl_proxy_add_dispatcher() argument
527 if (proxy->flags & WL_PROXY_FLAG_WRAPPER) in wl_proxy_add_dispatcher()
528 wl_abort("Proxy %p is a wrapper\n", proxy); in wl_proxy_add_dispatcher()
530 if (proxy->object.implementation || proxy->dispatcher) { in wl_proxy_add_dispatcher()
531 wl_log("proxy %p already has listener\n", proxy); in wl_proxy_add_dispatcher()
535 proxy->object.implementation = implementation; in wl_proxy_add_dispatcher()
536 proxy->dispatcher = dispatcher; in wl_proxy_add_dispatcher()
537 proxy->user_data = data; in wl_proxy_add_dispatcher()
543 create_outgoing_proxy(struct wl_proxy *proxy, const struct wl_message *message, in create_outgoing_proxy() argument
559 new_proxy = proxy_create(proxy, interface, version); in create_outgoing_proxy()
595 wl_proxy_marshal_array_constructor(struct wl_proxy *proxy, in wl_proxy_marshal_array_constructor() argument
599 return wl_proxy_marshal_array_constructor_versioned(proxy, opcode, in wl_proxy_marshal_array_constructor()
601 proxy->version); in wl_proxy_marshal_array_constructor()
630 wl_proxy_marshal_array_constructor_versioned(struct wl_proxy *proxy, in wl_proxy_marshal_array_constructor_versioned() argument
640 pthread_mutex_lock(&proxy->display->mutex); in wl_proxy_marshal_array_constructor_versioned()
642 message = &proxy->object.interface->methods[opcode]; in wl_proxy_marshal_array_constructor_versioned()
644 new_proxy = create_outgoing_proxy(proxy, message, in wl_proxy_marshal_array_constructor_versioned()
651 closure = wl_closure_marshal(&proxy->object, opcode, args, message); in wl_proxy_marshal_array_constructor_versioned()
656 wl_closure_print(closure, &proxy->object, true); in wl_proxy_marshal_array_constructor_versioned()
658 if (wl_closure_send(closure, proxy->display->connection)) in wl_proxy_marshal_array_constructor_versioned()
664 pthread_mutex_unlock(&proxy->display->mutex); in wl_proxy_marshal_array_constructor_versioned()
686 wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...) in wl_proxy_marshal() argument
692 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal()
696 wl_proxy_marshal_array_constructor(proxy, opcode, args, NULL); in wl_proxy_marshal()
722 wl_proxy_marshal_constructor(struct wl_proxy *proxy, uint32_t opcode, in wl_proxy_marshal_constructor() argument
729 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal_constructor()
733 return wl_proxy_marshal_array_constructor(proxy, opcode, in wl_proxy_marshal_constructor()
760 wl_proxy_marshal_constructor_versioned(struct wl_proxy *proxy, uint32_t opcode, in wl_proxy_marshal_constructor_versioned() argument
768 wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature, in wl_proxy_marshal_constructor_versioned()
772 return wl_proxy_marshal_array_constructor_versioned(proxy, opcode, in wl_proxy_marshal_constructor_versioned()
794 wl_proxy_marshal_array(struct wl_proxy *proxy, uint32_t opcode, in wl_proxy_marshal_array() argument
797 wl_proxy_marshal_array_constructor(proxy, opcode, args, NULL); in wl_proxy_marshal_array()
805 struct wl_proxy *proxy = object; in display_handle_error() local
809 if (proxy) { in display_handle_error()
811 proxy->object.interface->name, in display_handle_error()
812 proxy->object.id, in display_handle_error()
815 object_id = proxy->object.id; in display_handle_error()
816 interface = proxy->object.interface; in display_handle_error()
831 struct wl_proxy *proxy; in display_handle_delete_id() local
835 proxy = wl_map_lookup(&display->objects, id); in display_handle_delete_id()
837 if (!proxy) in display_handle_delete_id()
840 if (proxy && proxy != WL_ZOMBIE_OBJECT) in display_handle_delete_id()
841 proxy->flags |= WL_PROXY_FLAG_ID_DELETED; in display_handle_delete_id()
943 display->proxy.object.interface = &wl_display_interface; in wl_display_connect_to_fd()
944 display->proxy.object.id = in wl_display_connect_to_fd()
946 display->proxy.display = display; in wl_display_connect_to_fd()
947 display->proxy.object.implementation = (void(**)(void)) &display_listener; in wl_display_connect_to_fd()
948 display->proxy.user_data = display; in wl_display_connect_to_fd()
949 display->proxy.queue = &display->default_queue; in wl_display_connect_to_fd()
950 display->proxy.flags = 0; in wl_display_connect_to_fd()
951 display->proxy.refcount = 1; in wl_display_connect_to_fd()
970 display->proxy.version = 0; in wl_display_connect_to_fd()
1156 struct wl_proxy *proxy; in create_proxies() local
1174 proxy = wl_proxy_create_for_id(sender, id, in create_proxies()
1176 if (proxy == NULL) in create_proxies()
1178 closure->args[i].o = (struct wl_object *)proxy; in create_proxies()
1194 struct wl_proxy *proxy; in increase_closure_args_refcount() local
1203 proxy = (struct wl_proxy *) closure->args[i].o; in increase_closure_args_refcount()
1204 if (proxy) in increase_closure_args_refcount()
1205 proxy->refcount++; in increase_closure_args_refcount()
1218 struct wl_proxy *proxy; in queue_event() local
1230 proxy = wl_map_lookup(&display->objects, id); in queue_event()
1231 if (proxy == WL_ZOMBIE_OBJECT) { in queue_event()
1234 } else if (proxy == NULL) { in queue_event()
1239 message = &proxy->object.interface->events[opcode]; in queue_event()
1245 if (create_proxies(proxy, closure) < 0) { in queue_event()
1256 proxy->refcount++; in queue_event()
1257 closure->proxy = proxy; in queue_event()
1259 if (proxy == &display->proxy) in queue_event()
1262 queue = proxy->queue; in queue_event()
1273 struct wl_proxy *proxy; in dispatch_event() local
1286 proxy = closure->proxy; in dispatch_event()
1287 proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED); in dispatch_event()
1289 proxy->refcount--; in dispatch_event()
1291 if (!proxy->refcount) in dispatch_event()
1292 free(proxy); in dispatch_event()
1300 if (proxy->dispatcher) { in dispatch_event()
1302 wl_closure_print(closure, &proxy->object, false); in dispatch_event()
1304 wl_closure_dispatch(closure, proxy->dispatcher, in dispatch_event()
1305 &proxy->object, opcode); in dispatch_event()
1306 } else if (proxy->object.implementation) { in dispatch_event()
1308 wl_closure_print(closure, &proxy->object, false); in dispatch_event()
1311 &proxy->object, opcode, proxy->user_data); in dispatch_event()
1890 wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data) in wl_proxy_set_user_data() argument
1892 proxy->user_data = user_data; in wl_proxy_set_user_data()
1903 wl_proxy_get_user_data(struct wl_proxy *proxy) in wl_proxy_get_user_data() argument
1905 return proxy->user_data; in wl_proxy_get_user_data()
1925 wl_proxy_get_version(struct wl_proxy *proxy) in wl_proxy_get_version() argument
1927 return proxy->version; in wl_proxy_get_version()
1938 wl_proxy_get_id(struct wl_proxy *proxy) in wl_proxy_get_id() argument
1940 return proxy->object.id; in wl_proxy_get_id()
1951 wl_proxy_get_class(struct wl_proxy *proxy) in wl_proxy_get_class() argument
1953 return proxy->object.interface->name; in wl_proxy_get_class()
1972 wl_proxy_set_queue(struct wl_proxy *proxy, struct wl_event_queue *queue) in wl_proxy_set_queue() argument
1975 proxy->queue = queue; in wl_proxy_set_queue()
1977 proxy->queue = &proxy->display->default_queue; in wl_proxy_set_queue()
2029 wl_proxy_create_wrapper(void *proxy) in wl_proxy_create_wrapper() argument
2031 struct wl_proxy *wrapped_proxy = proxy; in wl_proxy_create_wrapper()