[gtk+/gdk-backend] Add vfuncs for _gdk_windowing_event_data_{copy, free}
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend] Add vfuncs for _gdk_windowing_event_data_{copy, free}
- Date: Wed, 15 Dec 2010 05:38:15 +0000 (UTC)
commit 61c8f95fcafe1262da1ae38ed29d6f49e32be9ef
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 15 00:37:40 2010 -0500
Add vfuncs for _gdk_windowing_event_data_{copy,free}
gdk/gdkdisplay.c | 15 +++++++++++++++
gdk/gdkdisplayprivate.h | 10 ++++++++++
gdk/gdkevents.c | 10 +++++++---
gdk/x11/gdkdisplay-x11.c | 15 +++++++++++++++
gdk/x11/gdkmain-x11.c | 11 -----------
5 files changed, 47 insertions(+), 14 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 5333e4b..324f164 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -2514,3 +2514,18 @@ gdk_display_notify_startup_complete (GdkDisplay *display,
{
GDK_DISPLAY_GET_CLASS (display)->notify_startup_complete (display, startup_id);
}
+
+void
+_gdk_display_event_data_copy (GdkDisplay *display,
+ const GdkEvent *event,
+ GdkEvent *new_event)
+{
+ GDK_DISPLAY_GET_CLASS (display)->event_data_copy (display, event, new_event);
+}
+
+void
+_gdk_display_event_data_free (GdkDisplay *display,
+ GdkEvent *event)
+{
+ GDK_DISPLAY_GET_CLASS (display)->event_data_free (display, event);
+}
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 8e09a69..59b4664 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -177,6 +177,11 @@ struct _GdkDisplayClass
void (*notify_startup_complete) (GdkDisplay *display,
const gchar *startup_id);
+ void (*event_data_copy) (GdkDisplay *display,
+ const GdkEvent *event,
+ GdkEvent *new_event);
+ void (*event_data_free) (GdkDisplay *display,
+ GdkEvent *event);
/* Signals */
void (*closed) (GdkDisplay *display,
@@ -223,6 +228,11 @@ void _gdk_display_pointer_info_foreach (GdkDisplay *display
GdkDisplayPointerInfoForeach func,
gpointer user_data);
gulong _gdk_display_get_next_serial (GdkDisplay *display);
+void _gdk_display_event_data_copy (GdkDisplay *display,
+ const GdkEvent *event,
+ GdkEvent *new_event);
+void _gdk_display_event_data_free (GdkDisplay *display,
+ GdkEvent *event);
G_END_DECLS
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index fef1f30..df28028 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -571,8 +571,9 @@ gdk_event_copy (const GdkEvent *event)
}
if (gdk_event_is_allocated (event))
- _gdk_windowing_event_data_copy (event, new_event);
-
+ _gdk_display_event_data_copy (gdk_screen_get_display (new_private->screen),
+ event, new_event);
+
return new_event;
}
@@ -588,6 +589,8 @@ gdk_event_copy (const GdkEvent *event)
void
gdk_event_free (GdkEvent *event)
{
+ GdkDisplay *display;
+
g_return_if_fail (event != NULL);
if (event->any.window)
@@ -639,7 +642,8 @@ gdk_event_free (GdkEvent *event)
break;
}
- _gdk_windowing_event_data_free (event);
+ display = gdk_screen_get_display (gdk_event_get_screen (event));
+ _gdk_display_event_data_free (display, event);
g_hash_table_remove (event_hash, event);
g_slice_free (GdkEventPrivate, (GdkEventPrivate*) event);
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 126d028..113d61f 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2668,6 +2668,19 @@ gdk_x11_set_sm_client_id (const gchar *sm_client_id)
}
static void
+gdk_x11_display_event_data_copy (GdkDisplay *display,
+ const GdkEvent *src,
+ GdkEvent *dst)
+{
+}
+
+static void
+gdk_x11_display_event_data_free (GdkDisplay *display,
+ GdkEvent *event)
+{
+}
+
+static void
_gdk_display_x11_class_init (GdkDisplayX11Class * class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
@@ -2710,5 +2723,7 @@ _gdk_display_x11_class_init (GdkDisplayX11Class * class)
display_class->after_process_all_updates = _gdk_x11_display_after_process_all_updates;
display_class->get_next_serial = gdk_x11_display_get_next_serial;
display_class->notify_startup_complete = gdk_x11_display_notify_startup_complete;
+ display_class->event_data_copy = gdk_x11_display_event_data_copy;
+ display_class->event_data_free = gdk_x11_display_event_data_free;
}
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 6424aab..31a08d4 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -595,14 +595,3 @@ gdk_x11_get_default_xdisplay (void)
{
return GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
}
-
-void
-_gdk_windowing_event_data_copy (const GdkEvent *src,
- GdkEvent *dst)
-{
-}
-
-void
-_gdk_windowing_event_data_free (GdkEvent *event)
-{
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]