[gtk+/gdk-backend: 56/91] Move event source apis to gdk_x11
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend: 56/91] Move event source apis to gdk_x11
- Date: Sat, 18 Dec 2010 01:10:31 +0000 (UTC)
commit 5702821ef695945e8cc4df40dc3d33723d348bcf
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 15 12:25:38 2010 -0500
Move event source apis to gdk_x11
Reduces the changes of cross-backend collisions
gdk/x11/gdkdisplay-x11.c | 16 ++++++++--------
gdk/x11/gdkeventsource.c | 36 ++++++++++++++++++------------------
gdk/x11/gdkeventsource.h | 14 +++++++-------
gdk/x11/gdkwindow-x11.c | 18 +++++++++---------
4 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 11b3ebe..b61d832 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1100,19 +1100,19 @@ gdk_event_init (GdkDisplay *display)
GdkDeviceManager *device_manager;
display_x11 = GDK_DISPLAY_X11 (display);
- display_x11->event_source = gdk_event_source_new (display);
+ display_x11->event_source = gdk_x11_event_source_new (display);
- gdk_event_source_add_translator ((GdkEventSource *) display_x11->event_source,
- GDK_EVENT_TRANSLATOR (display));
+ gdk_x11_event_source_add_translator ((GdkEventSource *) display_x11->event_source,
+ GDK_EVENT_TRANSLATOR (display));
device_manager = gdk_display_get_device_manager (display);
- gdk_event_source_add_translator ((GdkEventSource *) display_x11->event_source,
- GDK_EVENT_TRANSLATOR (device_manager));
+ gdk_x11_event_source_add_translator ((GdkEventSource *) display_x11->event_source,
+ GDK_EVENT_TRANSLATOR (device_manager));
gdk_display_add_client_message_filter (display,
- gdk_atom_intern_static_string ("WM_PROTOCOLS"),
- gdk_wm_protocols_filter,
- NULL);
+ gdk_atom_intern_static_string ("WM_PROTOCOLS"),
+ gdk_wm_protocols_filter,
+ NULL);
}
static void
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 6d7d856..f4a21ef 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -56,8 +56,8 @@ static GList *event_sources = NULL;
static gint
gdk_event_apply_filters (XEvent *xevent,
- GdkEvent *event,
- GList **filters)
+ GdkEvent *event,
+ GList **filters)
{
GList *tmp_list;
GdkFilterReturn result;
@@ -92,7 +92,7 @@ gdk_event_apply_filters (XEvent *xevent,
}
if (result != GDK_FILTER_CONTINUE)
- return result;
+ return result;
}
return GDK_FILTER_CONTINUE;
@@ -105,7 +105,7 @@ gdk_event_source_get_filter_window (GdkEventSource *event_source,
GdkWindow *window;
window = gdk_x11_window_lookup_for_display (event_source->display,
- xevent->xany.window);
+ xevent->xany.window);
if (window && !GDK_IS_WINDOW (window))
window = NULL;
@@ -184,9 +184,9 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
event->any.window = g_object_ref (filter_window);
if (filter_window->filters)
- {
- result = gdk_event_apply_filters (xevent, event,
- &filter_window->filters);
+ {
+ result = gdk_event_apply_filters (xevent, event,
+ &filter_window->filters);
if (result == GDK_FILTER_REMOVE)
{
@@ -195,7 +195,7 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
}
else if (result == GDK_FILTER_TRANSLATE)
return event;
- }
+ }
}
gdk_event_free (event);
@@ -240,7 +240,7 @@ gdk_event_source_prepare (GSource *source,
*timeout = -1;
retval = (_gdk_event_queue_find_first (display) != NULL ||
- gdk_check_xpending (display));
+ gdk_check_xpending (display));
GDK_THREADS_LEAVE ();
@@ -257,7 +257,7 @@ gdk_event_source_check (GSource *source)
if (event_source->event_poll_fd.revents & G_IO_IN)
retval = (_gdk_event_queue_find_first (event_source->display) != NULL ||
- gdk_check_xpending (event_source->display));
+ gdk_check_xpending (event_source->display));
else
retval = FALSE;
@@ -340,7 +340,7 @@ gdk_event_source_finalize (GSource *source)
}
GSource *
-gdk_event_source_new (GdkDisplay *display)
+gdk_x11_event_source_new (GdkDisplay *display)
{
GSource *source;
GdkEventSource *event_source;
@@ -350,7 +350,7 @@ gdk_event_source_new (GdkDisplay *display)
source = g_source_new (&event_funcs, sizeof (GdkEventSource));
name = g_strdup_printf ("GDK X11 Event source (%s)",
- gdk_display_get_name (display));
+ gdk_display_get_name (display));
g_source_set_name (source, name);
g_free (name);
event_source = (GdkEventSource *) source;
@@ -373,8 +373,8 @@ gdk_event_source_new (GdkDisplay *display)
}
void
-gdk_event_source_add_translator (GdkEventSource *source,
- GdkEventTranslator *translator)
+gdk_x11_event_source_add_translator (GdkEventSource *source,
+ GdkEventTranslator *translator)
{
g_return_if_fail (GDK_IS_EVENT_TRANSLATOR (translator));
@@ -382,10 +382,10 @@ gdk_event_source_add_translator (GdkEventSource *source,
}
void
-gdk_event_source_select_events (GdkEventSource *source,
- Window window,
- GdkEventMask event_mask,
- unsigned int extra_x_mask)
+gdk_x11_event_source_select_events (GdkEventSource *source,
+ Window window,
+ GdkEventMask event_mask,
+ unsigned int extra_x_mask)
{
unsigned int xmask = extra_x_mask;
GList *list;
diff --git a/gdk/x11/gdkeventsource.h b/gdk/x11/gdkeventsource.h
index 4fc0dbe..b1bf6b2 100644
--- a/gdk/x11/gdkeventsource.h
+++ b/gdk/x11/gdkeventsource.h
@@ -28,17 +28,17 @@ G_BEGIN_DECLS
typedef struct _GdkEventSource GdkEventSource;
G_GNUC_INTERNAL
-GSource * gdk_event_source_new (GdkDisplay *display);
+GSource * gdk_x11_event_source_new (GdkDisplay *display);
G_GNUC_INTERNAL
-void gdk_event_source_add_translator (GdkEventSource *source,
- GdkEventTranslator *translator);
+void gdk_x11_event_source_add_translator (GdkEventSource *source,
+ GdkEventTranslator *translator);
G_GNUC_INTERNAL
-void gdk_event_source_select_events (GdkEventSource *source,
- Window window,
- GdkEventMask event_mask,
- unsigned int extra_x_mask);
+void gdk_x11_event_source_select_events (GdkEventSource *source,
+ Window window,
+ GdkEventMask event_mask,
+ unsigned int extra_x_mask);
G_END_DECLS
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 2798a58..a3bb0f6 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -562,9 +562,9 @@ create_focus_window (GdkDisplay *display,
GDK_KEY_RELEASE_MASK |
GDK_FOCUS_CHANGE_MASK);
- gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- focus_window,
- event_mask, 0);
+ gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
+ focus_window,
+ event_mask, 0);
XMapWindow (xdisplay, focus_window);
@@ -827,9 +827,9 @@ _gdk_window_impl_new (GdkWindow *window,
if (attributes_mask & GDK_WA_TYPE_HINT)
gdk_window_set_type_hint (window, attributes->type_hint);
- gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_WINDOW_XID (window), event_mask,
- StructureNotifyMask | PropertyChangeMask);
+ gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
+ GDK_WINDOW_XID (window), event_mask,
+ StructureNotifyMask | PropertyChangeMask);
}
static GdkEventMask
@@ -2833,9 +2833,9 @@ gdk_window_x11_set_events (GdkWindow *window,
xevent_mask = StructureNotifyMask | PropertyChangeMask;
display_x11 = GDK_DISPLAY_X11 (gdk_window_get_display (window));
- gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source,
- GDK_WINDOW_XID (window), event_mask,
- xevent_mask);
+ gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
+ GDK_WINDOW_XID (window), event_mask,
+ xevent_mask);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]