Add a vfunc for gdk_selection_convert
This commit is contained in:
@ -208,12 +208,17 @@ struct _GdkDisplayClass
|
|||||||
GdkAtom selection,
|
GdkAtom selection,
|
||||||
GdkAtom target,
|
GdkAtom target,
|
||||||
GdkAtom property,
|
GdkAtom property,
|
||||||
guint32 time_);
|
guint32 time);
|
||||||
gint (*get_selection_property) (GdkDisplay *display,
|
gint (*get_selection_property) (GdkDisplay *display,
|
||||||
GdkWindow *requestor,
|
GdkWindow *requestor,
|
||||||
guchar **data,
|
guchar **data,
|
||||||
GdkAtom *type,
|
GdkAtom *type,
|
||||||
gint *format);
|
gint *format);
|
||||||
|
void (*convert_selection) (GdkDisplay *display,
|
||||||
|
GdkWindow *requestor,
|
||||||
|
GdkAtom selection,
|
||||||
|
GdkAtom target,
|
||||||
|
guint32 time);
|
||||||
|
|
||||||
/* Signals */
|
/* Signals */
|
||||||
void (*closed) (GdkDisplay *display,
|
void (*closed) (GdkDisplay *display,
|
||||||
|
@ -370,3 +370,19 @@ gdk_selection_property_get (GdkWindow *requestor,
|
|||||||
return GDK_DISPLAY_GET_CLASS (display)
|
return GDK_DISPLAY_GET_CLASS (display)
|
||||||
->get_selection_property (display, requestor, data, ret_type, ret_format);
|
->get_selection_property (display, requestor, data, ret_type, ret_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_selection_convert (GdkWindow *requestor,
|
||||||
|
GdkAtom selection,
|
||||||
|
GdkAtom target,
|
||||||
|
guint32 time)
|
||||||
|
{
|
||||||
|
GdkDisplay *display;
|
||||||
|
|
||||||
|
g_return_if_fail (selection != GDK_NONE);
|
||||||
|
|
||||||
|
display = gdk_window_get_display (requestor);
|
||||||
|
|
||||||
|
GDK_DISPLAY_GET_CLASS (display)
|
||||||
|
->convert_selection (display, requestor, selection, target, time);
|
||||||
|
}
|
||||||
|
@ -2764,4 +2764,5 @@ _gdk_display_x11_class_init (GdkDisplayX11Class * class)
|
|||||||
display_class->set_selection_owner = _gdk_x11_display_set_selection_owner;
|
display_class->set_selection_owner = _gdk_x11_display_set_selection_owner;
|
||||||
display_class->send_selection_notify = _gdk_x11_display_send_selection_notify;
|
display_class->send_selection_notify = _gdk_x11_display_send_selection_notify;
|
||||||
display_class->get_selection_property = _gdk_x11_display_get_selection_property;
|
display_class->get_selection_property = _gdk_x11_display_get_selection_property;
|
||||||
|
display_class->convert_selection = _gdk_x11_display_convert_selection;
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,11 @@ gint _gdk_x11_display_get_selection_property (GdkDisplay *display,
|
|||||||
guchar **data,
|
guchar **data,
|
||||||
GdkAtom *ret_type,
|
GdkAtom *ret_type,
|
||||||
gint *ret_format);
|
gint *ret_format);
|
||||||
|
void _gdk_x11_display_convert_selection (GdkDisplay *display,
|
||||||
|
GdkWindow *requestor,
|
||||||
|
GdkAtom selection,
|
||||||
|
GdkAtom target,
|
||||||
|
guint32 time);
|
||||||
|
|
||||||
void _gdk_x11_device_check_extension_events (GdkDevice *device);
|
void _gdk_x11_device_check_extension_events (GdkDevice *device);
|
||||||
|
|
||||||
|
@ -182,20 +182,18 @@ _gdk_x11_display_get_selection_owner (GdkDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_selection_convert (GdkWindow *requestor,
|
_gdk_x11_display_convert_selection (GdkDisplay *display,
|
||||||
GdkAtom selection,
|
GdkWindow *requestor,
|
||||||
GdkAtom target,
|
GdkAtom selection,
|
||||||
guint32 time)
|
GdkAtom target,
|
||||||
|
guint32 time)
|
||||||
{
|
{
|
||||||
GdkDisplay *display;
|
|
||||||
|
|
||||||
g_return_if_fail (selection != GDK_NONE);
|
g_return_if_fail (selection != GDK_NONE);
|
||||||
|
|
||||||
if (GDK_WINDOW_DESTROYED (requestor) || !GDK_WINDOW_IS_X11 (requestor))
|
if (GDK_WINDOW_DESTROYED (requestor) || !GDK_WINDOW_IS_X11 (requestor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gdk_window_ensure_native (requestor);
|
gdk_window_ensure_native (requestor);
|
||||||
display = GDK_WINDOW_DISPLAY (requestor);
|
|
||||||
|
|
||||||
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor),
|
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor),
|
||||||
gdk_x11_atom_to_xatom_for_display (display, selection),
|
gdk_x11_atom_to_xatom_for_display (display, selection),
|
||||||
|
Reference in New Issue
Block a user