scanner: emit event wrapper functions for server

Generate typed wrapper functions for sending events in a server.

This allows compile time type checking, unlike the existing method of
calling the variadic function wl_resource_post_event().

The stuff in wayland-server.h had to be slightly reordered to have all
(forward) declarations before use.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
Pekka Paalanen 2012-03-02 15:16:33 +02:00
parent 0d22d25b87
commit 86a5d17afe
2 changed files with 51 additions and 8 deletions

View file

@ -30,7 +30,6 @@ extern "C" {
#include <sys/types.h>
#include <stdint.h>
#include "wayland-util.h"
#include "wayland-server-protocol.h"
enum {
WL_EVENT_READABLE = 0x01,
@ -121,6 +120,13 @@ struct wl_resource {
void *data;
};
struct wl_buffer {
struct wl_resource resource;
int32_t width, height;
uint32_t busy_count;
void *user_data;
};
struct wl_shm_callbacks {
void (*buffer_created)(struct wl_buffer *buffer);
@ -131,13 +137,6 @@ struct wl_shm_callbacks {
void (*buffer_destroyed)(struct wl_buffer *buffer);
};
struct wl_buffer {
struct wl_resource resource;
int32_t width, height;
uint32_t busy_count;
void *user_data;
};
struct wl_listener {
struct wl_list link;
void (*func)(struct wl_listener *listener,
@ -265,6 +264,8 @@ void wl_resource_post_error(struct wl_resource *resource,
uint32_t code, const char *msg, ...);
void wl_resource_post_no_memory(struct wl_resource *resource);
#include "wayland-server-protocol.h"
void
wl_display_post_frame(struct wl_display *display, struct wl_surface *surface,
uint32_t msecs);