clipboard: Add get_default() helper
Add helper for getting the main clipboard. This makes the API usable for bindings (as GdkAtoms aren't usable through gobject-introspection), and easier to use in C. https://bugzilla.gnome.org/show_bug.cgi?id=712752
This commit is contained in:

committed by
Bastien Nocera

parent
46b10f1d92
commit
1442299b48
@ -6476,6 +6476,7 @@ GtkClipboardClearFunc
|
|||||||
gtk_clipboard_get
|
gtk_clipboard_get
|
||||||
gtk_clipboard_get_for_display
|
gtk_clipboard_get_for_display
|
||||||
gtk_clipboard_get_display
|
gtk_clipboard_get_display
|
||||||
|
gtk_clipboard_get_default
|
||||||
gtk_clipboard_set_with_data
|
gtk_clipboard_set_with_data
|
||||||
gtk_clipboard_set_with_owner
|
gtk_clipboard_set_with_owner
|
||||||
gtk_clipboard_get_owner
|
gtk_clipboard_get_owner
|
||||||
|
@ -378,6 +378,26 @@ gtk_clipboard_get (GdkAtom selection)
|
|||||||
return gtk_clipboard_get_for_display (gdk_display_get_default (), selection);
|
return gtk_clipboard_get_for_display (gdk_display_get_default (), selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gtk_clipboard_get_default:
|
||||||
|
* @display: the #GdkDisplay for which the clipboard is to be retrieved.
|
||||||
|
*
|
||||||
|
* Returns the default clipboard object for use with cut/copy/paste menu items
|
||||||
|
* and keyboard shortcuts.
|
||||||
|
*
|
||||||
|
* Return value: (transfer none): the default clipboard object.
|
||||||
|
*
|
||||||
|
* Since: 3.16
|
||||||
|
**/
|
||||||
|
GtkClipboard *
|
||||||
|
gtk_clipboard_get_default (GdkDisplay *display)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (display != NULL, NULL);
|
||||||
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||||
|
|
||||||
|
return gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
selection_get_cb (GtkWidget *widget,
|
selection_get_cb (GtkWidget *widget,
|
||||||
GtkSelectionData *selection_data,
|
GtkSelectionData *selection_data,
|
||||||
|
@ -189,6 +189,9 @@ GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay *display,
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GtkClipboard *gtk_clipboard_get (GdkAtom selection);
|
GtkClipboard *gtk_clipboard_get (GdkAtom selection);
|
||||||
|
|
||||||
|
GDK_AVAILABLE_IN_3_16
|
||||||
|
GtkClipboard *gtk_clipboard_get_default (GdkDisplay *display);
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GdkDisplay *gtk_clipboard_get_display (GtkClipboard *clipboard);
|
GdkDisplay *gtk_clipboard_get_display (GtkClipboard *clipboard);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user