From e2ce43a9bebce49836abfa8b8893bd8dda7fee26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 2 Dec 2008 18:28:23 -0500 Subject: [PATCH] Fix namespace convention for glib source. --- flower.c | 2 +- screenshot.c | 2 +- wayland-glib.c | 38 +++++++++++++++++++------------------- wayland-glib.h | 3 +-- window.c | 2 +- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/flower.c b/flower.c index db79788..e380165 100644 --- a/flower.c +++ b/flower.c @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) return -1; } - source = wayland_source_new(display); + source = wl_glib_source_new(display); g_source_attach(source, NULL); flower.display = display; diff --git a/screenshot.c b/screenshot.c index 9f1e685..1d62c46 100644 --- a/screenshot.c +++ b/screenshot.c @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) } loop = g_main_loop_new(NULL, FALSE); - source = wayland_source_new(display); + source = wl_glib_source_new(display); g_source_attach(source, NULL); s = screenshooter_create(display); diff --git a/wayland-glib.c b/wayland-glib.c index b6f2c27..fa7a9f5 100644 --- a/wayland-glib.c +++ b/wayland-glib.c @@ -25,17 +25,17 @@ #include "wayland-client.h" #include "wayland-glib.h" -struct _WaylandSource { +typedef struct _WlSource { GSource source; GPollFD pfd; uint32_t mask; struct wl_display *display; -}; +} WlSource; static gboolean -wayland_source_prepare(GSource *base, gint *timeout) +wl_glib_source_prepare(GSource *base, gint *timeout) { - WaylandSource *source = (WaylandSource *) base; + WlSource *source = (WlSource *) base; *timeout = -1; @@ -51,19 +51,19 @@ wayland_source_prepare(GSource *base, gint *timeout) } static gboolean -wayland_source_check(GSource *base) +wl_glib_source_check(GSource *base) { - WaylandSource *source = (WaylandSource *) base; + WlSource *source = (WlSource *) base; return source->pfd.revents; } static gboolean -wayland_source_dispatch(GSource *base, +wl_glib_source_dispatch(GSource *base, GSourceFunc callback, gpointer data) { - WaylandSource *source = (WaylandSource *) base; + WlSource *source = (WlSource *) base; wl_display_iterate(source->display, WL_DISPLAY_READABLE); @@ -71,17 +71,17 @@ wayland_source_dispatch(GSource *base, return TRUE; } -static GSourceFuncs wayland_source_funcs = { - wayland_source_prepare, - wayland_source_check, - wayland_source_dispatch, +static GSourceFuncs wl_glib_source_funcs = { + wl_glib_source_prepare, + wl_glib_source_check, + wl_glib_source_dispatch, NULL }; static int -wayland_source_update(uint32_t mask, void *data) +wl_glib_source_update(uint32_t mask, void *data) { - WaylandSource *source = data; + WlSource *source = data; source->mask = mask; @@ -89,15 +89,15 @@ wayland_source_update(uint32_t mask, void *data) } GSource * -wayland_source_new(struct wl_display *display) +wl_glib_source_new(struct wl_display *display) { - WaylandSource *source; + WlSource *source; - source = (WaylandSource *) g_source_new(&wayland_source_funcs, - sizeof (WaylandSource)); + source = (WlSource *) g_source_new(&wl_glib_source_funcs, + sizeof (WlSource)); source->display = display; source->pfd.fd = wl_display_get_fd(display, - wayland_source_update, source); + wl_glib_source_update, source); source->pfd.events = G_IO_IN | G_IO_ERR; g_source_add_poll(&source->source, &source->pfd); diff --git a/wayland-glib.h b/wayland-glib.h index 9aba607..0563bec 100644 --- a/wayland-glib.h +++ b/wayland-glib.h @@ -25,8 +25,7 @@ #include -typedef struct _WaylandSource WaylandSource; +GSource *wl_glib_source_new(struct wl_display *display); -GSource *wayland_source_new(struct wl_display *display); #endif diff --git a/window.c b/window.c index bcb975b..e7a275e 100644 --- a/window.c +++ b/window.c @@ -425,7 +425,7 @@ int main(int argc, char *argv[]) } loop = g_main_loop_new(NULL, FALSE); - source = wayland_source_new(display); + source = wl_glib_source_new(display); g_source_attach(source, NULL); window = window_create(display, fd); -- 2.7.4