1 | /* |
2 | * Copyright (C) 2017 Benjamin Otte <otte@gnome.org> |
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, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | #ifndef __GDK_CLIPBOARD_PRIVATE_H__ |
19 | #define __GDK_CLIPBOARD_PRIVATE_H__ |
20 | |
21 | #include <gdk/gdkclipboard.h> |
22 | |
23 | G_BEGIN_DECLS |
24 | |
25 | #define GDK_CLIPBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_CLIPBOARD, GdkClipboardClass)) |
26 | #define GDK_IS_CLIPBOARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_CLIPBOARD)) |
27 | #define GDK_CLIPBOARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_CLIPBOARD, GdkClipboardClass)) |
28 | |
29 | typedef struct _GdkClipboardClass GdkClipboardClass; |
30 | |
31 | struct _GdkClipboard |
32 | { |
33 | GObject parent; |
34 | }; |
35 | |
36 | struct _GdkClipboardClass |
37 | { |
38 | GObjectClass parent_class; |
39 | |
40 | /* signals */ |
41 | void (* changed) (GdkClipboard *clipboard); |
42 | |
43 | /* vfuncs */ |
44 | gboolean (* claim) (GdkClipboard *clipboard, |
45 | GdkContentFormats *formats, |
46 | gboolean local, |
47 | GdkContentProvider *content); |
48 | void (* store_async) (GdkClipboard *clipboard, |
49 | int io_priority, |
50 | GCancellable *cancellable, |
51 | GAsyncReadyCallback callback, |
52 | gpointer user_data); |
53 | gboolean (* store_finish) (GdkClipboard *clipboard, |
54 | GAsyncResult *result, |
55 | GError **error); |
56 | void (* read_async) (GdkClipboard *clipboard, |
57 | GdkContentFormats *formats, |
58 | int io_priority, |
59 | GCancellable *cancellable, |
60 | GAsyncReadyCallback callback, |
61 | gpointer user_data); |
62 | GInputStream * (* read_finish) (GdkClipboard *clipboard, |
63 | GAsyncResult *result, |
64 | const char **out_mime_type, |
65 | GError **error); |
66 | }; |
67 | |
68 | GdkClipboard * gdk_clipboard_new (GdkDisplay *display); |
69 | |
70 | void gdk_clipboard_claim_remote (GdkClipboard *clipboard, |
71 | GdkContentFormats *formats); |
72 | void gdk_clipboard_write_async (GdkClipboard *clipboard, |
73 | const char *mime_type, |
74 | GOutputStream *stream, |
75 | int io_priority, |
76 | GCancellable *cancellable, |
77 | GAsyncReadyCallback callback, |
78 | gpointer user_data); |
79 | gboolean gdk_clipboard_write_finish (GdkClipboard *clipboard, |
80 | GAsyncResult *result, |
81 | GError **error); |
82 | |
83 | G_END_DECLS |
84 | |
85 | #endif /* __GDK_CLIPBOARD_PRIVATE_H__ */ |
86 | |