Add vfuncs for _gdk_windowing_event_data_{copy,free}

This commit is contained in:
Matthias Clasen 2010-12-15 00:37:40 -05:00
parent 968668629b
commit 39a71b8831
5 changed files with 47 additions and 14 deletions

View File

@ -2502,3 +2502,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);
}

View File

@ -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,
@ -224,6 +229,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

View File

@ -571,7 +571,8 @@ 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);

View File

@ -2667,6 +2667,19 @@ gdk_x11_set_sm_client_id (const gchar *sm_client_id)
g_slist_free (displays);
}
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)
{
@ -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;
}

View File

@ -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)
{
}