mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
connection: Move closure object out of wl_connection
This commit is contained in:
parent
0d6dea17b4
commit
1901d66ffc
6 changed files with 96 additions and 94 deletions
|
|
@ -190,29 +190,29 @@ wl_proxy_add_listener(struct wl_proxy *proxy,
|
|||
WL_EXPORT void
|
||||
wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
|
||||
{
|
||||
struct wl_closure *closure;
|
||||
struct wl_closure closure;
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
va_start(ap, opcode);
|
||||
closure = wl_connection_vmarshal(proxy->display->connection,
|
||||
&proxy->object, opcode, ap,
|
||||
&proxy->object.interface->methods[opcode]);
|
||||
ret = wl_closure_vmarshal(&closure, &proxy->object, opcode, ap,
|
||||
&proxy->object.interface->methods[opcode]);
|
||||
va_end(ap);
|
||||
|
||||
if (closure == NULL) {
|
||||
if (ret) {
|
||||
fprintf(stderr, "Error marshalling request\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
if (wl_closure_send(closure, proxy->display->connection)) {
|
||||
if (wl_closure_send(&closure, proxy->display->connection)) {
|
||||
fprintf(stderr, "Error sending request: %m\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
if (wl_debug)
|
||||
wl_closure_print(closure, &proxy->object, true);
|
||||
wl_closure_print(&closure, &proxy->object, true);
|
||||
|
||||
wl_closure_destroy(closure);
|
||||
wl_closure_destroy(&closure);
|
||||
}
|
||||
|
||||
/* Can't do this, there may be more than one instance of an
|
||||
|
|
@ -465,8 +465,9 @@ handle_event(struct wl_display *display,
|
|||
uint32_t id, uint32_t opcode, uint32_t size)
|
||||
{
|
||||
struct wl_proxy *proxy;
|
||||
struct wl_closure *closure;
|
||||
struct wl_closure closure;
|
||||
const struct wl_message *message;
|
||||
int ret;
|
||||
|
||||
proxy = wl_map_lookup(&display->objects, id);
|
||||
|
||||
|
|
@ -479,22 +480,22 @@ handle_event(struct wl_display *display,
|
|||
}
|
||||
|
||||
message = &proxy->object.interface->events[opcode];
|
||||
closure = wl_connection_demarshal(display->connection,
|
||||
size, &display->objects, message);
|
||||
ret = wl_connection_demarshal(display->connection, &closure,
|
||||
size, &display->objects, message);
|
||||
|
||||
if (closure == NULL) {
|
||||
if (ret) {
|
||||
fprintf(stderr, "Error demarshalling event\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
if (wl_debug)
|
||||
wl_closure_print(closure, &proxy->object, false);
|
||||
wl_closure_print(&closure, &proxy->object, false);
|
||||
|
||||
wl_closure_invoke(closure, &proxy->object,
|
||||
wl_closure_invoke(&closure, &proxy->object,
|
||||
proxy->object.implementation[opcode],
|
||||
proxy->user_data);
|
||||
|
||||
wl_closure_destroy(closure);
|
||||
wl_closure_destroy(&closure);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue