1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2000 Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Global clipboard abstraction.
22 #ifndef __GTK_CLIPBOARD_H__
23 #define __GTK_CLIPBOARD_H__
27 #endif /* __cplusplus */
29 #include <gtk/gtkselection.h>
31 #define GTK_TYPE_CLIPBOARD (gtk_clipboard_get_type ())
32 #define GTK_CLIPBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIPBOARD, GtkClipboard))
33 #define GTK_IS_CLIPBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CLIPBOARD))
35 typedef void (* GtkClipboardReceivedFunc) (GtkClipboard *clipboard,
36 GtkSelectionData *selection_data,
38 typedef void (* GtkClipboardTextReceivedFunc) (GtkClipboard *clipboard,
41 typedef void (* GtkClipboardTargetsReceivedFunc) (GtkClipboard *clipboard,
46 /* Should these functions have GtkClipboard *clipboard as the first argument?
47 * right now for ClearFunc, you may have trouble determining _which_ clipboard
48 * was cleared, if you reuse your ClearFunc for multiple clipboards.
50 typedef void (* GtkClipboardGetFunc) (GtkClipboard *clipboard,
51 GtkSelectionData *selection_data,
53 gpointer user_data_or_owner);
54 typedef void (* GtkClipboardClearFunc) (GtkClipboard *clipboard,
55 gpointer user_data_or_owner);
57 GType gtk_clipboard_get_type (void);
59 GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay *display,
61 #ifndef GDK_MULTIHEAD_SAFE
62 GtkClipboard *gtk_clipboard_get (GdkAtom selection);
65 GdkDisplay *gtk_clipboard_get_display (GtkClipboard *clipboard);
68 gboolean gtk_clipboard_set_with_data (GtkClipboard *clipboard,
69 const GtkTargetEntry *targets,
71 GtkClipboardGetFunc get_func,
72 GtkClipboardClearFunc clear_func,
74 gboolean gtk_clipboard_set_with_owner (GtkClipboard *clipboard,
75 const GtkTargetEntry *targets,
77 GtkClipboardGetFunc get_func,
78 GtkClipboardClearFunc clear_func,
80 GObject *gtk_clipboard_get_owner (GtkClipboard *clipboard);
81 void gtk_clipboard_clear (GtkClipboard *clipboard);
82 void gtk_clipboard_set_text (GtkClipboard *clipboard,
86 void gtk_clipboard_request_contents (GtkClipboard *clipboard,
88 GtkClipboardReceivedFunc callback,
90 void gtk_clipboard_request_text (GtkClipboard *clipboard,
91 GtkClipboardTextReceivedFunc callback,
93 void gtk_clipboard_request_targets (GtkClipboard *clipboard,
94 GtkClipboardTargetsReceivedFunc callback,
97 GtkSelectionData *gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
99 gchar * gtk_clipboard_wait_for_text (GtkClipboard *clipboard);
101 gboolean gtk_clipboard_wait_is_text_available (GtkClipboard *clipboard);
103 gboolean gtk_clipboard_wait_for_targets (GtkClipboard *clipboard,
109 #endif /* __cplusplus */
111 #endif /* __GTK_CLIPBOARD_H__ */