Move proxy prototype to wayland-client.h
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 13 Apr 2011 20:27:06 +0000 (16:27 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 13 Apr 2011 20:27:06 +0000 (16:27 -0400)
Let's try to avoid to generate more code than we need to.

wayland/scanner.c
wayland/wayland-client.c
wayland/wayland-client.h

index 0cc553c..4eb7a40 100644 (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
 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",
index da89b5b..451a83f 100644 (file)
@@ -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"
index 1064a3a..a5992a2 100644 (file)
 #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