Represent event and method metadata with struct wl_message.

dev
Kristian Høgsberg 16 years ago
parent fe831a7494
commit fb6d68ddbe
  1. 10
      wayland-protocol.c
  2. 11
      wayland-protocol.h
  3. 2
      wayland-system-compositor.c
  4. 4
      wayland.c

@ -25,7 +25,7 @@
#include "wayland-util.h" #include "wayland-util.h"
#include "wayland-protocol.h" #include "wayland-protocol.h"
static const struct wl_event display_events[] = { static const struct wl_message display_events[] = {
{ "invalid_object", "u" }, { "invalid_object", "u" },
{ "invalid_method", "uu" }, { "invalid_method", "uu" },
{ "no_memory", "" }, { "no_memory", "" },
@ -39,12 +39,12 @@ WL_EXPORT const struct wl_interface wl_display_interface = {
}; };
static const struct wl_method compositor_methods[] = { static const struct wl_message compositor_methods[] = {
{ "create_surface", "n" }, { "create_surface", "n" },
{ "commit", "u" } { "commit", "u" }
}; };
static const struct wl_event compositor_events[] = { static const struct wl_message compositor_events[] = {
{ "acknowledge", "uu" }, { "acknowledge", "uu" },
{ "frame", "uu" } { "frame", "uu" }
}; };
@ -56,7 +56,7 @@ WL_EXPORT const struct wl_interface wl_compositor_interface = {
}; };
static const struct wl_method surface_methods[] = { static const struct wl_message surface_methods[] = {
{ "destroy", "" }, { "destroy", "" },
{ "attach", "uuuuo" }, { "attach", "uuuuo" },
{ "map", "iiii" }, { "map", "iiii" },
@ -71,7 +71,7 @@ WL_EXPORT const struct wl_interface wl_surface_interface = {
}; };
static const struct wl_event input_device_events[] = { static const struct wl_message input_device_events[] = {
{ "motion", "iiii" }, { "motion", "iiii" },
{ "button", "uuiiii" }, { "button", "uuiiii" },
{ "key", "uu" }, { "key", "uu" },

@ -30,24 +30,19 @@ struct wl_argument {
void *data; void *data;
}; };
struct wl_method { struct wl_message {
const char *name; const char *name;
const char *signature; const char *signature;
const void **types; const void **types;
}; };
struct wl_event {
const char *name;
const char *signature;
};
struct wl_interface { struct wl_interface {
const char *name; const char *name;
int version; int version;
int method_count; int method_count;
const struct wl_method *methods; const struct wl_message *methods;
int event_count; int event_count;
const struct wl_event *events; const struct wl_message *events;
}; };
#define WL_DISPLAY_INVALID_OBJECT 0 #define WL_DISPLAY_INVALID_OBJECT 0

@ -145,7 +145,7 @@ screenshooter_shoot(struct wl_client *client, struct screenshooter *shooter)
gdk_pixbuf_save(pixbuf, filename, "png", &error, NULL); gdk_pixbuf_save(pixbuf, filename, "png", &error, NULL);
} }
static const struct wl_method screenshooter_methods[] = { static const struct wl_message screenshooter_methods[] = {
{ "shoot", "", NULL } { "shoot", "", NULL }
}; };

@ -70,7 +70,7 @@ static void
wl_client_vmarshal(struct wl_client *client, struct wl_object *sender, wl_client_vmarshal(struct wl_client *client, struct wl_object *sender,
uint32_t opcode, va_list ap) uint32_t opcode, va_list ap)
{ {
const struct wl_event *event; const struct wl_message *event;
struct wl_object *object; struct wl_object *object;
uint32_t args[32], length, *p, size; uint32_t args[32], length, *p, size;
const char *s; const char *s;
@ -125,7 +125,7 @@ static void
wl_client_demarshal(struct wl_client *client, struct wl_object *target, wl_client_demarshal(struct wl_client *client, struct wl_object *target,
uint32_t opcode, size_t size) uint32_t opcode, size_t size)
{ {
const struct wl_method *method; const struct wl_message *method;
ffi_type *types[20]; ffi_type *types[20];
ffi_cif cif; ffi_cif cif;
uint32_t *p, result; uint32_t *p, result;

Loading…
Cancel
Save