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,
42 /* Should these functions have GtkClipboard *clipboard as the first argument?
43 * right now for ClearFunc, you may have trouble determining _which_ clipboard
44 * was cleared, if you reuse your ClearFunc for multiple clipboards.
46 typedef void (* GtkClipboardGetFunc) (GtkClipboard *clipboard,
47 GtkSelectionData *selection_data,
49 gpointer user_data_or_owner);
50 typedef void (* GtkClipboardClearFunc) (GtkClipboard *clipboard,
51 gpointer user_data_or_owner);
53 GType gtk_clipboard_get_type (void);
55 GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay *display,
57 #ifndef GDK_MULTIHEAD_SAFE
58 GtkClipboard *gtk_clipboard_get (GdkAtom selection);
61 GdkDisplay *gtk_clipboard_get_display (GtkClipboard *clipboard);
64 gboolean gtk_clipboard_set_with_data (GtkClipboard *clipboard,
65 const GtkTargetEntry *targets,
67 GtkClipboardGetFunc get_func,
68 GtkClipboardClearFunc clear_func,
70 gboolean gtk_clipboard_set_with_owner (GtkClipboard *clipboard,
71 const GtkTargetEntry *targets,
73 GtkClipboardGetFunc get_func,
74 GtkClipboardClearFunc clear_func,
76 GObject *gtk_clipboard_get_owner (GtkClipboard *clipboard);
77 void gtk_clipboard_clear (GtkClipboard *clipboard);
78 void gtk_clipboard_set_text (GtkClipboard *clipboard,
82 void gtk_clipboard_request_contents (GtkClipboard *clipboard,
84 GtkClipboardReceivedFunc callback,
86 void gtk_clipboard_request_text (GtkClipboard *clipboard,
87 GtkClipboardTextReceivedFunc callback,
90 GtkSelectionData *gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
92 gchar * gtk_clipboard_wait_for_text (GtkClipboard *clipboard);
94 gboolean gtk_clipboard_wait_is_text_available (GtkClipboard *clipboard);
98 #endif /* __cplusplus */
100 #endif /* __GTK_CLIPBOARD_H__ */