]> Pileus Git - ~andy/gtk/blob - gtk/gtkclipboard.h
Remove check for winsock.h since it might show up on Linux+Wine. Instead
[~andy/gtk] / gtk / gtkclipboard.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2000 Red Hat, Inc.
3  *
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.
8  *
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.
13  *
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.
18  *
19  * Global clipboard abstraction. 
20  */
21
22 #ifndef __GTK_CLIPBOARD_H__
23 #define __GTK_CLIPBOARD_H__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 #include <gtk/gtkselection.h>
30
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))
34
35 typedef void (* GtkClipboardReceivedFunc)        (GtkClipboard     *clipboard,
36                                                   GtkSelectionData *selection_data,
37                                                   gpointer          data);
38 typedef void (* GtkClipboardTextReceivedFunc)    (GtkClipboard     *clipboard,
39                                                   const gchar      *text,
40                                                   gpointer          data);
41
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.
45  */
46 typedef void (* GtkClipboardGetFunc)          (GtkClipboard     *clipboard,
47                                                GtkSelectionData *selection_data,
48                                                guint             info,
49                                                gpointer          user_data_or_owner);
50 typedef void (* GtkClipboardClearFunc)        (GtkClipboard     *clipboard,
51                                                gpointer          user_data_or_owner);
52
53 GType         gtk_clipboard_get_type (void);
54
55 GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay   *display,
56                                              GdkAtom       selection);
57 #ifndef GDK_MULTIHEAD_SAFE
58 GtkClipboard *gtk_clipboard_get             (GdkAtom       selection);
59 #endif
60
61 GdkDisplay   *gtk_clipboard_get_display     (GtkClipboard *clipboard);
62
63
64 gboolean gtk_clipboard_set_with_data  (GtkClipboard          *clipboard,
65                                        const GtkTargetEntry  *targets,
66                                        guint                  n_targets,
67                                        GtkClipboardGetFunc    get_func,
68                                        GtkClipboardClearFunc  clear_func,
69                                        gpointer               user_data);
70 gboolean gtk_clipboard_set_with_owner (GtkClipboard          *clipboard,
71                                        const GtkTargetEntry  *targets,
72                                        guint                  n_targets,
73                                        GtkClipboardGetFunc    get_func,
74                                        GtkClipboardClearFunc  clear_func,
75                                        GObject               *owner);
76 GObject *gtk_clipboard_get_owner      (GtkClipboard          *clipboard);
77 void     gtk_clipboard_clear          (GtkClipboard          *clipboard);
78 void     gtk_clipboard_set_text       (GtkClipboard          *clipboard,
79                                        const gchar           *text,
80                                        gint                   len);
81
82 void gtk_clipboard_request_contents (GtkClipboard                    *clipboard,
83                                      GdkAtom                          target,
84                                      GtkClipboardReceivedFunc         callback,
85                                      gpointer                         user_data);
86 void gtk_clipboard_request_text     (GtkClipboard                    *clipboard,
87                                      GtkClipboardTextReceivedFunc     callback,
88                                      gpointer                         user_data);
89
90 GtkSelectionData *gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
91                                                    GdkAtom       target);
92 gchar *           gtk_clipboard_wait_for_text     (GtkClipboard *clipboard);
93
94 gboolean gtk_clipboard_wait_is_text_available   (GtkClipboard         *clipboard);
95
96 #ifdef __cplusplus
97 }
98 #endif /* __cplusplus */
99
100 #endif /* __GTK_CLIPBOARD_H__ */