| 1 | /* GDK - The GIMP Drawing Kit |
| 2 | * |
| 3 | * Copyright (C) 2017 Benjamin Otte <[email protected]> |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 20 | |
| 21 | #include "gdkclipboardprivate.h"cxx . . $ `<file>/gdk/gdkclipboardprivate.h`/ |
| 22 | |
| 23 | #include "gdkcontentdeserializer.h"cxx . . $ `<file>/gdk/gdkcontentdeserializer.h`/ |
| 24 | #include "gdkcontentformats.h"cxx . . $ `<file>/gdk/gdkcontentformats.h`/ |
| 25 | #include "gdkcontentproviderimpl.h"cxx . . $ `<file>/gdk/gdkcontentproviderimpl.h`/ |
| 26 | #include "gdkcontentproviderprivate.h"cxx . . $ `<file>/gdk/gdkcontentproviderprivate.h`/ |
| 27 | #include "gdkcontentserializer.h"cxx . . $ `<file>/gdk/gdkcontentserializer.h`/ |
| 28 | #include "gdkdisplay.h"cxx . . $ `<file>/gdk/gdkdisplay.h`/ |
| 29 | #include <glib/gi18n-lib.h> |
| 30 | #include "gdkpipeiostreamprivate.h"cxx . . $ `<file>/gdk/gdkpipeiostreamprivate.h`/ |
| 31 | #include "gdktexture.h"cxx . . $ `<file>/gdk/gdktexture.h`/ |
| 32 | #include "gdkprivate.h"cxx . . $ `<file>/gdk/gdkprivate.h`/ |
| 33 | |
| 34 | #include <gobject/gvaluecollector.h> |
| 35 | |
| 36 | /** |
| 37 | * GdkClipboard: |
| 38 | * |
| 39 | * Represents data shared between applications or inside an application. |
| 40 | * |
| 41 | * To get a `GdkClipboard` object, use [[email protected]_clipboard] or |
| 42 | * [[email protected]_primary_clipboard]. You can find out about the data |
| 43 | * that is currently available in a clipboard using |
| 44 | * [[email protected]_formats]. |
| 45 | * |
| 46 | * To make text or image data available in a clipboard, use |
| 47 | * [[email protected]_text] or [[email protected]_texture]. |
| 48 | * For other data, you can use [[email protected]_content], which |
| 49 | * takes a [[email protected]] object. |
| 50 | * |
| 51 | * To read textual or image data from a clipboard, use |
| 52 | * [[email protected]_text_async] or |
| 53 | * [[email protected]_texture_async]. For other data, use |
| 54 | * [[email protected]_async], which provides a `GInputStream` object. |
| 55 | */ |
| 56 | |
| 57 | typedef struct _GdkClipboardPrivatecxx . . $ _GdkClipboardPrivate# GdkClipboardPrivatecxx . . $ GdkClipboardPrivate#; |
| 58 | |
| 59 | struct _GdkClipboardPrivatecxx . . $ _GdkClipboardPrivate# |
| 60 | { |
| 61 | GdkDisplaycxx . . $ GdkDisplay# *displaycxx . . $ _GdkClipboardPrivate#display.; |
| 62 | GdkContentFormatscxx . . $ GdkContentFormats# *formatscxx . . $ _GdkClipboardPrivate#formats.; |
| 63 | GdkContentProvidercxx . . $ GdkContentProvider# *contentcxx . . $ _GdkClipboardPrivate#content.; |
| 64 | |
| 65 | guintcxx . . $ guint# localcxx . . $ _GdkClipboardPrivate#local. : 1; |
| 66 | }; |
| 67 | |
| 68 | enumcxx . . $ $anonymous_type_762fb6fffbed04fb_0# { |
| 69 | PROP_0cxx . . $ PROP_0., |
| 70 | PROP_DISPLAYcxx . . $ PROP_DISPLAY., |
| 71 | PROP_FORMATScxx . . $ PROP_FORMATS., |
| 72 | PROP_LOCALcxx . . $ PROP_LOCAL., |
| 73 | PROP_CONTENTcxx . . $ PROP_CONTENT., |
| 74 | N_PROPERTIEScxx . . $ N_PROPERTIES. |
| 75 | }; |
| 76 | |
| 77 | enumcxx . . $ $anonymous_type_762fb6fffbed04fb_1# { |
| 78 | CHANGEDcxx . . $ CHANGED., |
| 79 | N_SIGNALScxx . . $ N_SIGNALS. |
| 80 | }; |
| 81 | |
| 82 | static GParamSpeccxx . . $ GParamSpec# *propertiescxx . . $ properties.[N_PROPERTIEScxx . . $ N_PROPERTIES.] = { NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, }; |
| 83 | static guintcxx . . $ guint# signalscxx . . $ signals.[N_SIGNALScxx . . $ N_SIGNALS.] = { 0 }; |
| 84 | |
| 85 | G_DEFINE_TYPE_WITH_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:1876:9`! (GdkClipboard, gdk_clipboard, G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!) |
| 86 | |
| 87 | static void |
| 88 | gdk_clipboard_set_propertycxx . . $ gdk_clipboard_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *gobject, |
| 89 | guintcxx . . $ guint# prop_id, |
| 90 | const GValuecxx . . $ GValue# *value, |
| 91 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 92 | { |
| 93 | GdkClipboardcxx . . $ GdkClipboard# *clipboard = GDK_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:30:9`! (gobject); |
| 94 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 95 | |
| 96 | switch (prop_id) |
| 97 | { |
| 98 | case PROP_DISPLAYcxx . . $ PROP_DISPLAY.: |
| 99 | priv->displaycxx . . $ _GdkClipboardPrivate#display. = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value); |
| 100 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (priv->display != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 101 | break; |
| 102 | |
| 103 | default: |
| 104 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (gobject, prop_id, pspec); |
| 105 | break; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | static void |
| 110 | gdk_clipboard_get_propertycxx . . $ gdk_clipboard_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *gobject, |
| 111 | guintcxx . . $ guint# prop_id, |
| 112 | GValuecxx . . $ GValue# *value, |
| 113 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 114 | { |
| 115 | GdkClipboardcxx . . $ GdkClipboard# *clipboard = GDK_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:30:9`! (gobject); |
| 116 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 117 | |
| 118 | switch (prop_id) |
| 119 | { |
| 120 | case PROP_DISPLAYcxx . . $ PROP_DISPLAY.: |
| 121 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, priv->displaycxx . . $ _GdkClipboardPrivate#display.); |
| 122 | break; |
| 123 | |
| 124 | case PROP_FORMATScxx . . $ PROP_FORMATS.: |
| 125 | g_value_set_boxedcxx . . $ g_value_set_boxed(806599f585dac18b). (value, priv->formatscxx . . $ _GdkClipboardPrivate#formats.); |
| 126 | break; |
| 127 | |
| 128 | case PROP_CONTENTcxx . . $ PROP_CONTENT.: |
| 129 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, priv->contentcxx . . $ _GdkClipboardPrivate#content.); |
| 130 | break; |
| 131 | |
| 132 | case PROP_LOCALcxx . . $ PROP_LOCAL.: |
| 133 | g_value_set_booleancxx . . $ g_value_set_boolean(b698c61e8e30c4ea). (value, priv->localcxx . . $ _GdkClipboardPrivate#local.); |
| 134 | break; |
| 135 | |
| 136 | default: |
| 137 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (gobject, prop_id, pspec); |
| 138 | break; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | static void |
| 143 | gdk_clipboard_finalizecxx . . $ gdk_clipboard_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 144 | { |
| 145 | GdkClipboardcxx . . $ GdkClipboard# *clipboard = GDK_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:30:9`! (object); |
| 146 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 147 | |
| 148 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&priv->formats, gdk_content_formats_unref); |
| 149 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&priv->content); |
| 150 | |
| 151 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gdk_clipboard_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 152 | } |
| 153 | |
| 154 | static void |
| 155 | gdk_clipboard_content_changed_cbcxx . . $ gdk_clipboard_content_changed_cb(199e2608edc99908). (GdkContentProvidercxx . . $ GdkContentProvider# *provider, |
| 156 | GdkClipboardcxx . . $ GdkClipboard# *clipboard); |
| 157 | |
| 158 | static gbooleancxx . . $ gboolean# |
| 159 | gdk_clipboard_real_claimcxx . . $ gdk_clipboard_real_claim(8e15d0f58b4da43b). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 160 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, |
| 161 | gbooleancxx . . $ gboolean# local, |
| 162 | GdkContentProvidercxx . . $ GdkContentProvider# *content) |
| 163 | { |
| 164 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 165 | |
| 166 | g_object_freeze_notifycxx . . $ g_object_freeze_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (clipboard)); |
| 167 | |
| 168 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (priv->formatscxx . . $ _GdkClipboardPrivate#formats.); |
| 169 | gdk_content_formats_refcxx . . $ gdk_content_formats_ref(f9c6e94556d0b4d1). (formats); |
| 170 | formats = gdk_content_formats_union_deserialize_gtypescxx . . $ gdk_content_formats_union_deserialize_gtypes(f9c6e94556d0b4d1). (formats); |
| 171 | priv->formatscxx . . $ _GdkClipboardPrivate#formats. = formats; |
| 172 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (clipboard), propertiescxx . . $ properties.[PROP_FORMATScxx . . $ PROP_FORMATS.]); |
| 173 | if (priv->localcxx . . $ _GdkClipboardPrivate#local. != local) |
| 174 | { |
| 175 | priv->localcxx . . $ _GdkClipboardPrivate#local. = local; |
| 176 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (clipboard), propertiescxx . . $ properties.[PROP_LOCALcxx . . $ PROP_LOCAL.]); |
| 177 | } |
| 178 | |
| 179 | if (priv->contentcxx . . $ _GdkClipboardPrivate#content. != content) |
| 180 | { |
| 181 | GdkContentProvidercxx . . $ GdkContentProvider# *old_content = priv->contentcxx . . $ _GdkClipboardPrivate#content.; |
| 182 | |
| 183 | if (content) |
| 184 | priv->contentcxx . . $ _GdkClipboardPrivate#content. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (content); |
| 185 | else |
| 186 | priv->contentcxx . . $ _GdkClipboardPrivate#content. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 187 | |
| 188 | if (old_content) |
| 189 | { |
| 190 | g_signal_handlers_disconnect_by_funccxx . . $ `<external>/15952772511652638895/gsignal.h:629:9`! (old_content, |
| 191 | gdk_clipboard_content_changed_cb, |
| 192 | clipboard); |
| 193 | gdk_content_provider_detach_clipboardcxx . . $ gdk_content_provider_detach_clipboard(199e2608edc99908). (old_content, clipboard); |
| 194 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (old_content); |
| 195 | } |
| 196 | if (content) |
| 197 | { |
| 198 | gdk_content_provider_attach_clipboardcxx . . $ gdk_content_provider_attach_clipboard(199e2608edc99908). (content, clipboard); |
| 199 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (content, |
| 200 | "content-changed", |
| 201 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (gdk_clipboard_content_changed_cb), |
| 202 | clipboard); |
| 203 | } |
| 204 | |
| 205 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (clipboard), propertiescxx . . $ properties.[PROP_CONTENTcxx . . $ PROP_CONTENT.]); |
| 206 | } |
| 207 | |
| 208 | g_object_thaw_notifycxx . . $ g_object_thaw_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (clipboard)); |
| 209 | |
| 210 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (clipboard, signalscxx . . $ signals.[CHANGEDcxx . . $ CHANGED.], 0); |
| 211 | |
| 212 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 213 | } |
| 214 | |
| 215 | static void |
| 216 | gdk_clipboard_store_default_asynccxx . . $ gdk_clipboard_store_default_async(1d7ec8c1da4c7345). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 217 | int io_priority, |
| 218 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 219 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 220 | gpointercxx . . $ gpointer# user_data) |
| 221 | { |
| 222 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 223 | GTaskcxx . . $ GTask# *task; |
| 224 | |
| 225 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (clipboard, cancellable, callback, user_data); |
| 226 | g_task_set_prioritycxx . . $ g_task_set_priority(b34b01b5a2b59ad8). (task, io_priority); |
| 227 | g_task_set_source_tagcxx . . $ `<external>/6581906438226475924/gtask.h:88:9`! (task, gdk_clipboard_store_default_async); |
| 228 | |
| 229 | if (priv->localcxx . . $ _GdkClipboardPrivate#local.) |
| 230 | { |
| 231 | g_task_return_new_errorcxx . . $ g_task_return_new_error(4e3bcb70db2a815a). (task, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_SUPPORTEDcxx . . $ G_IO_ERROR_NOT_SUPPORTED., |
| 232 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("This clipboard cannot store data.")); |
| 233 | } |
| 234 | else |
| 235 | { |
| 236 | g_task_return_booleancxx . . $ g_task_return_boolean(b34b01b5a2b59ad8). (task, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 237 | } |
| 238 | |
| 239 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 240 | } |
| 241 | |
| 242 | static gbooleancxx . . $ gboolean# |
| 243 | gdk_clipboard_store_default_finishcxx . . $ gdk_clipboard_store_default_finish(eb9a1ceaf80795ec). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 244 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 245 | GErrorcxx . . $ GError# **error) |
| 246 | { |
| 247 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_is_valid (result, clipboard), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 248 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_get_source_tag (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)) == gdk_clipboard_store_default_async, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 249 | |
| 250 | return g_task_propagate_booleancxx . . $ g_task_propagate_boolean(21d91baf98d56582). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result), error); |
| 251 | } |
| 252 | |
| 253 | static void |
| 254 | gdk_clipboard_read_local_write_donecxx . . $ gdk_clipboard_read_local_write_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *clipboard, |
| 255 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 256 | gpointercxx . . $ gpointer# stream) |
| 257 | { |
| 258 | /* we don't care about the error, we just want to clean up */ |
| 259 | gdk_clipboard_write_finishcxx . . $ gdk_clipboard_write_finish(eb9a1ceaf80795ec). (GDK_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:30:9`! (clipboard), result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 260 | |
| 261 | /* XXX: Do we need to close_async() here? */ |
| 262 | g_output_stream_closecxx . . $ g_output_stream_close(9a028ff89e05cae6). (stream, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 263 | |
| 264 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (stream); |
| 265 | } |
| 266 | |
| 267 | static void |
| 268 | gdk_clipboard_read_local_asynccxx . . $ gdk_clipboard_read_local_async(32a62d57c38bce9f). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 269 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, |
| 270 | int io_priority, |
| 271 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 272 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 273 | gpointercxx . . $ gpointer# user_data) |
| 274 | { |
| 275 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 276 | GdkContentFormatscxx . . $ GdkContentFormats# *content_formats; |
| 277 | const char *mime_type; |
| 278 | GTaskcxx . . $ GTask# *task; |
| 279 | |
| 280 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (clipboard, cancellable, callback, user_data); |
| 281 | g_task_set_prioritycxx . . $ g_task_set_priority(b34b01b5a2b59ad8). (task, io_priority); |
| 282 | g_task_set_source_tagcxx . . $ `<external>/6581906438226475924/gtask.h:88:9`! (task, gdk_clipboard_read_local_async); |
| 283 | |
| 284 | if (priv->contentcxx . . $ _GdkClipboardPrivate#content. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 285 | { |
| 286 | g_task_return_new_errorcxx . . $ g_task_return_new_error(4e3bcb70db2a815a). (task, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_FOUNDcxx . . $ G_IO_ERROR_NOT_FOUND., |
| 287 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Cannot read from empty clipboard.")); |
| 288 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | content_formats = gdk_content_provider_ref_formatscxx . . $ gdk_content_provider_ref_formats(653aea2a3e0e059b). (priv->contentcxx . . $ _GdkClipboardPrivate#content.); |
| 293 | content_formats = gdk_content_formats_union_serialize_mime_typescxx . . $ gdk_content_formats_union_serialize_mime_types(f9c6e94556d0b4d1). (content_formats); |
| 294 | mime_type = gdk_content_formats_match_mime_typecxx . . $ gdk_content_formats_match_mime_type(d45b1c9a41c05784). (formats, content_formats); |
| 295 | |
| 296 | if (mime_type != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 297 | { |
| 298 | GOutputStreamcxx . . $ GOutputStream# *output_stream; |
| 299 | GIOStreamcxx . . $ GIOStream# *stream; |
| 300 | |
| 301 | stream = gdk_pipe_io_stream_newcxx . . $ gdk_pipe_io_stream_new(4f34bcae3b644a7c). (); |
| 302 | output_stream = g_io_stream_get_output_streamcxx . . $ g_io_stream_get_output_stream(1b2ec85ecb137c25). (stream); |
| 303 | gdk_clipboard_write_asynccxx . . $ gdk_clipboard_write_async(d3c69ede4d8f94c2). (clipboard, |
| 304 | mime_type, |
| 305 | output_stream, |
| 306 | io_priority, |
| 307 | cancellable, |
| 308 | gdk_clipboard_read_local_write_donecxx . . $ gdk_clipboard_read_local_write_done(aa1d200d824d915d)., |
| 309 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (output_stream)); |
| 310 | g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, (gpointercxx . . $ gpointer#) mime_type, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 311 | g_task_return_pointercxx . . $ g_task_return_pointer(2e97a86ccb74176a). (task, g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (g_io_stream_get_input_stream (stream)), g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 312 | |
| 313 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (stream); |
| 314 | } |
| 315 | else |
| 316 | { |
| 317 | g_task_return_new_errorcxx . . $ g_task_return_new_error(4e3bcb70db2a815a). (task, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_SUPPORTEDcxx . . $ G_IO_ERROR_NOT_SUPPORTED., |
| 318 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("No compatible formats to transfer clipboard contents.")); |
| 319 | } |
| 320 | |
| 321 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (content_formats); |
| 322 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 323 | } |
| 324 | |
| 325 | static GInputStreamcxx . . $ GInputStream# * |
| 326 | gdk_clipboard_read_local_finishcxx . . $ gdk_clipboard_read_local_finish(c8639147c85a978e). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 327 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 328 | const char **out_mime_type, |
| 329 | GErrorcxx . . $ GError# **error) |
| 330 | { |
| 331 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_is_valid (result, clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 332 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_get_source_tag (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)) == gdk_clipboard_read_local_async, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 333 | |
| 334 | if (out_mime_type) |
| 335 | *out_mime_type = g_task_get_task_datacxx . . $ g_task_get_task_data(3075fc2989a57705). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)); |
| 336 | |
| 337 | return g_task_propagate_pointercxx . . $ g_task_propagate_pointer(472d3929f510ba3a). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result), error); |
| 338 | } |
| 339 | |
| 340 | static void |
| 341 | gdk_clipboard_class_initcxx . . $ gdk_clipboard_class_init(238fea234e0a73ea). (GdkClipboardClasscxx . . $ GdkClipboardClass# *class) |
| 342 | { |
| 343 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class); |
| 344 | |
| 345 | object_class->get_propertycxx . . $ _GObjectClass#get_property. = gdk_clipboard_get_propertycxx . . $ gdk_clipboard_get_property(cee2c52f22407c66).; |
| 346 | object_class->set_propertycxx . . $ _GObjectClass#set_property. = gdk_clipboard_set_propertycxx . . $ gdk_clipboard_set_property(d7c4bb29f36c0dc4).; |
| 347 | object_class->finalizecxx . . $ _GObjectClass#finalize. = gdk_clipboard_finalizecxx . . $ gdk_clipboard_finalize(6087475fa43034d3).; |
| 348 | |
| 349 | class->claimcxx . . $ _GdkClipboardClass#claim. = gdk_clipboard_real_claimcxx . . $ gdk_clipboard_real_claim(8e15d0f58b4da43b).; |
| 350 | class->store_asynccxx . . $ _GdkClipboardClass#store_async. = gdk_clipboard_store_default_asynccxx . . $ gdk_clipboard_store_default_async(1d7ec8c1da4c7345).; |
| 351 | class->store_finishcxx . . $ _GdkClipboardClass#store_finish. = gdk_clipboard_store_default_finishcxx . . $ gdk_clipboard_store_default_finish(eb9a1ceaf80795ec).; |
| 352 | class->read_asynccxx . . $ _GdkClipboardClass#read_async. = gdk_clipboard_read_local_asynccxx . . $ gdk_clipboard_read_local_async(32a62d57c38bce9f).; |
| 353 | class->read_finishcxx . . $ _GdkClipboardClass#read_finish. = gdk_clipboard_read_local_finishcxx . . $ gdk_clipboard_read_local_finish(c8639147c85a978e).; |
| 354 | |
| 355 | /** |
| 356 | * GdkClipboard:display: |
| 357 | * |
| 358 | * The `GdkDisplay` that the clipboard belongs to. |
| 359 | */ |
| 360 | propertiescxx . . $ properties.[PROP_DISPLAYcxx . . $ PROP_DISPLAY.] = |
| 361 | g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("display", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 362 | GDK_TYPE_DISPLAYcxx . . $ `gdk/gdkdisplay.h:35:9`!, |
| 363 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | |
| 364 | G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. | |
| 365 | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`! | |
| 366 | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 367 | |
| 368 | /** |
| 369 | * GdkClipboard:formats: |
| 370 | * |
| 371 | * The possible formats that the clipboard can provide its data in. |
| 372 | */ |
| 373 | propertiescxx . . $ properties.[PROP_FORMATScxx . . $ PROP_FORMATS.] = |
| 374 | g_param_spec_boxedcxx . . $ g_param_spec_boxed(faf99966f027a127). ("formats", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 375 | GDK_TYPE_CONTENT_FORMATScxx . . $ `gdk/gdkcontentformats.h:28:9`!, |
| 376 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | |
| 377 | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`! | |
| 378 | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 379 | |
| 380 | /** |
| 381 | * GdkClipboard:local: (getter is_local) |
| 382 | * |
| 383 | * %TRUE if the contents of the clipboard are owned by this process. |
| 384 | */ |
| 385 | propertiescxx . . $ properties.[PROP_LOCALcxx . . $ PROP_LOCAL.] = |
| 386 | g_param_spec_booleancxx . . $ g_param_spec_boolean(315d86b79c0116e0). ("local", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 387 | TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, |
| 388 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | |
| 389 | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`! | |
| 390 | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 391 | |
| 392 | /** |
| 393 | * GdkClipboard:content: |
| 394 | * |
| 395 | * The `GdkContentProvider` or %NULL if the clipboard is empty or contents are |
| 396 | * provided otherwise. |
| 397 | */ |
| 398 | propertiescxx . . $ properties.[PROP_CONTENTcxx . . $ PROP_CONTENT.] = |
| 399 | g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("content", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 400 | GDK_TYPE_CONTENT_PROVIDERcxx . . $ `gdk/gdkcontentprovider.h:29:9`!, |
| 401 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | |
| 402 | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`! | |
| 403 | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 404 | |
| 405 | /** |
| 406 | * GdkClipboard::changed: |
| 407 | * @clipboard: the object on which the signal was emitted |
| 408 | * |
| 409 | * Emitted when the clipboard changes ownership. |
| 410 | */ |
| 411 | signalscxx . . $ signals.[CHANGEDcxx . . $ CHANGED.] = |
| 412 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("changed"), |
| 413 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (class), |
| 414 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 415 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GdkClipboardClass, changed), |
| 416 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 417 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 0); |
| 418 | |
| 419 | g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (object_class, N_PROPERTIEScxx . . $ N_PROPERTIES., propertiescxx . . $ properties.); |
| 420 | } |
| 421 | |
| 422 | static void |
| 423 | gdk_clipboard_initcxx . . $ gdk_clipboard_init(df6fff2f911c0978). (GdkClipboardcxx . . $ GdkClipboard# *clipboard) |
| 424 | { |
| 425 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 426 | |
| 427 | priv->formatscxx . . $ _GdkClipboardPrivate#formats. = gdk_content_formats_newcxx . . $ gdk_content_formats_new(97755e6c06de7b31). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0); |
| 428 | priv->localcxx . . $ _GdkClipboardPrivate#local. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 429 | } |
| 430 | |
| 431 | /** |
| 432 | * gdk_clipboard_get_display: |
| 433 | * @clipboard: a `GdkClipboard` |
| 434 | * |
| 435 | * Gets the `GdkDisplay` that the clipboard was created for. |
| 436 | * |
| 437 | * Returns: (transfer none): a `GdkDisplay` |
| 438 | */ |
| 439 | GdkDisplaycxx . . $ GdkDisplay# * |
| 440 | gdk_clipboard_get_displaycxx . . $ gdk_clipboard_get_display(96db9410425d4e5b). (GdkClipboardcxx . . $ GdkClipboard# *clipboard) |
| 441 | { |
| 442 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 443 | |
| 444 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 445 | |
| 446 | return priv->displaycxx . . $ _GdkClipboardPrivate#display.; |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * gdk_clipboard_get_formats: |
| 451 | * @clipboard: a `GdkClipboard` |
| 452 | * |
| 453 | * Gets the formats that the clipboard can provide its current contents in. |
| 454 | * |
| 455 | * Returns: (transfer none): The formats of the clipboard |
| 456 | */ |
| 457 | GdkContentFormatscxx . . $ GdkContentFormats# * |
| 458 | gdk_clipboard_get_formatscxx . . $ gdk_clipboard_get_formats(cdb13c78b99f48d7). (GdkClipboardcxx . . $ GdkClipboard# *clipboard) |
| 459 | { |
| 460 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 461 | |
| 462 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 463 | |
| 464 | return priv->formatscxx . . $ _GdkClipboardPrivate#formats.; |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * gdk_clipboard_is_local: (get-property local) |
| 469 | * @clipboard: a `GdkClipboard` |
| 470 | * |
| 471 | * Returns if the clipboard is local. |
| 472 | * |
| 473 | * A clipboard is considered local if it was last claimed |
| 474 | * by the running application. |
| 475 | * |
| 476 | * Note that [[email protected]_content] may return %NULL |
| 477 | * even on a local clipboard. In this case the clipboard is empty. |
| 478 | * |
| 479 | * Returns: %TRUE if the clipboard is local |
| 480 | */ |
| 481 | gbooleancxx . . $ gboolean# |
| 482 | gdk_clipboard_is_localcxx . . $ gdk_clipboard_is_local(fc1d9ac03bb32060). (GdkClipboardcxx . . $ GdkClipboard# *clipboard) |
| 483 | { |
| 484 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 485 | |
| 486 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 487 | |
| 488 | return priv->localcxx . . $ _GdkClipboardPrivate#local.; |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * gdk_clipboard_get_content: |
| 493 | * @clipboard: a `GdkClipboard` |
| 494 | * |
| 495 | * Returns the `GdkContentProvider` currently set on @clipboard. |
| 496 | * |
| 497 | * If the @clipboard is empty or its contents are not owned by the |
| 498 | * current process, %NULL will be returned. |
| 499 | * |
| 500 | * Returns: (transfer none) (nullable): The content of a clipboard |
| 501 | * if the clipboard does not maintain any content |
| 502 | */ |
| 503 | GdkContentProvidercxx . . $ GdkContentProvider# * |
| 504 | gdk_clipboard_get_contentcxx . . $ gdk_clipboard_get_content(f1f7a1fe02e36ae1). (GdkClipboardcxx . . $ GdkClipboard# *clipboard) |
| 505 | { |
| 506 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 507 | |
| 508 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 509 | |
| 510 | return priv->contentcxx . . $ _GdkClipboardPrivate#content.; |
| 511 | } |
| 512 | |
| 513 | /** |
| 514 | * gdk_clipboard_store_async: |
| 515 | * @clipboard: a `GdkClipboard` |
| 516 | * @io_priority: the I/O priority of the request |
| 517 | * @cancellable: (nullable): optional `GCancellable` object |
| 518 | * @callback: (scope async) (closure user_data): callback to call when the request is satisfied |
| 519 | * @user_data:: the data to pass to callback function |
| 520 | * |
| 521 | * Asynchronously instructs the @clipboard to store its contents remotely. |
| 522 | * |
| 523 | * If the clipboard is not local, this function does nothing but report success. |
| 524 | * |
| 525 | * The purpose of this call is to preserve clipboard contents beyond the |
| 526 | * lifetime of an application, so this function is typically called on |
| 527 | * exit. Depending on the platform, the functionality may not be available |
| 528 | * unless a "clipboard manager" is running. |
| 529 | * |
| 530 | * This function is called automatically when a |
| 531 | * [GtkApplication](../gtk4/class.Application.html) |
| 532 | * is shut down, so you likely don't need to call it. |
| 533 | */ |
| 534 | void |
| 535 | gdk_clipboard_store_asynccxx . . $ gdk_clipboard_store_async(1d7ec8c1da4c7345). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 536 | int io_priority, |
| 537 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 538 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 539 | gpointercxx . . $ gpointer# user_data) |
| 540 | { |
| 541 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 542 | |
| 543 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 544 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (cancellable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_CANCELLABLEcxx . . $ `<external>/10514987963871321430/gcancellable.h:37:9`! (cancellable)); |
| 545 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (callback != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 546 | |
| 547 | if (priv->localcxx . . $ _GdkClipboardPrivate#local.) |
| 548 | { |
| 549 | GDK_CLIPBOARD_GET_CLASScxx . . $ `gdk/gdkclipboardprivate.h:26:9`! (clipboard)->store_asynccxx . . $ _GdkClipboardClass#store_async. (clipboard, |
| 550 | io_priority, |
| 551 | cancellable, |
| 552 | callback, |
| 553 | user_data); |
| 554 | } |
| 555 | else |
| 556 | { |
| 557 | gdk_clipboard_store_default_asynccxx . . $ gdk_clipboard_store_default_async(1d7ec8c1da4c7345). (clipboard, |
| 558 | io_priority, |
| 559 | cancellable, |
| 560 | callback, |
| 561 | user_data); |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | /** |
| 566 | * gdk_clipboard_store_finish: |
| 567 | * @clipboard: a `GdkClipboard` |
| 568 | * @result: a `GAsyncResult` |
| 569 | * @error: a `GError` location to store the error occurring |
| 570 | * |
| 571 | * Finishes an asynchronous clipboard store. |
| 572 | * |
| 573 | * See [[email protected]_async]. |
| 574 | * |
| 575 | * Returns: %TRUE if storing was successful. |
| 576 | */ |
| 577 | gbooleancxx . . $ gboolean# |
| 578 | gdk_clipboard_store_finishcxx . . $ gdk_clipboard_store_finish(eb9a1ceaf80795ec). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 579 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 580 | GErrorcxx . . $ GError# **error) |
| 581 | { |
| 582 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 583 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 584 | |
| 585 | /* don't check priv->local here because it might have changed while the |
| 586 | * read was ongoing */ |
| 587 | if (g_async_result_is_taggedcxx . . $ g_async_result_is_tagged(2e665b395a719d46). (result, gdk_clipboard_store_default_asynccxx . . $ gdk_clipboard_store_default_async(1d7ec8c1da4c7345).)) |
| 588 | { |
| 589 | return gdk_clipboard_store_default_finishcxx . . $ gdk_clipboard_store_default_finish(eb9a1ceaf80795ec). (clipboard, result, error); |
| 590 | } |
| 591 | else |
| 592 | { |
| 593 | return GDK_CLIPBOARD_GET_CLASScxx . . $ `gdk/gdkclipboardprivate.h:26:9`! (clipboard)->store_finishcxx . . $ _GdkClipboardClass#store_finish. (clipboard, result, error); |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | static void |
| 598 | gdk_clipboard_read_internalcxx . . $ gdk_clipboard_read_internal(32a62d57c38bce9f). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 599 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, |
| 600 | int io_priority, |
| 601 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 602 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 603 | gpointercxx . . $ gpointer# user_data) |
| 604 | { |
| 605 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 606 | |
| 607 | if (priv->localcxx . . $ _GdkClipboardPrivate#local.) |
| 608 | { |
| 609 | gdk_clipboard_read_local_asynccxx . . $ gdk_clipboard_read_local_async(32a62d57c38bce9f). (clipboard, |
| 610 | formats, |
| 611 | io_priority, |
| 612 | cancellable, |
| 613 | callback, |
| 614 | user_data); |
| 615 | } |
| 616 | else |
| 617 | { |
| 618 | GDK_CLIPBOARD_GET_CLASScxx . . $ `gdk/gdkclipboardprivate.h:26:9`! (clipboard)->read_asynccxx . . $ _GdkClipboardClass#read_async. (clipboard, |
| 619 | formats, |
| 620 | io_priority, |
| 621 | cancellable, |
| 622 | callback, |
| 623 | user_data); |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | /** |
| 628 | * gdk_clipboard_read_async: |
| 629 | * @clipboard: a `GdkClipboard` |
| 630 | * @mime_types: (array zero-terminated=1): a %NULL-terminated array of mime types to choose from |
| 631 | * @io_priority: the I/O priority of the request |
| 632 | * @cancellable: (nullable): optional `GCancellable` object |
| 633 | * @callback: (scope async) (closure user_data): callback to call when the request is satisfied |
| 634 | * @user_data: the data to pass to callback function |
| 635 | * |
| 636 | * Asynchronously requests an input stream to read the @clipboard's |
| 637 | * contents from. |
| 638 | * |
| 639 | * The clipboard will choose the most suitable mime type from the given list |
| 640 | * to fulfill the request, preferring the ones listed first. |
| 641 | */ |
| 642 | void |
| 643 | gdk_clipboard_read_asynccxx . . $ gdk_clipboard_read_async(8bda4ba0b31bca3e). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 644 | const char **mime_types, |
| 645 | int io_priority, |
| 646 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 647 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 648 | gpointercxx . . $ gpointer# user_data) |
| 649 | { |
| 650 | GdkContentFormatscxx . . $ GdkContentFormats# *formats; |
| 651 | |
| 652 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 653 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (mime_types != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && mime_types[0] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 654 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (cancellable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_CANCELLABLEcxx . . $ `<external>/10514987963871321430/gcancellable.h:37:9`! (cancellable)); |
| 655 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (callback != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 656 | |
| 657 | formats = gdk_content_formats_newcxx . . $ gdk_content_formats_new(97755e6c06de7b31). (mime_types, g_strv_lengthcxx . . $ g_strv_length(658e6f1ffe3b2f0c). ((char **) mime_types)); |
| 658 | |
| 659 | gdk_clipboard_read_internalcxx . . $ gdk_clipboard_read_internal(32a62d57c38bce9f). (clipboard, formats, io_priority, cancellable, callback, user_data); |
| 660 | |
| 661 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 662 | } |
| 663 | |
| 664 | /** |
| 665 | * gdk_clipboard_read_finish: |
| 666 | * @clipboard: a `GdkClipboard` |
| 667 | * @result: a `GAsyncResult` |
| 668 | * @out_mime_type: (out) (optional) (transfer none): location to store |
| 669 | * the chosen mime type |
| 670 | * @error: a `GError` location to store the error occurring |
| 671 | * |
| 672 | * Finishes an asynchronous clipboard read. |
| 673 | * |
| 674 | * See [[email protected]_async]. |
| 675 | * |
| 676 | * Returns: (transfer full) (nullable): a `GInputStream` |
| 677 | */ |
| 678 | GInputStreamcxx . . $ GInputStream# * |
| 679 | gdk_clipboard_read_finishcxx . . $ gdk_clipboard_read_finish(c8639147c85a978e). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 680 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 681 | const char **out_mime_type, |
| 682 | GErrorcxx . . $ GError# **error) |
| 683 | { |
| 684 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 685 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 686 | |
| 687 | /* don't check priv->local here because it might have changed while the |
| 688 | * read was ongoing */ |
| 689 | if (g_async_result_is_taggedcxx . . $ g_async_result_is_tagged(2e665b395a719d46). (result, gdk_clipboard_read_local_asynccxx . . $ gdk_clipboard_read_local_async(32a62d57c38bce9f).)) |
| 690 | { |
| 691 | return gdk_clipboard_read_local_finishcxx . . $ gdk_clipboard_read_local_finish(c8639147c85a978e). (clipboard, result, out_mime_type, error); |
| 692 | } |
| 693 | else |
| 694 | { |
| 695 | return GDK_CLIPBOARD_GET_CLASScxx . . $ `gdk/gdkclipboardprivate.h:26:9`! (clipboard)->read_finishcxx . . $ _GdkClipboardClass#read_finish. (clipboard, result, out_mime_type, error); |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | static void |
| 700 | gdk_clipboard_read_value_donecxx . . $ gdk_clipboard_read_value_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 701 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 702 | gpointercxx . . $ gpointer# data) |
| 703 | { |
| 704 | GTaskcxx . . $ GTask# *task = data; |
| 705 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 706 | GValuecxx . . $ GValue# *value; |
| 707 | |
| 708 | value = g_task_get_task_datacxx . . $ g_task_get_task_data(3075fc2989a57705). (task); |
| 709 | |
| 710 | if (!gdk_content_deserialize_finishcxx . . $ gdk_content_deserialize_finish(616fa263243dae61). (result, value, &error)) |
| 711 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 712 | else |
| 713 | g_task_return_pointercxx . . $ g_task_return_pointer(2e97a86ccb74176a). (task, value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 714 | |
| 715 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 716 | } |
| 717 | |
| 718 | static void |
| 719 | gdk_clipboard_read_value_got_streamcxx . . $ gdk_clipboard_read_value_got_stream(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 720 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 721 | gpointercxx . . $ gpointer# data) |
| 722 | { |
| 723 | GInputStreamcxx . . $ GInputStream# *stream; |
| 724 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 725 | GTaskcxx . . $ GTask# *task = data; |
| 726 | const char *mime_type; |
| 727 | |
| 728 | stream = gdk_clipboard_read_finishcxx . . $ gdk_clipboard_read_finish(c8639147c85a978e). (GDK_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:30:9`! (source), result, &mime_type, &error); |
| 729 | if (stream == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 730 | { |
| 731 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 732 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 733 | return; |
| 734 | } |
| 735 | |
| 736 | gdk_content_deserialize_asynccxx . . $ gdk_content_deserialize_async(dce82195aa0d29a4). (stream, |
| 737 | mime_type, |
| 738 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (g_task_get_task_data (task)), |
| 739 | g_task_get_prioritycxx . . $ g_task_get_priority(65b5748f7d59ab8d). (task), |
| 740 | g_task_get_cancellablecxx . . $ g_task_get_cancellable(203313200d8a9a3f). (task), |
| 741 | gdk_clipboard_read_value_donecxx . . $ gdk_clipboard_read_value_done(aa1d200d824d915d)., |
| 742 | task); |
| 743 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (stream); |
| 744 | } |
| 745 | |
| 746 | static void |
| 747 | free_valuecxx . . $ free_value(5d22bdacc48458e8). (gpointercxx . . $ gpointer# value) |
| 748 | { |
| 749 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (value); |
| 750 | g_freecxx . . $ g_free(5d22bdacc48458e8). (value); |
| 751 | } |
| 752 | |
| 753 | static void |
| 754 | gdk_clipboard_read_value_internalcxx . . $ gdk_clipboard_read_value_internal(e4c8bb0210c9ff2). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 755 | GTypecxx . . $ GType# type, |
| 756 | gpointercxx . . $ gpointer# source_tag, |
| 757 | int io_priority, |
| 758 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 759 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 760 | gpointercxx . . $ gpointer# user_data) |
| 761 | { |
| 762 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 763 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 764 | GdkContentFormatscxx . . $ GdkContentFormats# *formats; |
| 765 | GValuecxx . . $ GValue# *value; |
| 766 | GTaskcxx . . $ GTask# *task; |
| 767 | |
| 768 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (clipboard, cancellable, callback, user_data); |
| 769 | g_task_set_prioritycxx . . $ g_task_set_priority(b34b01b5a2b59ad8). (task, io_priority); |
| 770 | g_task_set_source_tagcxx . . $ `<external>/6581906438226475924/gtask.h:88:9`! (task, source_tag); |
| 771 | value = g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (GValue, 1); |
| 772 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (value, type); |
| 773 | g_task_set_task_datacxx . . $ g_task_set_task_data(2e97a86ccb74176a). (task, value, free_valuecxx . . $ free_value(5d22bdacc48458e8).); |
| 774 | |
| 775 | if (priv->localcxx . . $ _GdkClipboardPrivate#local.) |
| 776 | { |
| 777 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 778 | |
| 779 | if (priv->contentcxx . . $ _GdkClipboardPrivate#content. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 780 | { |
| 781 | g_task_return_new_errorcxx . . $ g_task_return_new_error(4e3bcb70db2a815a). (task, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_FOUNDcxx . . $ G_IO_ERROR_NOT_FOUND., |
| 782 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Cannot read from empty clipboard.")); |
| 783 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 784 | return; |
| 785 | } |
| 786 | |
| 787 | if (gdk_content_provider_get_valuecxx . . $ gdk_content_provider_get_value(f131bc8b1035f9ef). (priv->contentcxx . . $ _GdkClipboardPrivate#content., value, &error)) |
| 788 | { |
| 789 | g_task_return_pointercxx . . $ g_task_return_pointer(2e97a86ccb74176a). (task, value, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 790 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 791 | return; |
| 792 | } |
| 793 | else if (!g_error_matchescxx . . $ g_error_matches(604444fafc3e7b63). (error, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_SUPPORTEDcxx . . $ G_IO_ERROR_NOT_SUPPORTED.)) |
| 794 | { |
| 795 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 796 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 797 | return; |
| 798 | } |
| 799 | else |
| 800 | { |
| 801 | /* fall through to regular stream transfer */ |
| 802 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error); |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 807 | gdk_content_formats_builder_add_gtypecxx . . $ gdk_content_formats_builder_add_gtype(1fd9ff67a5fc1cf8). (builder, type); |
| 808 | formats = gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 809 | formats = gdk_content_formats_union_deserialize_mime_typescxx . . $ gdk_content_formats_union_deserialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 810 | |
| 811 | gdk_clipboard_read_internalcxx . . $ gdk_clipboard_read_internal(32a62d57c38bce9f). (clipboard, |
| 812 | formats, |
| 813 | io_priority, |
| 814 | cancellable, |
| 815 | gdk_clipboard_read_value_got_streamcxx . . $ gdk_clipboard_read_value_got_stream(aa1d200d824d915d)., |
| 816 | task); |
| 817 | |
| 818 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 819 | } |
| 820 | |
| 821 | /** |
| 822 | * gdk_clipboard_read_value_async: |
| 823 | * @clipboard: a `GdkClipboard` |
| 824 | * @type: a `GType` to read |
| 825 | * @io_priority: the I/O priority of the request |
| 826 | * @cancellable: (nullable): optional `GCancellable` object |
| 827 | * @callback: (scope async) (closure user_data): callback to call when the request is satisfied |
| 828 | * @user_data: the data to pass to callback function |
| 829 | * |
| 830 | * Asynchronously request the @clipboard contents converted to the given |
| 831 | * @type. |
| 832 | * |
| 833 | * For local clipboard contents that are available in the given `GType`, |
| 834 | * the value will be copied directly. Otherwise, GDK will try to use |
| 835 | * [func@content_deserialize_async] to convert the clipboard's data. |
| 836 | */ |
| 837 | void |
| 838 | gdk_clipboard_read_value_asynccxx . . $ gdk_clipboard_read_value_async(c49ccd03e6b586be). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 839 | GTypecxx . . $ GType# type, |
| 840 | int io_priority, |
| 841 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 842 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 843 | gpointercxx . . $ gpointer# user_data) |
| 844 | { |
| 845 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 846 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (cancellable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_CANCELLABLEcxx . . $ `<external>/10514987963871321430/gcancellable.h:37:9`! (cancellable)); |
| 847 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (callback != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 848 | |
| 849 | gdk_clipboard_read_value_internalcxx . . $ gdk_clipboard_read_value_internal(e4c8bb0210c9ff2). (clipboard, |
| 850 | type, |
| 851 | gdk_clipboard_read_value_asynccxx . . $ gdk_clipboard_read_value_async(c49ccd03e6b586be)., |
| 852 | io_priority, |
| 853 | cancellable, |
| 854 | callback, |
| 855 | user_data); |
| 856 | } |
| 857 | |
| 858 | /** |
| 859 | * gdk_clipboard_read_value_finish: |
| 860 | * @clipboard: a `GdkClipboard` |
| 861 | * @result: a `GAsyncResult` |
| 862 | * @error: a GError` location to store the error occurring |
| 863 | * |
| 864 | * Finishes an asynchronous clipboard read. |
| 865 | * |
| 866 | * See [[email protected]_value_async]. |
| 867 | * |
| 868 | * Returns: (transfer none): a `GValue` containing the result. |
| 869 | */ |
| 870 | const GValuecxx . . $ GValue# * |
| 871 | gdk_clipboard_read_value_finishcxx . . $ gdk_clipboard_read_value_finish(708330c606b78864). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 872 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 873 | GErrorcxx . . $ GError# **error) |
| 874 | { |
| 875 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_is_valid (result, clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 876 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_get_source_tag (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)) == gdk_clipboard_read_value_async, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 877 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 878 | |
| 879 | return g_task_propagate_pointercxx . . $ g_task_propagate_pointer(472d3929f510ba3a). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result), error); |
| 880 | } |
| 881 | |
| 882 | /** |
| 883 | * gdk_clipboard_read_texture_async: |
| 884 | * @clipboard: a `GdkClipboard` |
| 885 | * @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore. |
| 886 | * @callback: (scope async) (closure user_data): callback to call when the request is satisfied |
| 887 | * @user_data: the data to pass to callback function |
| 888 | * |
| 889 | * Asynchronously request the @clipboard contents converted to a `GdkPixbuf`. |
| 890 | * |
| 891 | * This is a simple wrapper around [[email protected]_value_async]. |
| 892 | * Use that function or [[email protected]_async] directly if you |
| 893 | * need more control over the operation. |
| 894 | */ |
| 895 | void |
| 896 | gdk_clipboard_read_texture_asynccxx . . $ gdk_clipboard_read_texture_async(4aa0f14124bbed7e). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 897 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 898 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 899 | gpointercxx . . $ gpointer# user_data) |
| 900 | { |
| 901 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 902 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (cancellable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_CANCELLABLEcxx . . $ `<external>/10514987963871321430/gcancellable.h:37:9`! (cancellable)); |
| 903 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (callback != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 904 | |
| 905 | gdk_clipboard_read_value_internalcxx . . $ gdk_clipboard_read_value_internal(e4c8bb0210c9ff2). (clipboard, |
| 906 | GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!, |
| 907 | gdk_clipboard_read_texture_asynccxx . . $ gdk_clipboard_read_texture_async(4aa0f14124bbed7e)., |
| 908 | G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!, |
| 909 | cancellable, |
| 910 | callback, |
| 911 | user_data); |
| 912 | } |
| 913 | |
| 914 | /** |
| 915 | * gdk_clipboard_read_texture_finish: |
| 916 | * @clipboard: a `GdkClipboard` |
| 917 | * @result: a `GAsyncResult` |
| 918 | * @error: a `GError` location to store the error occurring |
| 919 | * |
| 920 | * Finishes an asynchronous clipboard read. |
| 921 | * |
| 922 | * See [[email protected]_texture_async]. |
| 923 | * |
| 924 | * Returns: (transfer full) (nullable): a new `GdkTexture` |
| 925 | */ |
| 926 | GdkTexturecxx . . $ GdkTexture# * |
| 927 | gdk_clipboard_read_texture_finishcxx . . $ gdk_clipboard_read_texture_finish(7c9388a15aadabae). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 928 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 929 | GErrorcxx . . $ GError# **error) |
| 930 | { |
| 931 | const GValuecxx . . $ GValue# *value; |
| 932 | |
| 933 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_is_valid (result, clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 934 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_get_source_tag (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)) == gdk_clipboard_read_texture_async, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 935 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 936 | |
| 937 | value = g_task_propagate_pointercxx . . $ g_task_propagate_pointer(472d3929f510ba3a). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result), error); |
| 938 | if (!value) |
| 939 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 940 | |
| 941 | return g_value_dup_objectcxx . . $ g_value_dup_object(e12dff36056c2cce). (value); |
| 942 | } |
| 943 | |
| 944 | /** |
| 945 | * gdk_clipboard_read_text_async: |
| 946 | * @clipboard: a `GdkClipboard` |
| 947 | * @cancellable: (nullable): optional `GCancellable` object |
| 948 | * @callback: (scope async) (closure user_data): callback to call when the request is satisfied |
| 949 | * @user_data: the data to pass to callback function |
| 950 | * |
| 951 | * Asynchronously request the @clipboard contents converted to a string. |
| 952 | * |
| 953 | * This is a simple wrapper around [[email protected]_value_async]. |
| 954 | * Use that function or [[email protected]_async] directly if you |
| 955 | * need more control over the operation. |
| 956 | */ |
| 957 | void |
| 958 | gdk_clipboard_read_text_asynccxx . . $ gdk_clipboard_read_text_async(4aa0f14124bbed7e). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 959 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 960 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 961 | gpointercxx . . $ gpointer# user_data) |
| 962 | { |
| 963 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 964 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (cancellable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_CANCELLABLEcxx . . $ `<external>/10514987963871321430/gcancellable.h:37:9`! (cancellable)); |
| 965 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (callback != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 966 | |
| 967 | gdk_clipboard_read_value_internalcxx . . $ gdk_clipboard_read_value_internal(e4c8bb0210c9ff2). (clipboard, |
| 968 | G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!, |
| 969 | gdk_clipboard_read_text_asynccxx . . $ gdk_clipboard_read_text_async(4aa0f14124bbed7e)., |
| 970 | G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!, |
| 971 | cancellable, |
| 972 | callback, |
| 973 | user_data); |
| 974 | } |
| 975 | |
| 976 | /** |
| 977 | * gdk_clipboard_read_text_finish: |
| 978 | * @clipboard: a `GdkClipboard` |
| 979 | * @result: a `GAsyncResult` |
| 980 | * @error: a `GError` location to store the error occurring |
| 981 | * |
| 982 | * Finishes an asynchronous clipboard read. |
| 983 | * |
| 984 | * See [[email protected]_text_async]. |
| 985 | * |
| 986 | * Returns: (transfer full) (nullable): a new string |
| 987 | */ |
| 988 | char * |
| 989 | gdk_clipboard_read_text_finishcxx . . $ gdk_clipboard_read_text_finish(54092aaf66d91230). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 990 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 991 | GErrorcxx . . $ GError# **error) |
| 992 | { |
| 993 | const GValuecxx . . $ GValue# *value; |
| 994 | |
| 995 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_is_valid (result, clipboard), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 996 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_get_source_tag (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)) == gdk_clipboard_read_text_async, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 997 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 998 | |
| 999 | value = g_task_propagate_pointercxx . . $ g_task_propagate_pointer(472d3929f510ba3a). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result), error); |
| 1000 | if (!value) |
| 1001 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1002 | |
| 1003 | return g_value_dup_stringcxx . . $ g_value_dup_string(602930317b8318e8). (value); |
| 1004 | } |
| 1005 | |
| 1006 | GdkClipboardcxx . . $ GdkClipboard# * |
| 1007 | gdk_clipboard_newcxx . . $ gdk_clipboard_new(d64e200b8dbcc2a2). (GdkDisplaycxx . . $ GdkDisplay# *display) |
| 1008 | { |
| 1009 | return g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GDK_TYPE_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:29:9`!, |
| 1010 | "display", display, |
| 1011 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1012 | } |
| 1013 | |
| 1014 | static void |
| 1015 | gdk_clipboard_write_donecxx . . $ gdk_clipboard_write_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *content, |
| 1016 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 1017 | gpointercxx . . $ gpointer# task) |
| 1018 | { |
| 1019 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1020 | |
| 1021 | if (gdk_content_provider_write_mime_type_finishcxx . . $ gdk_content_provider_write_mime_type_finish(c700289fe15475c8). (GDK_CONTENT_PROVIDERcxx . . $ `gdk/gdkcontentprovider.h:30:9`! (content), result, &error)) |
| 1022 | g_task_return_booleancxx . . $ g_task_return_boolean(b34b01b5a2b59ad8). (task, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 1023 | else |
| 1024 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 1025 | |
| 1026 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 1027 | } |
| 1028 | |
| 1029 | static void |
| 1030 | gdk_clipboard_write_serialize_donecxx . . $ gdk_clipboard_write_serialize_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *content, |
| 1031 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 1032 | gpointercxx . . $ gpointer# task) |
| 1033 | { |
| 1034 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1035 | |
| 1036 | if (gdk_content_serialize_finishcxx . . $ gdk_content_serialize_finish(aff244c0ed8a2285). (result, &error)) |
| 1037 | g_task_return_booleancxx . . $ g_task_return_boolean(b34b01b5a2b59ad8). (task, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 1038 | else |
| 1039 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 1040 | |
| 1041 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 1042 | } |
| 1043 | |
| 1044 | void |
| 1045 | gdk_clipboard_write_asynccxx . . $ gdk_clipboard_write_async(d3c69ede4d8f94c2). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1046 | const char *mime_type, |
| 1047 | GOutputStreamcxx . . $ GOutputStream# *stream, |
| 1048 | int io_priority, |
| 1049 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 1050 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 1051 | gpointercxx . . $ gpointer# user_data) |
| 1052 | { |
| 1053 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 1054 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, *mime_formats; |
| 1055 | GTaskcxx . . $ GTask# *task; |
| 1056 | GTypecxx . . $ GType# gtype; |
| 1057 | |
| 1058 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1059 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (priv->local); |
| 1060 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (mime_type != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1061 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (mime_type == g_intern_string (mime_type)); |
| 1062 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (G_IS_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:37:9`! (stream)); |
| 1063 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (cancellable == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || G_IS_CANCELLABLEcxx . . $ `<external>/10514987963871321430/gcancellable.h:37:9`! (cancellable)); |
| 1064 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (callback != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1065 | |
| 1066 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (clipboard, cancellable, callback, user_data); |
| 1067 | g_task_set_prioritycxx . . $ g_task_set_priority(b34b01b5a2b59ad8). (task, io_priority); |
| 1068 | g_task_set_source_tagcxx . . $ `<external>/6581906438226475924/gtask.h:88:9`! (task, gdk_clipboard_write_async); |
| 1069 | |
| 1070 | if (priv->contentcxx . . $ _GdkClipboardPrivate#content. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 1071 | { |
| 1072 | g_task_return_new_errorcxx . . $ g_task_return_new_error(4e3bcb70db2a815a). (task, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_FOUNDcxx . . $ G_IO_ERROR_NOT_FOUND., |
| 1073 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Cannot read from empty clipboard.")); |
| 1074 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 1075 | return; |
| 1076 | } |
| 1077 | |
| 1078 | formats = gdk_content_provider_ref_formatscxx . . $ gdk_content_provider_ref_formats(653aea2a3e0e059b). (priv->contentcxx . . $ _GdkClipboardPrivate#content.); |
| 1079 | if (gdk_content_formats_contain_mime_typecxx . . $ gdk_content_formats_contain_mime_type(b2b52adaeb9a7ddb). (formats, mime_type)) |
| 1080 | { |
| 1081 | gdk_content_provider_write_mime_type_asynccxx . . $ gdk_content_provider_write_mime_type_async(b78b6ce4a2502474). (priv->contentcxx . . $ _GdkClipboardPrivate#content., |
| 1082 | mime_type, |
| 1083 | stream, |
| 1084 | io_priority, |
| 1085 | cancellable, |
| 1086 | gdk_clipboard_write_donecxx . . $ gdk_clipboard_write_done(aa1d200d824d915d)., |
| 1087 | task); |
| 1088 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 1089 | return; |
| 1090 | } |
| 1091 | |
| 1092 | mime_formats = gdk_content_formats_newcxx . . $ gdk_content_formats_new(97755e6c06de7b31). ((const char *[2]) { mime_type, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! }, 1); |
| 1093 | mime_formats = gdk_content_formats_union_serialize_gtypescxx . . $ gdk_content_formats_union_serialize_gtypes(f9c6e94556d0b4d1). (mime_formats); |
| 1094 | gtype = gdk_content_formats_match_gtypecxx . . $ gdk_content_formats_match_gtype(31a10dc9c5ff74ae). (formats, mime_formats); |
| 1095 | if (gtype != G_TYPE_INVALIDcxx . . $ `<external>/9567554376676449156/gtype.h:65:9`!) |
| 1096 | { |
| 1097 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 1098 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 1099 | |
| 1100 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (gtype != G_TYPE_INVALIDcxx . . $ `<external>/9567554376676449156/gtype.h:65:9`!); |
| 1101 | |
| 1102 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, gtype); |
| 1103 | if (gdk_content_provider_get_valuecxx . . $ gdk_content_provider_get_value(f131bc8b1035f9ef). (priv->contentcxx . . $ _GdkClipboardPrivate#content., &value, &error)) |
| 1104 | { |
| 1105 | gdk_content_serialize_asynccxx . . $ gdk_content_serialize_async(de4533add184f2ee). (stream, |
| 1106 | mime_type, |
| 1107 | &value, |
| 1108 | io_priority, |
| 1109 | cancellable, |
| 1110 | gdk_clipboard_write_serialize_donecxx . . $ gdk_clipboard_write_serialize_done(aa1d200d824d915d)., |
| 1111 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (task)); |
| 1112 | } |
| 1113 | else |
| 1114 | { |
| 1115 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 1116 | } |
| 1117 | |
| 1118 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 1119 | } |
| 1120 | else |
| 1121 | { |
| 1122 | g_task_return_new_errorcxx . . $ g_task_return_new_error(4e3bcb70db2a815a). (task, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_NOT_SUPPORTEDcxx . . $ G_IO_ERROR_NOT_SUPPORTED., |
| 1123 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("No compatible formats to transfer clipboard contents.")); |
| 1124 | } |
| 1125 | |
| 1126 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (mime_formats); |
| 1127 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 1128 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 1129 | } |
| 1130 | |
| 1131 | gbooleancxx . . $ gboolean# |
| 1132 | gdk_clipboard_write_finishcxx . . $ gdk_clipboard_write_finish(eb9a1ceaf80795ec). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1133 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 1134 | GErrorcxx . . $ GError# **error) |
| 1135 | { |
| 1136 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_is_valid (result, clipboard), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1137 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (g_task_get_source_tag (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result)) == gdk_clipboard_write_async, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1138 | |
| 1139 | return g_task_propagate_booleancxx . . $ g_task_propagate_boolean(21d91baf98d56582). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (result), error); |
| 1140 | } |
| 1141 | |
| 1142 | static gbooleancxx . . $ gboolean# |
| 1143 | gdk_clipboard_claimcxx . . $ gdk_clipboard_claim(8e15d0f58b4da43b). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1144 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, |
| 1145 | gbooleancxx . . $ gboolean# local, |
| 1146 | GdkContentProvidercxx . . $ GdkContentProvider# *content) |
| 1147 | { |
| 1148 | return GDK_CLIPBOARD_GET_CLASScxx . . $ `gdk/gdkclipboardprivate.h:26:9`! (clipboard)->claimcxx . . $ _GdkClipboardClass#claim. (clipboard, formats, local, content); |
| 1149 | } |
| 1150 | |
| 1151 | static void |
| 1152 | gdk_clipboard_content_changed_cbcxx . . $ gdk_clipboard_content_changed_cb(199e2608edc99908). (GdkContentProvidercxx . . $ GdkContentProvider# *provider, |
| 1153 | GdkClipboardcxx . . $ GdkClipboard# *clipboard) |
| 1154 | { |
| 1155 | GdkContentFormatscxx . . $ GdkContentFormats# *formats; |
| 1156 | |
| 1157 | formats = gdk_content_provider_ref_formatscxx . . $ gdk_content_provider_ref_formats(653aea2a3e0e059b). (provider); |
| 1158 | formats = gdk_content_formats_union_serialize_mime_typescxx . . $ gdk_content_formats_union_serialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 1159 | |
| 1160 | gdk_clipboard_claimcxx . . $ gdk_clipboard_claim(8e15d0f58b4da43b). (clipboard, formats, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, provider); |
| 1161 | |
| 1162 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 1163 | } |
| 1164 | |
| 1165 | void |
| 1166 | gdk_clipboard_claim_remotecxx . . $ gdk_clipboard_claim_remote(b9df58d8aec32f15). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1167 | GdkContentFormatscxx . . $ GdkContentFormats# *formats) |
| 1168 | { |
| 1169 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1170 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (formats != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1171 | |
| 1172 | gdk_clipboard_claimcxx . . $ gdk_clipboard_claim(8e15d0f58b4da43b). (clipboard, formats, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1173 | } |
| 1174 | |
| 1175 | /** |
| 1176 | * gdk_clipboard_set_content: |
| 1177 | * @clipboard: a `GdkClipboard` |
| 1178 | * @provider: (transfer none) (nullable): the new contents of @clipboard |
| 1179 | * or %NULL to clear the clipboard |
| 1180 | * |
| 1181 | * Sets a new content provider on @clipboard. |
| 1182 | * |
| 1183 | * The clipboard will claim the `GdkDisplay`'s resources and advertise |
| 1184 | * these new contents to other applications. |
| 1185 | * |
| 1186 | * In the rare case of a failure, this function will return %FALSE. The |
| 1187 | * clipboard will then continue reporting its old contents and ignore |
| 1188 | * @provider. |
| 1189 | * |
| 1190 | * If the contents are read by either an external application or the |
| 1191 | * @clipboard's read functions, @clipboard will select the best format to |
| 1192 | * transfer the contents and then request that format from @provider. |
| 1193 | * |
| 1194 | * Returns: %TRUE if setting the clipboard succeeded |
| 1195 | */ |
| 1196 | gbooleancxx . . $ gboolean# |
| 1197 | gdk_clipboard_set_contentcxx . . $ gdk_clipboard_set_content(87ff779b686590dd). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1198 | GdkContentProvidercxx . . $ GdkContentProvider# *provider) |
| 1199 | { |
| 1200 | GdkClipboardPrivatecxx . . $ GdkClipboardPrivate# *priv = gdk_clipboard_get_instance_privatecxx . . $ gdk_clipboard_get_instance_private(9701797cbf9a68d3). (clipboard); |
| 1201 | GdkContentFormatscxx . . $ GdkContentFormats# *formats; |
| 1202 | gbooleancxx . . $ gboolean# result; |
| 1203 | |
| 1204 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1205 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (provider == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GDK_IS_CONTENT_PROVIDERcxx . . $ `gdk/gdkcontentprovider.h:31:9`! (provider), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 1206 | |
| 1207 | if (provider) |
| 1208 | { |
| 1209 | if (priv->contentcxx . . $ _GdkClipboardPrivate#content. == provider) |
| 1210 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 1211 | |
| 1212 | formats = gdk_content_provider_ref_formatscxx . . $ gdk_content_provider_ref_formats(653aea2a3e0e059b). (provider); |
| 1213 | formats = gdk_content_formats_union_serialize_mime_typescxx . . $ gdk_content_formats_union_serialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 1214 | } |
| 1215 | else |
| 1216 | { |
| 1217 | if (priv->contentcxx . . $ _GdkClipboardPrivate#content. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && priv->localcxx . . $ _GdkClipboardPrivate#local.) |
| 1218 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 1219 | |
| 1220 | formats = gdk_content_formats_newcxx . . $ gdk_content_formats_new(97755e6c06de7b31). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0); |
| 1221 | } |
| 1222 | |
| 1223 | result = gdk_clipboard_claimcxx . . $ gdk_clipboard_claim(8e15d0f58b4da43b). (clipboard, formats, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, provider); |
| 1224 | |
| 1225 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 1226 | |
| 1227 | return result; |
| 1228 | } |
| 1229 | |
| 1230 | /** |
| 1231 | * gdk_clipboard_set: |
| 1232 | * @clipboard: a `GdkClipboard` |
| 1233 | * @type: type of value to set |
| 1234 | * @...: value contents conforming to @type |
| 1235 | * |
| 1236 | * Sets the clipboard to contain the value collected from the given varargs. |
| 1237 | * |
| 1238 | * Values should be passed the same way they are passed to other value |
| 1239 | * collecting APIs, such as [[email protected]] or |
| 1240 | * [[email protected]_emit]. |
| 1241 | * |
| 1242 | * ```c |
| 1243 | * gdk_clipboard_set (clipboard, G_TYPE_STRING, "Hello World"); |
| 1244 | * |
| 1245 | * gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture); |
| 1246 | * ``` |
| 1247 | */ |
| 1248 | void |
| 1249 | gdk_clipboard_setcxx . . $ gdk_clipboard_set(bba2fd18b808f219). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1250 | GTypecxx . . $ GType# type, |
| 1251 | ...) |
| 1252 | { |
| 1253 | va_listcxx . . $ va_list# args; |
| 1254 | |
| 1255 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1256 | |
| 1257 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`! (args, type); |
| 1258 | gdk_clipboard_set_valistcxx . . $ gdk_clipboard_set_valist(357768abbce7dcd9). (clipboard, type, args); |
| 1259 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`! (args); |
| 1260 | } |
| 1261 | |
| 1262 | /** |
| 1263 | * gdk_clipboard_set_valist: (skip) |
| 1264 | * @clipboard: a `GdkClipboard` |
| 1265 | * @type: type of value to set |
| 1266 | * @args: varargs containing the value of @type |
| 1267 | * |
| 1268 | * Sets the clipboard to contain the value collected from the given @args. |
| 1269 | */ |
| 1270 | void |
| 1271 | gdk_clipboard_set_valistcxx . . $ gdk_clipboard_set_valist(357768abbce7dcd9). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1272 | GTypecxx . . $ GType# type, |
| 1273 | va_listcxx . . $ va_list# args) |
| 1274 | { |
| 1275 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 1276 | char *error; |
| 1277 | |
| 1278 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1279 | |
| 1280 | G_VALUE_COLLECT_INITcxx . . $ `<external>/1263841233080259935/gvaluecollector.h:82:9`! (&value, type, |
| 1281 | args, G_VALUE_NOCOPY_CONTENTScxx . . $ `<external>/17218264759549183453/gvalue.h:208:9`!, |
| 1282 | &error); |
| 1283 | if (error) |
| 1284 | { |
| 1285 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:340:9`! ("%s: %s", G_STRLOCcxx . . $ `<external>/12741050725406041920/gmacros.h:928:9`!, error); |
| 1286 | g_freecxx . . $ g_free(5d22bdacc48458e8). (error); |
| 1287 | /* we purposely leak the value here, it might not be |
| 1288 | * in a sane state if an error condition occurred |
| 1289 | */ |
| 1290 | return; |
| 1291 | } |
| 1292 | |
| 1293 | gdk_clipboard_set_valuecxx . . $ gdk_clipboard_set_value(1d00deb606f48017). (clipboard, &value); |
| 1294 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 1295 | } |
| 1296 | |
| 1297 | /** |
| 1298 | * gdk_clipboard_set_value: (rename-to gdk_clipboard_set) |
| 1299 | * @clipboard: a `GdkClipboard` |
| 1300 | * @value: a `GValue` to set |
| 1301 | * |
| 1302 | * Sets the @clipboard to contain the given @value. |
| 1303 | */ |
| 1304 | void |
| 1305 | gdk_clipboard_set_valuecxx . . $ gdk_clipboard_set_value(1d00deb606f48017). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1306 | const GValuecxx . . $ GValue# *value) |
| 1307 | { |
| 1308 | GdkContentProvidercxx . . $ GdkContentProvider# *provider; |
| 1309 | |
| 1310 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1311 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (G_IS_VALUEcxx . . $ `<external>/17218264759549183453/gvalue.h:56:9`! (value)); |
| 1312 | |
| 1313 | provider = gdk_content_provider_new_for_valuecxx . . $ gdk_content_provider_new_for_value(405fce0409781f3e). (value); |
| 1314 | |
| 1315 | gdk_clipboard_set_contentcxx . . $ gdk_clipboard_set_content(87ff779b686590dd). (clipboard, provider); |
| 1316 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (provider); |
| 1317 | } |
| 1318 | |
| 1319 | /** |
| 1320 | * gdk_clipboard_set_text: (skip) |
| 1321 | * @clipboard: a `GdkClipboard` |
| 1322 | * @text: Text to put into the clipboard |
| 1323 | * |
| 1324 | * Puts the given @text into the clipboard. |
| 1325 | */ |
| 1326 | void |
| 1327 | gdk_clipboard_set_textcxx . . $ gdk_clipboard_set_text(cd5df9b714d66581). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1328 | const char *text) |
| 1329 | { |
| 1330 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1331 | |
| 1332 | gdk_clipboard_setcxx . . $ gdk_clipboard_set(bba2fd18b808f219). (clipboard, G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!, text); |
| 1333 | } |
| 1334 | |
| 1335 | /** |
| 1336 | * gdk_clipboard_set_texture: (skip) |
| 1337 | * @clipboard: a `GdkClipboard` |
| 1338 | * @texture: a `GdkTexture` to put into the clipboard |
| 1339 | * |
| 1340 | * Puts the given @texture into the clipboard. |
| 1341 | */ |
| 1342 | void |
| 1343 | gdk_clipboard_set_texturecxx . . $ gdk_clipboard_set_texture(b03994345cbc40a). (GdkClipboardcxx . . $ GdkClipboard# *clipboard, |
| 1344 | GdkTexturecxx . . $ GdkTexture# *texture) |
| 1345 | { |
| 1346 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CLIPBOARDcxx . . $ `gdk/gdkclipboard.h:31:9`! (clipboard)); |
| 1347 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_TEXTUREcxx . . $ `gdk/gdktexture.h:33:9`! (texture)); |
| 1348 | |
| 1349 | gdk_clipboard_setcxx . . $ gdk_clipboard_set(bba2fd18b808f219). (clipboard, GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!, texture); |
| 1350 | } |