summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-04-13 16:27:06 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-04-13 16:27:06 -0400
commit06c2ebf6ec60bacf89541f59a395f6c5c2e1edc0 (patch)
treeb82f3f62f970d539107a57aa4ac38f6b19c4554b
parentf04e05ad76cd6af890b7b741a9e0f5181bd0ac10 (diff)
Move proxy prototype to wayland-client.h
Let's try to avoid to generate more code than we need to.
-rw-r--r--wayland/scanner.c30
-rw-r--r--wayland/wayland-client.c1
-rw-r--r--wayland/wayland-client.h19
3 files changed, 18 insertions, 32 deletions
diff --git a/wayland/scanner.c b/wayland/scanner.c
index 0cc553c..4eb7a40 100644
--- a/wayland/scanner.c
+++ b/wayland/scanner.c
@@ -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
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("\n");
- if (!server)
- printf(client_prototypes);
-
wl_list_for_each(i, &protocol->interface_list, link) {
printf("extern const struct wl_interface "
"wl_%s_interface;\n",
diff --git a/wayland/wayland-client.c b/wayland/wayland-client.c
index da89b5b..451a83f 100644
--- a/wayland/wayland-client.c
+++ b/wayland/wayland-client.c
@@ -34,7 +34,6 @@
#include <fcntl.h>
#include <sys/poll.h>
-#include "wayland-client-protocol.h"
#include "connection.h"
#include "wayland-util.h"
#include "wayland-client.h"
diff --git a/wayland/wayland-client.h b/wayland/wayland-client.h
index 1064a3a..a5992a2 100644
--- a/wayland/wayland-client.h
+++ b/wayland/wayland-client.h
@@ -24,12 +24,28 @@
#define _WAYLAND_CLIENT_H
#include "wayland-util.h"
-#include "wayland-client-protocol.h"
#ifdef __cplusplus
extern "C" {
#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_WRITABLE 0x02
@@ -70,6 +86,7 @@ wl_display_get_premultiplied_argb_visual(struct wl_display *display);
struct wl_visual *
wl_display_get_rgb_visual(struct wl_display *display);
+
#ifdef __cplusplus
}
#endif