mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
display: Remove leftover old clipboard APIs
This commit is contained in:
parent
5a0fb278d1
commit
5d70bbf4c4
@ -88,8 +88,6 @@ gdk_display_supports_cursor_alpha
|
||||
gdk_display_get_default_cursor_size
|
||||
gdk_display_get_maximal_cursor_size
|
||||
gdk_display_get_default_group
|
||||
gdk_display_supports_clipboard_persistence
|
||||
gdk_display_store_clipboard
|
||||
gdk_display_supports_shapes
|
||||
gdk_display_supports_input_shapes
|
||||
gdk_display_get_app_launch_context
|
||||
|
@ -358,21 +358,6 @@ gdk_broadway_display_notify_startup_complete (GdkDisplay *display,
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_broadway_display_supports_shapes (GdkDisplay *display)
|
||||
{
|
||||
@ -544,8 +529,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
|
||||
display_class->has_pending = gdk_broadway_display_has_pending;
|
||||
display_class->queue_events = _gdk_broadway_display_queue_events;
|
||||
display_class->get_default_group = gdk_broadway_display_get_default_group;
|
||||
display_class->supports_clipboard_persistence = gdk_broadway_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_broadway_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_broadway_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_broadway_display_supports_input_shapes;
|
||||
display_class->get_default_cursor_size = _gdk_broadway_display_get_default_cursor_size;
|
||||
|
@ -1183,56 +1183,6 @@ gdk_display_get_primary_clipboard (GdkDisplay *display)
|
||||
return display->primary_clipboard;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_supports_clipboard_persistence:
|
||||
* @display: a #GdkDisplay
|
||||
*
|
||||
* Returns whether the speicifed display supports clipboard
|
||||
* persistance; i.e. if it’s possible to store the clipboard data after an
|
||||
* application has quit. On X11 this checks if a clipboard daemon is
|
||||
* running.
|
||||
*
|
||||
* Returns: %TRUE if the display supports clipboard persistance.
|
||||
*
|
||||
* Since: 2.6
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return GDK_DISPLAY_GET_CLASS (display)->supports_clipboard_persistence (display);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_store_clipboard:
|
||||
* @display: a #GdkDisplay
|
||||
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
|
||||
* @time_: a timestamp
|
||||
* @targets: (array length=n_targets) (nullable): an array of targets
|
||||
* that should be saved, or %NULL
|
||||
* if all available targets should be saved.
|
||||
* @n_targets: length of the @targets array
|
||||
*
|
||||
* Issues a request to the clipboard manager to store the
|
||||
* clipboard data. On X11, this is a special program that works
|
||||
* according to the
|
||||
* [FreeDesktop Clipboard Specification](http://www.freedesktop.org/Standards/clipboard-manager-spec).
|
||||
*
|
||||
* Since: 2.6
|
||||
*/
|
||||
void
|
||||
gdk_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
GDK_DISPLAY_GET_CLASS (display)->store_clipboard (display, clipboard_window, time_, targets, n_targets);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_supports_shapes:
|
||||
* @display: a #GdkDisplay
|
||||
|
@ -97,14 +97,6 @@ GDK_AVAILABLE_IN_3_94
|
||||
GdkClipboard * gdk_display_get_clipboard (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_3_94
|
||||
GdkClipboard * gdk_display_get_primary_clipboard (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_display_supports_shapes (GdkDisplay *display);
|
||||
|
@ -131,13 +131,6 @@ struct _GdkDisplayClass
|
||||
gboolean (*supports_cursor_alpha) (GdkDisplay *display);
|
||||
gboolean (*supports_cursor_color) (GdkDisplay *display);
|
||||
|
||||
gboolean (*supports_clipboard_persistence) (GdkDisplay *display);
|
||||
void (*store_clipboard) (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets);
|
||||
|
||||
void (*get_default_cursor_size) (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height);
|
||||
|
@ -382,12 +382,6 @@ gdk_mir_display_supports_input_shapes (GdkDisplay *display)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_mir_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
{
|
||||
@ -400,15 +394,6 @@ gdk_mir_display_supports_cursor_color (GdkDisplay *display)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_mir_display_get_default_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
@ -827,10 +812,8 @@ gdk_mir_display_class_init (GdkMirDisplayClass *klass)
|
||||
display_class->get_default_group = gdk_mir_display_get_default_group;
|
||||
display_class->supports_shapes = gdk_mir_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_mir_display_supports_input_shapes;
|
||||
display_class->supports_clipboard_persistence = gdk_mir_display_supports_clipboard_persistence;
|
||||
display_class->supports_cursor_alpha = gdk_mir_display_supports_cursor_alpha;
|
||||
display_class->supports_cursor_color = gdk_mir_display_supports_cursor_color;
|
||||
display_class->store_clipboard = gdk_mir_display_store_clipboard;
|
||||
display_class->get_default_cursor_size = gdk_mir_display_get_default_cursor_size;
|
||||
display_class->get_maximal_cursor_size = gdk_mir_display_get_maximal_cursor_size;
|
||||
display_class->get_app_launch_context = gdk_mir_display_get_app_launch_context;
|
||||
|
@ -111,13 +111,6 @@ gdk_quartz_display_flush (GdkDisplay *display)
|
||||
/* Not supported. */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_quartz_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
/* FIXME: Implement */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_quartz_display_supports_shapes (GdkDisplay *display)
|
||||
{
|
||||
@ -132,16 +125,6 @@ gdk_quartz_display_supports_input_shapes (GdkDisplay *display)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_quartz_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
/* FIXME: Implement */
|
||||
}
|
||||
|
||||
static gulong
|
||||
gdk_quartz_display_get_next_serial (GdkDisplay *display)
|
||||
{
|
||||
@ -241,8 +224,6 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
|
||||
display_class->queue_events = _gdk_quartz_display_queue_events;
|
||||
display_class->has_pending = _gdk_quartz_display_has_pending;
|
||||
display_class->get_default_group = gdk_quartz_display_get_default_group;
|
||||
display_class->supports_clipboard_persistence = gdk_quartz_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_quartz_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_quartz_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_quartz_display_supports_input_shapes;
|
||||
display_class->get_default_cursor_size = _gdk_quartz_display_get_default_cursor_size;
|
||||
|
@ -810,21 +810,6 @@ gdk_wayland_display_get_default_group (GdkDisplay *display)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_display_supports_shapes (GdkDisplay *display)
|
||||
{
|
||||
@ -989,8 +974,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
|
||||
display_class->has_pending = gdk_wayland_display_has_pending;
|
||||
display_class->queue_events = _gdk_wayland_display_queue_events;
|
||||
display_class->get_default_group = gdk_wayland_display_get_default_group;
|
||||
display_class->supports_clipboard_persistence = gdk_wayland_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_wayland_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_wayland_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_wayland_display_supports_input_shapes;
|
||||
display_class->get_app_launch_context = _gdk_wayland_display_get_app_launch_context;
|
||||
|
@ -678,35 +678,6 @@ failed:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_win32_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
GdkEvent tmp_event;
|
||||
SendMessage (GDK_WINDOW_HWND (clipboard_window), WM_RENDERALLFORMATS, 0, 0);
|
||||
|
||||
memset (&tmp_event, 0, sizeof (tmp_event));
|
||||
tmp_event.selection.type = GDK_SELECTION_NOTIFY;
|
||||
tmp_event.selection.window = clipboard_window;
|
||||
tmp_event.selection.send_event = FALSE;
|
||||
tmp_event.selection.selection = _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_CLIPBOARD_MANAGER);
|
||||
tmp_event.selection.target = 0;
|
||||
tmp_event.selection.property = NULL;
|
||||
tmp_event.selection.requestor = 0;
|
||||
tmp_event.selection.time = GDK_CURRENT_TIME;
|
||||
|
||||
gdk_event_put (&tmp_event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_win32_display_supports_shapes (GdkDisplay *display)
|
||||
{
|
||||
@ -1181,8 +1152,6 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
|
||||
display_class->queue_events = _gdk_win32_display_queue_events;
|
||||
display_class->get_default_group = gdk_win32_display_get_default_group;
|
||||
|
||||
display_class->supports_clipboard_persistence = gdk_win32_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_win32_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_win32_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_win32_display_supports_input_shapes;
|
||||
|
||||
|
@ -2381,63 +2381,6 @@ gdk_x11_display_request_selection_notification (GdkDisplay *display,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_x11_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
{
|
||||
Atom clipboard_manager;
|
||||
|
||||
/* It might make sense to cache this */
|
||||
clipboard_manager = gdk_x11_get_xatom_by_name_for_display (display, "CLIPBOARD_MANAGER");
|
||||
return XGetSelectionOwner (GDK_X11_DISPLAY (display)->xdisplay, clipboard_manager) != None;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_display_store_clipboard (GdkDisplay *display,
|
||||
GdkWindow *clipboard_window,
|
||||
guint32 time_,
|
||||
const GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
Atom clipboard_manager, save_targets;
|
||||
|
||||
g_return_if_fail (GDK_WINDOW_IS_X11 (clipboard_window));
|
||||
|
||||
clipboard_manager = gdk_x11_get_xatom_by_name_for_display (display, "CLIPBOARD_MANAGER");
|
||||
save_targets = gdk_x11_get_xatom_by_name_for_display (display, "SAVE_TARGETS");
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
if (XGetSelectionOwner (display_x11->xdisplay, clipboard_manager) != None)
|
||||
{
|
||||
Atom property_name = None;
|
||||
Atom *xatoms;
|
||||
int i;
|
||||
|
||||
if (n_targets > 0)
|
||||
{
|
||||
property_name = gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION");
|
||||
|
||||
xatoms = g_new (Atom, n_targets);
|
||||
for (i = 0; i < n_targets; i++)
|
||||
xatoms[i] = gdk_x11_atom_to_xatom_for_display (display, targets[i]);
|
||||
|
||||
XChangeProperty (display_x11->xdisplay, GDK_WINDOW_XID (clipboard_window),
|
||||
property_name, XA_ATOM,
|
||||
32, PropModeReplace, (guchar *)xatoms, n_targets);
|
||||
g_free (xatoms);
|
||||
|
||||
}
|
||||
|
||||
XConvertSelection (display_x11->xdisplay,
|
||||
clipboard_manager, save_targets, property_name,
|
||||
GDK_WINDOW_XID (clipboard_window), time_);
|
||||
|
||||
}
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_display_get_user_time:
|
||||
* @display: (type GdkX11Display): a #GdkDisplay
|
||||
@ -3127,8 +3070,6 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
|
||||
display_class->has_pending = gdk_x11_display_has_pending;
|
||||
display_class->queue_events = _gdk_x11_display_queue_events;
|
||||
display_class->get_default_group = gdk_x11_display_get_default_group;
|
||||
display_class->supports_clipboard_persistence = gdk_x11_display_supports_clipboard_persistence;
|
||||
display_class->store_clipboard = gdk_x11_display_store_clipboard;
|
||||
display_class->supports_shapes = gdk_x11_display_supports_shapes;
|
||||
display_class->supports_input_shapes = gdk_x11_display_supports_input_shapes;
|
||||
display_class->get_app_launch_context = _gdk_x11_display_get_app_launch_context;
|
||||
|
Loading…
Reference in New Issue
Block a user