mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
server: Hand code all wl_display client stubs
This commit is contained in:
parent
437051260d
commit
c2cd1fe820
3 changed files with 44 additions and 16 deletions
|
|
@ -343,20 +343,22 @@ emit_stubs(struct wl_list *message_list, struct interface *interface)
|
||||||
struct arg *a, *ret;
|
struct arg *a, *ret;
|
||||||
int has_destructor, has_destroy;
|
int has_destructor, has_destroy;
|
||||||
|
|
||||||
/* We provide a hand written constructor for the display object */
|
/* We provide a hand written functions for the display object */
|
||||||
if (strcmp(interface->name, "wl_display") != 0)
|
if (strcmp(interface->name, "wl_display") == 0)
|
||||||
printf("static inline struct %s *\n"
|
return;
|
||||||
"%s_create(struct wl_display *display, uint32_t id, uint32_t version)\n"
|
|
||||||
"{\n"
|
printf("static inline struct %s *\n"
|
||||||
"\twl_display_bind(display, id, \"%s\", version);\n\n"
|
"%s_create(struct wl_display *display, uint32_t id, uint32_t version)\n"
|
||||||
"\treturn (struct %s *)\n"
|
"{\n"
|
||||||
"\t\twl_proxy_create_for_id(display, &%s_interface, id);\n"
|
"\twl_display_bind(display, id, \"%s\", version);\n\n"
|
||||||
"}\n\n",
|
"\treturn (struct %s *)\n"
|
||||||
interface->name,
|
"\t\twl_proxy_create_for_id(display, &%s_interface, id);\n"
|
||||||
interface->name,
|
"}\n\n",
|
||||||
interface->name,
|
interface->name,
|
||||||
interface->name,
|
interface->name,
|
||||||
interface->name);
|
interface->name,
|
||||||
|
interface->name,
|
||||||
|
interface->name);
|
||||||
|
|
||||||
printf("static inline void\n"
|
printf("static inline void\n"
|
||||||
"%s_set_user_data(struct %s *%s, void *user_data)\n"
|
"%s_set_user_data(struct %s *%s, void *user_data)\n"
|
||||||
|
|
@ -390,8 +392,7 @@ emit_stubs(struct wl_list *message_list, struct interface *interface)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And we have a hand-written display destructor */
|
if (!has_destructor)
|
||||||
if (!has_destructor && strcmp(interface->name, "wl_display") != 0)
|
|
||||||
printf("static inline void\n"
|
printf("static inline void\n"
|
||||||
"%s_destroy(struct %s *%s)\n"
|
"%s_destroy(struct %s *%s)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
|
|
||||||
|
|
@ -524,6 +524,29 @@ wl_display_allocate_id(struct wl_display *display)
|
||||||
return display->id++;
|
return display->id++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WL_EXPORT void
|
||||||
|
wl_display_bind(struct wl_display *display,
|
||||||
|
uint32_t id, const char *interface, uint32_t version)
|
||||||
|
{
|
||||||
|
wl_proxy_marshal(&display->proxy,
|
||||||
|
WL_DISPLAY_BIND, id, interface, version);
|
||||||
|
}
|
||||||
|
|
||||||
|
WL_EXPORT struct wl_callback *
|
||||||
|
wl_display_sync(struct wl_display *display)
|
||||||
|
{
|
||||||
|
struct wl_proxy *proxy;
|
||||||
|
|
||||||
|
proxy = wl_proxy_create(&display->proxy, &wl_callback_interface);
|
||||||
|
|
||||||
|
if (!proxy)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
wl_proxy_marshal(&display->proxy, WL_DISPLAY_SYNC, proxy);
|
||||||
|
|
||||||
|
return (struct wl_callback *) proxy;
|
||||||
|
}
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data)
|
wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ int wl_proxy_add_listener(struct wl_proxy *proxy,
|
||||||
void wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
|
void wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
|
||||||
void *wl_proxy_get_user_data(struct wl_proxy *proxy);
|
void *wl_proxy_get_user_data(struct wl_proxy *proxy);
|
||||||
|
|
||||||
|
void wl_display_bind(struct wl_display *display,
|
||||||
|
uint32_t id, const char *interface, uint32_t version);
|
||||||
|
struct wl_callback *wl_display_sync(struct wl_display *display);
|
||||||
|
|
||||||
#include "wayland-client-protocol.h"
|
#include "wayland-client-protocol.h"
|
||||||
|
|
||||||
#define WL_DISPLAY_READABLE 0x01
|
#define WL_DISPLAY_READABLE 0x01
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue