Move proxy prototype to wayland-client.h

Let's try to avoid to generate more code than we need to.
This commit is contained in:
Kristian Høgsberg 2011-04-13 16:27:06 -04:00
parent f04e05ad76
commit 06c2ebf6ec
3 changed files with 18 additions and 32 deletions

View file

@ -543,33 +543,6 @@ emit_structs(struct wl_list *message_list, struct interface *interface)
} }
} }
static const char client_prototypes[] =
"struct wl_proxy;\n\n"
"extern void\n"
"wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...);\n"
"extern struct wl_proxy *\n"
"wl_proxy_create(struct wl_proxy *factory,\n"
"\t\tconst struct wl_interface *interface);\n"
"extern struct wl_proxy *\n"
"wl_proxy_create_for_id(struct wl_display *display,\n"
"\t\t const struct wl_interface *interface, uint32_t id);\n"
"extern void\n"
"wl_proxy_destroy(struct wl_proxy *proxy);\n\n"
"extern int\n"
"wl_proxy_add_listener(struct wl_proxy *proxy,\n"
"\t\t void (**implementation)(void), void *data);\n\n"
"extern void\n"
"wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);\n\n"
"extern void *\n"
"wl_proxy_get_user_data(struct wl_proxy *proxy);\n\n";
static void static void
emit_header(struct protocol *protocol, int server) emit_header(struct protocol *protocol, int server)
@ -597,9 +570,6 @@ emit_header(struct protocol *protocol, int server)
printf("struct wl_%s;\n", i->name); printf("struct wl_%s;\n", i->name);
printf("\n"); printf("\n");
if (!server)
printf(client_prototypes);
wl_list_for_each(i, &protocol->interface_list, link) { wl_list_for_each(i, &protocol->interface_list, link) {
printf("extern const struct wl_interface " printf("extern const struct wl_interface "
"wl_%s_interface;\n", "wl_%s_interface;\n",

View file

@ -34,7 +34,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/poll.h> #include <sys/poll.h>
#include "wayland-client-protocol.h"
#include "connection.h" #include "connection.h"
#include "wayland-util.h" #include "wayland-util.h"
#include "wayland-client.h" #include "wayland-client.h"

View file

@ -24,12 +24,28 @@
#define _WAYLAND_CLIENT_H #define _WAYLAND_CLIENT_H
#include "wayland-util.h" #include "wayland-util.h"
#include "wayland-client-protocol.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct wl_proxy;
struct wl_display;
void wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...);
struct wl_proxy *wl_proxy_create(struct wl_proxy *factory,
const struct wl_interface *interface);
struct wl_proxy *wl_proxy_create_for_id(struct wl_display *display,
const struct wl_interface *interface,
uint32_t id);
void wl_proxy_destroy(struct wl_proxy *proxy);
int wl_proxy_add_listener(struct wl_proxy *proxy,
void (**implementation)(void), void *data);
void wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
void *wl_proxy_get_user_data(struct wl_proxy *proxy);
#include "wayland-client-protocol.h"
#define WL_DISPLAY_READABLE 0x01 #define WL_DISPLAY_READABLE 0x01
#define WL_DISPLAY_WRITABLE 0x02 #define WL_DISPLAY_WRITABLE 0x02
@ -70,6 +86,7 @@ wl_display_get_premultiplied_argb_visual(struct wl_display *display);
struct wl_visual * struct wl_visual *
wl_display_get_rgb_visual(struct wl_display *display); wl_display_get_rgb_visual(struct wl_display *display);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif