| 1 | /* GTK - The GIMP Toolkit |
| 2 | * Copyright (C) 2017 Benjamin Otte |
| 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 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 19 | |
| 20 | #include <gio/gio.h> |
| 21 | |
| 22 | #include "gdkcontentserializer.h"cxx . . $ `<file>/gdk/gdkcontentserializer.h`/ |
| 23 | |
| 24 | #include "gdkcontentformatsprivate.h"cxx . . $ `<file>/gdk/gdkcontentformatsprivate.h`/ |
| 25 | #include "deprecated/gdkpixbuf.h"cxx . . $ `<file>/gdk/deprecated/gdkpixbuf.h`/ |
| 26 | #include "filetransferportalprivate.h"cxx . . $ `<file>/gdk/filetransferportalprivate.h`/ |
| 27 | #include "gdktextureprivate.h"cxx . . $ `<file>/gdk/gdktextureprivate.h`/ |
| 28 | #include "gdkrgba.h"cxx . . $ `<file>/gdk/gdkrgba.h`/ |
| 29 | #include "loaders/gdkpngprivate.h"cxx . . $ `<file>/gdk/loaders/gdkpngprivate.h`/ |
| 30 | #include "loaders/gdktiffprivate.h"cxx . . $ `<file>/gdk/loaders/gdktiffprivate.h`/ |
| 31 | #include "loaders/gdkjpegprivate.h"cxx . . $ `<file>/gdk/loaders/gdkjpegprivate.h`/ |
| 32 | #include "gdkmemorytextureprivate.h"cxx . . $ `<file>/gdk/gdkmemorytextureprivate.h`/ |
| 33 | #include "gdkprivate.h"cxx . . $ `<file>/gdk/gdkprivate.h`/ |
| 34 | |
| 35 | #include <gdk-pixbuf/gdk-pixbuf.h> |
| 36 | #include <string.h> |
| 37 | |
| 38 | |
| 39 | /** |
| 40 | * GdkContentSerializer: |
| 41 | * |
| 42 | * Serializes content for inter-application data transfers. |
| 43 | * |
| 44 | * The `GdkContentSerializer` transforms an object that is identified |
| 45 | * by a GType into a serialized form (i.e. a byte stream) that is |
| 46 | * identified by a mime type. |
| 47 | * |
| 48 | * GTK provides serializers and deserializers for common data types |
| 49 | * such as text, colors, images or file lists. To register your own |
| 50 | * serialization functions, use [[email protected]_register_serializer]. |
| 51 | * |
| 52 | * Also see [[email protected]]. |
| 53 | */ |
| 54 | |
| 55 | typedef struct _Serializercxx . . $ _Serializer# Serializercxx . . $ Serializer#; |
| 56 | |
| 57 | struct _Serializercxx . . $ _Serializer# |
| 58 | { |
| 59 | const char * mime_typecxx . . $ _Serializer#mime_type.; /* interned */ |
| 60 | GTypecxx . . $ GType# typecxx . . $ _Serializer#type.; |
| 61 | GdkContentSerializeFunccxx . . $ GdkContentSerializeFunc# serializecxx . . $ _Serializer#serialize.; |
| 62 | gpointercxx . . $ gpointer# datacxx . . $ _Serializer#data.; |
| 63 | GDestroyNotifycxx . . $ GDestroyNotify# notifycxx . . $ _Serializer#notify.; |
| 64 | }; |
| 65 | |
| 66 | GQueuecxx . . $ GQueue# serializerscxx . . $ serializers. = G_QUEUE_INITcxx . . $ `<external>/12807349218183234979/gqueue.h:70:9`!; |
| 67 | |
| 68 | #define GDK_CONTENT_SERIALIZER_CLASScxx . . $ `gdk/gdkcontentserializer.c:68:9`!(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_CONTENT_SERIALIZER, GdkContentSerializerClass)) |
| 69 | #define GDK_IS_CONTENT_SERIALIZER_CLASScxx . . $ `gdk/gdkcontentserializer.c:69:9`!(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_CONTENT_SERIALIZER)) |
| 70 | #define GDK_CONTENT_SERIALIZER_GET_CLASScxx . . $ `gdk/gdkcontentserializer.c:70:9`!(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_CONTENT_SERIALIZER, GdkContentSerializerClass)) |
| 71 | |
| 72 | typedef struct _GdkContentSerializerClasscxx . . $ _GdkContentSerializerClass# GdkContentSerializerClasscxx . . $ GdkContentSerializerClass#; |
| 73 | |
| 74 | struct _GdkContentSerializercxx . . $ _GdkContentSerializer# |
| 75 | { |
| 76 | GObjectcxx . . $ GObject# parent_instancecxx . . $ _GdkContentSerializer#parent_instance.; |
| 77 | |
| 78 | const char *mime_typecxx . . $ _GdkContentSerializer#mime_type.; /* interned */ |
| 79 | GValuecxx . . $ GValue# valuecxx . . $ _GdkContentSerializer#value.; |
| 80 | GOutputStreamcxx . . $ GOutputStream# *streamcxx . . $ _GdkContentSerializer#stream.; |
| 81 | int prioritycxx . . $ _GdkContentSerializer#priority.; |
| 82 | gbooleancxx . . $ gboolean# returnedcxx . . $ _GdkContentSerializer#returned.; |
| 83 | GCancellablecxx . . $ GCancellable# *cancellablecxx . . $ _GdkContentSerializer#cancellable.; |
| 84 | gpointercxx . . $ gpointer# user_datacxx . . $ _GdkContentSerializer#user_data.; |
| 85 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callbackcxx . . $ _GdkContentSerializer#callback.; |
| 86 | gpointercxx . . $ gpointer# callback_datacxx . . $ _GdkContentSerializer#callback_data.; |
| 87 | |
| 88 | gpointercxx . . $ gpointer# task_datacxx . . $ _GdkContentSerializer#task_data.; |
| 89 | GDestroyNotifycxx . . $ GDestroyNotify# task_notifycxx . . $ _GdkContentSerializer#task_notify.; |
| 90 | |
| 91 | GErrorcxx . . $ GError# *errorcxx . . $ _GdkContentSerializer#error.; |
| 92 | }; |
| 93 | |
| 94 | struct _GdkContentSerializerClasscxx . . $ _GdkContentSerializerClass# |
| 95 | { |
| 96 | GObjectClasscxx . . $ GObjectClass# parent_classcxx . . $ _GdkContentSerializerClass#parent_class.; |
| 97 | }; |
| 98 | |
| 99 | static gpointercxx . . $ gpointer# |
| 100 | gdk_content_serializer_async_result_get_user_datacxx . . $ gdk_content_serializer_async_result_get_user_data(822ed06eac92c6da). (GAsyncResultcxx . . $ GAsyncResult# *res) |
| 101 | { |
| 102 | return GDK_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:29:9`! (res)->callback_datacxx . . $ _GdkContentSerializer#callback_data.; |
| 103 | } |
| 104 | |
| 105 | static GObjectcxx . . $ GObject# * |
| 106 | gdk_content_serializer_async_result_get_source_objectcxx . . $ gdk_content_serializer_async_result_get_source_object(4c6f46468f3d70c9). (GAsyncResultcxx . . $ GAsyncResult# *res) |
| 107 | { |
| 108 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 109 | } |
| 110 | |
| 111 | static void |
| 112 | gdk_content_serializer_async_result_iface_initcxx . . $ gdk_content_serializer_async_result_iface_init(2dd3a73851d97380). (GAsyncResultIfacecxx . . $ GAsyncResultIface# *iface) |
| 113 | { |
| 114 | iface->get_user_datacxx . . $ _GAsyncResultIface#get_user_data. = gdk_content_serializer_async_result_get_user_datacxx . . $ gdk_content_serializer_async_result_get_user_data(822ed06eac92c6da).; |
| 115 | iface->get_source_objectcxx . . $ _GAsyncResultIface#get_source_object. = gdk_content_serializer_async_result_get_source_objectcxx . . $ gdk_content_serializer_async_result_get_source_object(4c6f46468f3d70c9).; |
| 116 | } |
| 117 | |
| 118 | G_DEFINE_TYPE_WITH_CODEcxx . . $ `<external>/9567554376676449156/gtype.h:1850:9`! (GdkContentSerializer, gdk_content_serializer, G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!, |
| 119 | G_IMPLEMENT_INTERFACEcxx . . $ `<external>/9567554376676449156/gtype.h:2115:9`! (G_TYPE_ASYNC_RESULTcxx . . $ `<external>/3523893862415901422/gasyncresult.h:34:9`!, gdk_content_serializer_async_result_iface_init)) |
| 120 | |
| 121 | static void |
| 122 | gdk_content_serializer_finalizecxx . . $ gdk_content_serializer_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 123 | { |
| 124 | GdkContentSerializercxx . . $ GdkContentSerializer# *serializer = GDK_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:29:9`! (object); |
| 125 | |
| 126 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&serializer->valuecxx . . $ _GdkContentSerializer#value.); |
| 127 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&serializer->stream); |
| 128 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&serializer->cancellable); |
| 129 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&serializer->errorcxx . . $ _GdkContentSerializer#error.); |
| 130 | |
| 131 | if (serializer->task_notifycxx . . $ _GdkContentSerializer#task_notify.) |
| 132 | serializer->task_notifycxx . . $ _GdkContentSerializer#task_notify. (serializer->task_datacxx . . $ _GdkContentSerializer#task_data.); |
| 133 | |
| 134 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gdk_content_serializer_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 135 | } |
| 136 | |
| 137 | static void |
| 138 | gdk_content_serializer_class_initcxx . . $ gdk_content_serializer_class_init(19be60dff2469c5c). (GdkContentSerializerClasscxx . . $ GdkContentSerializerClass# *content_serializer_class) |
| 139 | { |
| 140 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (content_serializer_class); |
| 141 | |
| 142 | object_class->finalizecxx . . $ _GObjectClass#finalize. = gdk_content_serializer_finalizecxx . . $ gdk_content_serializer_finalize(6087475fa43034d3).; |
| 143 | } |
| 144 | |
| 145 | static void |
| 146 | gdk_content_serializer_initcxx . . $ gdk_content_serializer_init(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *content_serializer) |
| 147 | { |
| 148 | } |
| 149 | |
| 150 | static void |
| 151 | gdk_content_serializer_runcxx . . $ gdk_content_serializer_run(a946c1e91b8f778d). (const char *mime_type, |
| 152 | const GValuecxx . . $ GValue# *value, |
| 153 | GOutputStreamcxx . . $ GOutputStream# *stream, |
| 154 | int priority, |
| 155 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 156 | GdkContentSerializeFunccxx . . $ GdkContentSerializeFunc# serialize_func, |
| 157 | gpointercxx . . $ gpointer# user_data, |
| 158 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 159 | gpointercxx . . $ gpointer# callback_data) |
| 160 | { |
| 161 | GdkContentSerializercxx . . $ GdkContentSerializer# *serializer; |
| 162 | |
| 163 | serializer = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GDK_TYPE_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:28:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 164 | |
| 165 | serializer->mime_typecxx . . $ _GdkContentSerializer#mime_type. = mime_type; |
| 166 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&serializer->valuecxx . . $ _GdkContentSerializer#value., G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (value)); |
| 167 | g_value_copycxx . . $ g_value_copy(76788ea28990d685). (value, &serializer->valuecxx . . $ _GdkContentSerializer#value.); |
| 168 | serializer->streamcxx . . $ _GdkContentSerializer#stream. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (stream); |
| 169 | serializer->prioritycxx . . $ _GdkContentSerializer#priority. = priority; |
| 170 | if (cancellable) |
| 171 | serializer->cancellablecxx . . $ _GdkContentSerializer#cancellable. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (cancellable); |
| 172 | serializer->user_datacxx . . $ _GdkContentSerializer#user_data. = user_data; |
| 173 | serializer->callbackcxx . . $ _GdkContentSerializer#callback. = callback; |
| 174 | serializer->callback_datacxx . . $ _GdkContentSerializer#callback_data. = callback_data; |
| 175 | |
| 176 | serialize_func (serializer); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * gdk_content_serializer_get_mime_type: |
| 181 | * @serializer: a `GdkContentSerializer` |
| 182 | * |
| 183 | * Gets the mime type to serialize to. |
| 184 | * |
| 185 | * Returns: (transfer none): the mime type for the current operation |
| 186 | */ |
| 187 | const char * |
| 188 | gdk_content_serializer_get_mime_typecxx . . $ gdk_content_serializer_get_mime_type(e827523a3335623f). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 189 | { |
| 190 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 191 | |
| 192 | return serializer->mime_typecxx . . $ _GdkContentSerializer#mime_type.; |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * gdk_content_serializer_get_gtype: |
| 197 | * @serializer: a `GdkContentSerializer` |
| 198 | * |
| 199 | * Gets the `GType` to of the object to serialize. |
| 200 | * |
| 201 | * Returns: the `GType` for the current operation |
| 202 | */ |
| 203 | GTypecxx . . $ GType# |
| 204 | gdk_content_serializer_get_gtypecxx . . $ gdk_content_serializer_get_gtype(5dd1a7ecaa1fd4b). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 205 | { |
| 206 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), G_TYPE_INVALIDcxx . . $ `<external>/9567554376676449156/gtype.h:65:9`!); |
| 207 | |
| 208 | return G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (&serializer->value); |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * gdk_content_serializer_get_value: |
| 213 | * @serializer: a `GdkContentSerializer` |
| 214 | * |
| 215 | * Gets the `GValue` to read the object to serialize from. |
| 216 | * |
| 217 | * Returns: (transfer none): the `GValue` for the current operation |
| 218 | */ |
| 219 | const GValuecxx . . $ GValue# * |
| 220 | gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 221 | { |
| 222 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 223 | |
| 224 | return &serializer->valuecxx . . $ _GdkContentSerializer#value.; |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * gdk_content_serializer_get_output_stream: |
| 229 | * @serializer: a `GdkContentSerializer` |
| 230 | * |
| 231 | * Gets the output stream for the current operation. |
| 232 | * |
| 233 | * This is the stream that was passed to [func@content_serialize_async]. |
| 234 | * |
| 235 | * Returns: (transfer none): the output stream for the current operation |
| 236 | */ |
| 237 | GOutputStreamcxx . . $ GOutputStream# * |
| 238 | gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 239 | { |
| 240 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 241 | |
| 242 | return serializer->streamcxx . . $ _GdkContentSerializer#stream.; |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * gdk_content_serializer_get_priority: |
| 247 | * @serializer: a `GdkContentSerializer` |
| 248 | * |
| 249 | * Gets the I/O priority for the current operation. |
| 250 | * |
| 251 | * This is the priority that was passed to [func@content_serialize_async]. |
| 252 | * |
| 253 | * Returns: the I/O priority for the current operation |
| 254 | */ |
| 255 | int |
| 256 | gdk_content_serializer_get_prioritycxx . . $ gdk_content_serializer_get_priority(7397e6e534b8eaab). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 257 | { |
| 258 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!); |
| 259 | |
| 260 | return serializer->prioritycxx . . $ _GdkContentSerializer#priority.; |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * gdk_content_serializer_get_cancellable: |
| 265 | * @serializer: a `GdkContentSerializer` |
| 266 | * |
| 267 | * Gets the cancellable for the current operation. |
| 268 | * |
| 269 | * This is the `GCancellable` that was passed to [func@content_serialize_async]. |
| 270 | * |
| 271 | * Returns: (transfer none) (nullable): the cancellable for the current operation |
| 272 | */ |
| 273 | GCancellablecxx . . $ GCancellable# * |
| 274 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 275 | { |
| 276 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 277 | |
| 278 | return serializer->cancellablecxx . . $ _GdkContentSerializer#cancellable.; |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * gdk_content_serializer_get_user_data: |
| 283 | * @serializer: a `GdkContentSerializer` |
| 284 | * |
| 285 | * Gets the user data that was passed when the serializer was registered. |
| 286 | * |
| 287 | * Returns: (transfer none): the user data for this serializer |
| 288 | */ |
| 289 | gpointercxx . . $ gpointer# |
| 290 | gdk_content_serializer_get_user_datacxx . . $ gdk_content_serializer_get_user_data(a00fb8e1e97e7905). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 291 | { |
| 292 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 293 | |
| 294 | return serializer->user_datacxx . . $ _GdkContentSerializer#user_data.; |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * gdk_content_serializer_set_task_data: |
| 299 | * @serializer: a `GdkContentSerializer` |
| 300 | * @data: data to associate with this operation |
| 301 | * @notify: destroy notify for @data |
| 302 | * |
| 303 | * Associate data with the current serialization operation. |
| 304 | */ |
| 305 | void |
| 306 | gdk_content_serializer_set_task_datacxx . . $ gdk_content_serializer_set_task_data(e0e3f4ef95ab24bc). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer, |
| 307 | gpointercxx . . $ gpointer# data, |
| 308 | GDestroyNotifycxx . . $ GDestroyNotify# notify) |
| 309 | { |
| 310 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer)); |
| 311 | |
| 312 | if (serializer->task_notifycxx . . $ _GdkContentSerializer#task_notify.) |
| 313 | serializer->task_notifycxx . . $ _GdkContentSerializer#task_notify. (serializer->task_datacxx . . $ _GdkContentSerializer#task_data.); |
| 314 | |
| 315 | serializer->task_datacxx . . $ _GdkContentSerializer#task_data. = data; |
| 316 | serializer->task_notifycxx . . $ _GdkContentSerializer#task_notify. = notify; |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * gdk_content_serializer_get_task_data: |
| 321 | * @serializer: a `GdkContentSerializer` |
| 322 | * |
| 323 | * Gets the data that was associated with the current operation. |
| 324 | * |
| 325 | * See [[email protected]_task_data]. |
| 326 | * |
| 327 | * Returns: (transfer none): the task data for @serializer |
| 328 | */ |
| 329 | gpointercxx . . $ gpointer# |
| 330 | gdk_content_serializer_get_task_datacxx . . $ gdk_content_serializer_get_task_data(a00fb8e1e97e7905). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 331 | { |
| 332 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 333 | |
| 334 | return serializer->task_datacxx . . $ _GdkContentSerializer#task_data.; |
| 335 | } |
| 336 | |
| 337 | static gbooleancxx . . $ gboolean# |
| 338 | gdk_content_serializer_emit_callbackcxx . . $ gdk_content_serializer_emit_callback(dedf1e9b1c614a07). (gpointercxx . . $ gpointer# data) |
| 339 | { |
| 340 | GdkContentSerializercxx . . $ GdkContentSerializer# *serializer = data; |
| 341 | |
| 342 | if (serializer->callbackcxx . . $ _GdkContentSerializer#callback.) |
| 343 | { |
| 344 | serializer->callbackcxx . . $ _GdkContentSerializer#callback. (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, G_ASYNC_RESULTcxx . . $ `<external>/3523893862415901422/gasyncresult.h:35:9`! (serializer), serializer->callback_datacxx . . $ _GdkContentSerializer#callback_data.); |
| 345 | } |
| 346 | |
| 347 | return G_SOURCE_REMOVEcxx . . $ `<external>/1856471541377536744/gmain.h:475:9`!; |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * gdk_content_serializer_return_success: |
| 352 | * @serializer: a `GdkContentSerializer` |
| 353 | * |
| 354 | * Indicate that the serialization has been successfully completed. |
| 355 | */ |
| 356 | void |
| 357 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 358 | { |
| 359 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer)); |
| 360 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (!serializer->returned); |
| 361 | guintcxx . . $ guint# source_id; |
| 362 | |
| 363 | serializer->returnedcxx . . $ _GdkContentSerializer#returned. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 364 | source_id = g_idle_add_fullcxx . . $ g_idle_add_full(45e19b0935db1869). (serializer->prioritycxx . . $ _GdkContentSerializer#priority., |
| 365 | gdk_content_serializer_emit_callbackcxx . . $ gdk_content_serializer_emit_callback(dedf1e9b1c614a07)., |
| 366 | serializer, |
| 367 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 368 | gdk_source_set_static_name_by_idcxx . . $ gdk_source_set_static_name_by_id(d7adf5cfafc0e15a). (source_id, "[gtk] gdk_content_serializer_emit_callback"); |
| 369 | /* NB: the idle will destroy our reference */ |
| 370 | } |
| 371 | |
| 372 | /** |
| 373 | * gdk_content_serializer_return_error: |
| 374 | * @serializer: a `GdkContentSerializer` |
| 375 | * @error: (transfer full): a `GError` |
| 376 | * |
| 377 | * Indicate that the serialization has ended with an error. |
| 378 | * |
| 379 | * This function consumes @error. |
| 380 | */ |
| 381 | void |
| 382 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer, |
| 383 | GErrorcxx . . $ GError# *error) |
| 384 | { |
| 385 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (serializer)); |
| 386 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (!serializer->returned); |
| 387 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (error != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 388 | |
| 389 | serializer->errorcxx . . $ _GdkContentSerializer#error. = error; |
| 390 | /* FIXME: naming */ |
| 391 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * gdk_content_register_serializer: |
| 396 | * @type: the type of objects that the function can serialize |
| 397 | * @mime_type: the mime type to serialize to |
| 398 | * @serialize: the callback |
| 399 | * @data: data that @serialize can access |
| 400 | * @notify: destroy notify for @data |
| 401 | * |
| 402 | * Registers a function to serialize objects of a given type. |
| 403 | * |
| 404 | * Since 4.20, when looking up a serializer to use, GTK will |
| 405 | * use the last registered serializer for a given mime type, |
| 406 | * so applications can override the built-in serializers. |
| 407 | */ |
| 408 | void |
| 409 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GTypecxx . . $ GType# type, |
| 410 | const char *mime_type, |
| 411 | GdkContentSerializeFunccxx . . $ GdkContentSerializeFunc# serialize, |
| 412 | gpointercxx . . $ gpointer# data, |
| 413 | GDestroyNotifycxx . . $ GDestroyNotify# notify) |
| 414 | { |
| 415 | Serializercxx . . $ Serializer# *serializer; |
| 416 | |
| 417 | 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`!); |
| 418 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (serialize != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 419 | |
| 420 | serializer = g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (Serializer, 1); |
| 421 | |
| 422 | serializer->mime_typecxx . . $ _Serializer#mime_type. = g_intern_stringcxx . . $ g_intern_string(fb58d2e09a2a1ce6). (mime_type); |
| 423 | serializer->typecxx . . $ _Serializer#type. = type; |
| 424 | serializer->serializecxx . . $ _Serializer#serialize. = serialize; |
| 425 | serializer->datacxx . . $ _Serializer#data. = data; |
| 426 | serializer->notifycxx . . $ _Serializer#notify. = notify; |
| 427 | |
| 428 | g_queue_push_tailcxx . . $ g_queue_push_tail(e8f7e029e141fccb). (&serializerscxx . . $ serializers., serializer); |
| 429 | } |
| 430 | |
| 431 | static Serializercxx . . $ Serializer# * |
| 432 | lookup_serializercxx . . $ lookup_serializer(c9c9c60932ba3d88). (const char *mime_type, |
| 433 | GTypecxx . . $ GType# type) |
| 434 | { |
| 435 | GListcxx . . $ GList# *l; |
| 436 | |
| 437 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (mime_type != 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`!); |
| 438 | |
| 439 | mime_type = g_intern_stringcxx . . $ g_intern_string(fb58d2e09a2a1ce6). (mime_type); |
| 440 | |
| 441 | for (l = g_queue_peek_tail_linkcxx . . $ g_queue_peek_tail_link(17391f9498add0b5). (&serializerscxx . . $ serializers.); l; l = l->prevcxx . . $ _GList#prev.) |
| 442 | { |
| 443 | Serializercxx . . $ Serializer# *serializer = l->datacxx . . $ _GList#data.; |
| 444 | |
| 445 | if (serializer->mime_typecxx . . $ _Serializer#mime_type. == mime_type && |
| 446 | serializer->typecxx . . $ _Serializer#type. == type) |
| 447 | return serializer; |
| 448 | } |
| 449 | |
| 450 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 451 | } |
| 452 | |
| 453 | /** |
| 454 | * gdk_content_formats_union_serialize_gtypes: |
| 455 | * @formats: (transfer full): a `GdkContentFormats` |
| 456 | * |
| 457 | * Add GTypes for the mime types in @formats for which serializers are |
| 458 | * registered. |
| 459 | * |
| 460 | * Return: a new `GdkContentFormats` |
| 461 | */ |
| 462 | GdkContentFormatscxx . . $ GdkContentFormats# * |
| 463 | gdk_content_formats_union_serialize_gtypescxx . . $ gdk_content_formats_union_serialize_gtypes(f9c6e94556d0b4d1). (GdkContentFormatscxx . . $ GdkContentFormats# *formats) |
| 464 | { |
| 465 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 466 | GListcxx . . $ GList# *l; |
| 467 | |
| 468 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (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`!); |
| 469 | |
| 470 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 471 | gdk_content_formats_builder_add_formatscxx . . $ gdk_content_formats_builder_add_formats(516a628538e39cad). (builder, formats); |
| 472 | |
| 473 | for (l = g_queue_peek_head_linkcxx . . $ g_queue_peek_head_link(17391f9498add0b5). (&serializerscxx . . $ serializers.); l; l = l->nextcxx . . $ _GList#next.) |
| 474 | { |
| 475 | Serializercxx . . $ Serializer# *serializer = l->datacxx . . $ _GList#data.; |
| 476 | |
| 477 | if (gdk_content_formats_contain_mime_typecxx . . $ gdk_content_formats_contain_mime_type(b2b52adaeb9a7ddb). (formats, serializer->mime_typecxx . . $ _Serializer#mime_type.)) |
| 478 | gdk_content_formats_builder_add_gtypecxx . . $ gdk_content_formats_builder_add_gtype(1fd9ff67a5fc1cf8). (builder, serializer->typecxx . . $ _Serializer#type.); |
| 479 | } |
| 480 | |
| 481 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 482 | |
| 483 | return gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 484 | } |
| 485 | |
| 486 | /** |
| 487 | * gdk_content_formats_union_serialize_mime_types: |
| 488 | * @formats: (transfer full): a `GdkContentFormats` |
| 489 | * |
| 490 | * Add mime types for GTypes in @formats for which serializers are |
| 491 | * registered. |
| 492 | * |
| 493 | * Return: a new `GdkContentFormats` |
| 494 | */ |
| 495 | GdkContentFormatscxx . . $ GdkContentFormats# * |
| 496 | gdk_content_formats_union_serialize_mime_typescxx . . $ gdk_content_formats_union_serialize_mime_types(f9c6e94556d0b4d1). (GdkContentFormatscxx . . $ GdkContentFormats# *formats) |
| 497 | { |
| 498 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 499 | GListcxx . . $ GList# *l; |
| 500 | |
| 501 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (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`!); |
| 502 | |
| 503 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 504 | gdk_content_formats_builder_add_formatscxx . . $ gdk_content_formats_builder_add_formats(516a628538e39cad). (builder, formats); |
| 505 | |
| 506 | for (l = g_queue_peek_head_linkcxx . . $ g_queue_peek_head_link(17391f9498add0b5). (&serializerscxx . . $ serializers.); l; l = l->nextcxx . . $ _GList#next.) |
| 507 | { |
| 508 | Serializercxx . . $ Serializer# *serializer = l->datacxx . . $ _GList#data.; |
| 509 | |
| 510 | if (gdk_content_formats_contain_gtypecxx . . $ gdk_content_formats_contain_gtype(9ffac0e9ca33ae02). (formats, serializer->typecxx . . $ _Serializer#type.)) |
| 511 | gdk_content_formats_builder_add_mime_typecxx . . $ gdk_content_formats_builder_add_mime_type(e4c81f4e70379c75). (builder, serializer->mime_typecxx . . $ _Serializer#mime_type.); |
| 512 | } |
| 513 | |
| 514 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (formats); |
| 515 | |
| 516 | return gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 517 | } |
| 518 | |
| 519 | static void |
| 520 | serialize_not_foundcxx . . $ serialize_not_found(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 521 | { |
| 522 | GErrorcxx . . $ GError# *error = g_error_newcxx . . $ g_error_new(c11b45e4af983f9e). (G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, |
| 523 | G_IO_ERROR_NOT_FOUNDcxx . . $ G_IO_ERROR_NOT_FOUND., |
| 524 | "Could not convert data from %s to %s", |
| 525 | g_type_namecxx . . $ g_type_name(30dde979ed96a187). (gdk_content_serializer_get_gtypecxx . . $ gdk_content_serializer_get_gtype(5dd1a7ecaa1fd4b). (serializer)), |
| 526 | gdk_content_serializer_get_mime_typecxx . . $ gdk_content_serializer_get_mime_type(e827523a3335623f). (serializer)); |
| 527 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 528 | } |
| 529 | |
| 530 | /** |
| 531 | * gdk_content_serialize_async: |
| 532 | * @stream: a `GOutputStream` to write the serialized content to |
| 533 | * @mime_type: the mime type to serialize to |
| 534 | * @value: the content to serialize |
| 535 | * @io_priority: the I/O priority of the operation |
| 536 | * @cancellable: (nullable): optional `GCancellable` object |
| 537 | * @callback: (scope async) (closure): callback to call when the operation is done |
| 538 | * @user_data: data to pass to the callback function |
| 539 | * |
| 540 | * Serialize content and write it to the given output stream, asynchronously. |
| 541 | * |
| 542 | * The default I/O priority is %G_PRIORITY_DEFAULT (i.e. 0), and lower numbers |
| 543 | * indicate a higher priority. |
| 544 | */ |
| 545 | void |
| 546 | gdk_content_serialize_asynccxx . . $ gdk_content_serialize_async(de4533add184f2ee). (GOutputStreamcxx . . $ GOutputStream# *stream, |
| 547 | const char *mime_type, |
| 548 | const GValuecxx . . $ GValue# *value, |
| 549 | int io_priority, |
| 550 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 551 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 552 | gpointercxx . . $ gpointer# user_data) |
| 553 | { |
| 554 | Serializercxx . . $ Serializer# *serializer; |
| 555 | |
| 556 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (G_IS_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:37:9`! (stream)); |
| 557 | 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)); |
| 558 | 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`!); |
| 559 | |
| 560 | serializer = lookup_serializercxx . . $ lookup_serializer(c9c9c60932ba3d88). (mime_type, G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (value)); |
| 561 | |
| 562 | gdk_content_serializer_runcxx . . $ gdk_content_serializer_run(a946c1e91b8f778d). (mime_type, |
| 563 | value, |
| 564 | stream, |
| 565 | io_priority, |
| 566 | cancellable, |
| 567 | serializer ? serializer->serializecxx . . $ _Serializer#serialize. : serialize_not_foundcxx . . $ serialize_not_found(9ebddb52e2aecd59)., |
| 568 | serializer ? serializer->datacxx . . $ _Serializer#data. : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 569 | callback, |
| 570 | user_data); |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * gdk_content_serialize_finish: |
| 575 | * @result: the `GAsyncResult` |
| 576 | * @error: return location for an error |
| 577 | * |
| 578 | * Finishes a content serialization operation. |
| 579 | * |
| 580 | * Returns: %TRUE if the operation was successful, %FALSE if an |
| 581 | * error occurred. In this case, @error is set |
| 582 | */ |
| 583 | gbooleancxx . . $ gboolean# |
| 584 | gdk_content_serialize_finishcxx . . $ gdk_content_serialize_finish(aff244c0ed8a2285). (GAsyncResultcxx . . $ GAsyncResult# *result, |
| 585 | GErrorcxx . . $ GError# **error) |
| 586 | { |
| 587 | GdkContentSerializercxx . . $ GdkContentSerializer# *serializer; |
| 588 | |
| 589 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:30:9`! (result), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 590 | 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`!); |
| 591 | |
| 592 | serializer = GDK_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:29:9`! (result); |
| 593 | |
| 594 | if (serializer->errorcxx . . $ _GdkContentSerializer#error.) |
| 595 | { |
| 596 | if (error) |
| 597 | *error = g_error_copycxx . . $ g_error_copy(34f4875c1a1b6692). (serializer->errorcxx . . $ _GdkContentSerializer#error.); |
| 598 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 599 | } |
| 600 | |
| 601 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 602 | } |
| 603 | |
| 604 | /*** SERIALIZERS ***/ |
| 605 | |
| 606 | |
| 607 | static void |
| 608 | pixbuf_serializer_finishcxx . . $ pixbuf_serializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 609 | GAsyncResultcxx . . $ GAsyncResult# *res, |
| 610 | gpointercxx . . $ gpointer# serializer) |
| 611 | { |
| 612 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 613 | |
| 614 | if (!gdk_pixbuf_save_to_stream_finishcxx . . $ gdk_pixbuf_save_to_stream_finish(aff244c0ed8a2285). (res, &error)) |
| 615 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 616 | else |
| 617 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 618 | } |
| 619 | |
| 620 | static void |
| 621 | pixbuf_serializercxx . . $ pixbuf_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 622 | { |
| 623 | const GValuecxx . . $ GValue# *value; |
| 624 | GdkPixbufcxx . . $ GdkPixbuf# *pixbuf; |
| 625 | const char *name; |
| 626 | |
| 627 | name = gdk_content_serializer_get_user_datacxx . . $ gdk_content_serializer_get_user_data(a00fb8e1e97e7905). (serializer); |
| 628 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 629 | |
| 630 | if (G_VALUE_HOLDScxx . . $ `<external>/17218264759549183453/gvalue.h:91:9`! (value, GDK_TYPE_PIXBUFcxx . . $ `<external>/2450585506247012820/gdk-pixbuf-core.h:91:9`!)) |
| 631 | { |
| 632 | pixbuf = g_value_dup_objectcxx . . $ g_value_dup_object(e12dff36056c2cce). (value); |
| 633 | } |
| 634 | else if (G_VALUE_HOLDScxx . . $ `<external>/17218264759549183453/gvalue.h:91:9`! (value, GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!)) |
| 635 | { |
| 636 | GdkTexturecxx . . $ GdkTexture# *texture = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value); |
| 637 | G_GNUC_BEGIN_IGNORE_DEPRECATIONScxx . . $ `<external>/12741050725406041920/gmacros.h:771:9`! |
| 638 | pixbuf = gdk_pixbuf_get_from_texturecxx . . $ gdk_pixbuf_get_from_texture(41c0dcd112a556fc). (texture); |
| 639 | G_GNUC_END_IGNORE_DEPRECATIONScxx . . $ `<external>/12741050725406041920/gmacros.h:774:9`! |
| 640 | } |
| 641 | else |
| 642 | { |
| 643 | g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! (); |
| 644 | } |
| 645 | |
| 646 | gdk_pixbuf_save_to_stream_asynccxx . . $ gdk_pixbuf_save_to_stream_async(99cf2ac29e6d84d6). (pixbuf, |
| 647 | gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 648 | name, |
| 649 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 650 | pixbuf_serializer_finishcxx . . $ pixbuf_serializer_finish(aa1d200d824d915d)., |
| 651 | serializer, |
| 652 | g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (name, "png") ? "compression" : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, "2", |
| 653 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 654 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (pixbuf); |
| 655 | } |
| 656 | |
| 657 | static void |
| 658 | texture_serializer_finishcxx . . $ texture_serializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 659 | GAsyncResultcxx . . $ GAsyncResult# *res, |
| 660 | gpointercxx . . $ gpointer# user_data) |
| 661 | { |
| 662 | GdkContentSerializercxx . . $ GdkContentSerializer# *serializer = GDK_CONTENT_SERIALIZERcxx . . $ `gdk/gdkcontentserializer.h:29:9`! (source); |
| 663 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 664 | |
| 665 | if (!g_task_propagate_booleancxx . . $ g_task_propagate_boolean(21d91baf98d56582). (G_TASKcxx . . $ `<external>/6581906438226475924/gtask.h:33:9`! (res), &error)) |
| 666 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 667 | else |
| 668 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 669 | } |
| 670 | |
| 671 | static void |
| 672 | serialize_texture_in_threadcxx . . $ serialize_texture_in_thread(4704ff26353eb8ae). (GTaskcxx . . $ GTask# *task, |
| 673 | gpointercxx . . $ gpointer# source_object, |
| 674 | gpointercxx . . $ gpointer# task_data, |
| 675 | GCancellablecxx . . $ GCancellable# *cancellable) |
| 676 | { |
| 677 | GdkContentSerializercxx . . $ GdkContentSerializer# *serializer = source_object; |
| 678 | const GValuecxx . . $ GValue# *value; |
| 679 | GdkTexturecxx . . $ GdkTexture# *texture; |
| 680 | GBytescxx . . $ GBytes# *bytes = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 681 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 682 | gbooleancxx . . $ gboolean# result = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 683 | GInputStreamcxx . . $ GInputStream# *input; |
| 684 | gssizecxx . . $ gssize# spliced; |
| 685 | |
| 686 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 687 | texture = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value); |
| 688 | |
| 689 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88). (gdk_content_serializer_get_mime_typecxx . . $ gdk_content_serializer_get_mime_type(e827523a3335623f). (serializer), "image/png") == 0) |
| 690 | bytes = gdk_save_pngcxx . . $ gdk_save_png(ec187d509ca4fbd9). (texture, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 691 | else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88). (gdk_content_serializer_get_mime_typecxx . . $ gdk_content_serializer_get_mime_type(e827523a3335623f). (serializer), "image/tiff") == 0) |
| 692 | bytes = gdk_save_tiffcxx . . $ gdk_save_tiff(a404c4dd36fb3b20). (texture); |
| 693 | else if (strcmpcxx . . $ strcmp(5ae29d726ae57f88). (gdk_content_serializer_get_mime_typecxx . . $ gdk_content_serializer_get_mime_type(e827523a3335623f). (serializer), "image/jpeg") == 0) |
| 694 | bytes = gdk_save_jpegcxx . . $ gdk_save_jpeg(a404c4dd36fb3b20). (texture); |
| 695 | else |
| 696 | g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! (); |
| 697 | |
| 698 | input = g_memory_input_stream_new_from_bytescxx . . $ g_memory_input_stream_new_from_bytes(3e8b91e3855b854f). (bytes); |
| 699 | spliced = g_output_stream_splicecxx . . $ g_output_stream_splice(49a55793bb3ba4a0). (gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 700 | input, |
| 701 | G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCEcxx . . $ G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE., |
| 702 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 703 | &error); |
| 704 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (input); |
| 705 | g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes); |
| 706 | |
| 707 | result = spliced != -1; |
| 708 | |
| 709 | if (result) |
| 710 | g_task_return_booleancxx . . $ g_task_return_boolean(b34b01b5a2b59ad8). (task, result); |
| 711 | else |
| 712 | g_task_return_errorcxx . . $ g_task_return_error(3a392c0ba1e0b727). (task, error); |
| 713 | } |
| 714 | |
| 715 | static void |
| 716 | texture_serializercxx . . $ texture_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 717 | { |
| 718 | GTaskcxx . . $ GTask# *task; |
| 719 | |
| 720 | task = g_task_newcxx . . $ g_task_new(292d224db8478659). (serializer, |
| 721 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 722 | texture_serializer_finishcxx . . $ texture_serializer_finish(aa1d200d824d915d)., |
| 723 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 724 | g_task_run_in_threadcxx . . $ g_task_run_in_thread(9210d4c97157796e). (task, serialize_texture_in_threadcxx . . $ serialize_texture_in_thread(4704ff26353eb8ae).); |
| 725 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (task); |
| 726 | } |
| 727 | |
| 728 | static void |
| 729 | string_serializer_finishcxx . . $ string_serializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 730 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 731 | gpointercxx . . $ gpointer# serializer) |
| 732 | { |
| 733 | GOutputStreamcxx . . $ GOutputStream# *stream = G_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:35:9`! (source); |
| 734 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 735 | |
| 736 | if (!g_output_stream_write_all_finishcxx . . $ g_output_stream_write_all_finish(c05eaa1a255c2427). (stream, result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error)) |
| 737 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 738 | else |
| 739 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 740 | } |
| 741 | |
| 742 | static void |
| 743 | string_serializercxx . . $ string_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 744 | { |
| 745 | GOutputStreamcxx . . $ GOutputStream# *filter; |
| 746 | GCharsetConvertercxx . . $ GCharsetConverter# *converter; |
| 747 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 748 | const char *text; |
| 749 | |
| 750 | converter = g_charset_converter_newcxx . . $ g_charset_converter_new(bda6055c7175a8eb). (gdk_content_serializer_get_user_datacxx . . $ gdk_content_serializer_get_user_data(a00fb8e1e97e7905). (serializer), |
| 751 | "utf-8", |
| 752 | &error); |
| 753 | if (converter == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 754 | { |
| 755 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 756 | return; |
| 757 | } |
| 758 | g_charset_converter_set_use_fallbackcxx . . $ g_charset_converter_set_use_fallback(200715f696c97678). (converter, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 759 | |
| 760 | filter = g_converter_output_stream_newcxx . . $ g_converter_output_stream_new(a0b289c84cbbc470). (gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 761 | G_CONVERTERcxx . . $ `<external>/1417193864360154349/gconverter.h:35:9`! (converter)); |
| 762 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (converter); |
| 763 | |
| 764 | text = g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer)); |
| 765 | if (text == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 766 | text = ""; |
| 767 | |
| 768 | g_output_stream_write_all_asynccxx . . $ g_output_stream_write_all_async(50e9e3a461521cd4). (filter, |
| 769 | text, |
| 770 | strlencxx . . $ strlen(751346f8406fd082). (text), |
| 771 | gdk_content_serializer_get_prioritycxx . . $ gdk_content_serializer_get_priority(7397e6e534b8eaab). (serializer), |
| 772 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 773 | string_serializer_finishcxx . . $ string_serializer_finish(aa1d200d824d915d)., |
| 774 | serializer); |
| 775 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (filter); |
| 776 | } |
| 777 | |
| 778 | static void |
| 779 | file_serializer_finishcxx . . $ file_serializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 780 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 781 | gpointercxx . . $ gpointer# serializer) |
| 782 | { |
| 783 | GOutputStreamcxx . . $ GOutputStream# *stream = G_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:35:9`! (source); |
| 784 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 785 | |
| 786 | if (!g_output_stream_write_all_finishcxx . . $ g_output_stream_write_all_finish(c05eaa1a255c2427). (stream, result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error)) |
| 787 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 788 | else |
| 789 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 790 | } |
| 791 | |
| 792 | |
| 793 | static const char * |
| 794 | file_force_uri_schemascxx . . $ file_force_uri_schemas.[] = { "content", "http", "https" }; |
| 795 | static char * |
| 796 | file_get_native_uricxx . . $ file_get_native_uri(bd69fa69840f32a9). (GFilecxx . . $ GFile# *file) |
| 797 | { |
| 798 | char *path; |
| 799 | |
| 800 | /* |
| 801 | * We want to convert URIs to file:// URIs, so other applications |
| 802 | * that do not use GIO/GVFS can read text/uri-list from the clipboard. |
| 803 | * |
| 804 | * But we don't want to do that for URIs that are widely understood, |
| 805 | * so for lack of better APIs, we whitelist those. |
| 806 | */ |
| 807 | for (gsizecxx . . $ gsize# i = 0; i < G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (file_force_uri_schemas); i++) |
| 808 | if (g_file_has_uri_schemecxx . . $ g_file_has_uri_scheme(9805bf3891cc7879). (file, file_force_uri_schemascxx . . $ file_force_uri_schemas.[i])) |
| 809 | return g_file_get_uricxx . . $ g_file_get_uri(bd69fa69840f32a9). (file); |
| 810 | |
| 811 | path = g_file_get_pathcxx . . $ g_file_get_path(bd69fa69840f32a9). (file); |
| 812 | if (path != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 813 | { |
| 814 | char *uri = g_filename_to_uricxx . . $ g_filename_to_uri(aa426d2e062653f5). (path, 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`!); |
| 815 | g_freecxx . . $ g_free(5d22bdacc48458e8). (path); |
| 816 | return uri; |
| 817 | } |
| 818 | |
| 819 | return g_file_get_uricxx . . $ g_file_get_uri(bd69fa69840f32a9). (file); |
| 820 | } |
| 821 | |
| 822 | static void |
| 823 | file_uri_serializercxx . . $ file_uri_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 824 | { |
| 825 | GFilecxx . . $ GFile# *file; |
| 826 | GStringcxx . . $ GString# *str; |
| 827 | const GValuecxx . . $ GValue# *value; |
| 828 | char *uri; |
| 829 | |
| 830 | str = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 831 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 832 | |
| 833 | if (G_VALUE_HOLDScxx . . $ `<external>/17218264759549183453/gvalue.h:91:9`! (value, G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`!)) |
| 834 | { |
| 835 | file = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer)); |
| 836 | if (file) |
| 837 | { |
| 838 | uri = file_get_native_uricxx . . $ file_get_native_uri(bd69fa69840f32a9). (file); |
| 839 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, uri); |
| 840 | g_freecxx . . $ g_free(5d22bdacc48458e8). (uri); |
| 841 | } |
| 842 | else |
| 843 | { |
| 844 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, "# GTK does not crash when copying a NULL GFile!"); |
| 845 | } |
| 846 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, "\r\n"); |
| 847 | } |
| 848 | else if (G_VALUE_HOLDScxx . . $ `<external>/17218264759549183453/gvalue.h:91:9`! (value, GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`!)) |
| 849 | { |
| 850 | GSListcxx . . $ GSList# *l; |
| 851 | |
| 852 | for (l = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (value); l; l = l->nextcxx . . $ _GSList#next.) |
| 853 | { |
| 854 | uri = file_get_native_uricxx . . $ file_get_native_uri(bd69fa69840f32a9). (l->datacxx . . $ _GSList#data.); |
| 855 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, uri); |
| 856 | g_freecxx . . $ g_free(5d22bdacc48458e8). (uri); |
| 857 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, "\r\n"); |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | g_output_stream_write_all_asynccxx . . $ g_output_stream_write_all_async(50e9e3a461521cd4). (gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 862 | str->strcxx . . $ _GString#str., |
| 863 | str->lencxx . . $ _GString#len., |
| 864 | gdk_content_serializer_get_prioritycxx . . $ gdk_content_serializer_get_priority(7397e6e534b8eaab). (serializer), |
| 865 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 866 | file_serializer_finishcxx . . $ file_serializer_finish(aa1d200d824d915d)., |
| 867 | serializer); |
| 868 | gdk_content_serializer_set_task_datacxx . . $ gdk_content_serializer_set_task_data(e0e3f4ef95ab24bc). (serializer, g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (str, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 869 | } |
| 870 | |
| 871 | static void |
| 872 | file_text_serializercxx . . $ file_text_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 873 | { |
| 874 | const GValuecxx . . $ GValue# *value; |
| 875 | char *path = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 876 | |
| 877 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 878 | |
| 879 | if (G_VALUE_HOLDScxx . . $ `<external>/17218264759549183453/gvalue.h:91:9`! (value, G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`!)) |
| 880 | { |
| 881 | GFilecxx . . $ GFile# *file; |
| 882 | |
| 883 | file = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value); |
| 884 | if (file) |
| 885 | { |
| 886 | path = g_file_get_pathcxx . . $ g_file_get_path(bd69fa69840f32a9). (file); |
| 887 | if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 888 | path = g_file_get_uricxx . . $ g_file_get_uri(bd69fa69840f32a9). (file); |
| 889 | } |
| 890 | } |
| 891 | else if (G_VALUE_HOLDScxx . . $ `<external>/17218264759549183453/gvalue.h:91:9`! (value, GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`!)) |
| 892 | { |
| 893 | GStringcxx . . $ GString# *str; |
| 894 | GSListcxx . . $ GSList# *l; |
| 895 | |
| 896 | str = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 897 | |
| 898 | for (l = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (value); l; l = l->nextcxx . . $ _GSList#next.) |
| 899 | { |
| 900 | path = g_file_get_pathcxx . . $ g_file_get_path(bd69fa69840f32a9). (l->datacxx . . $ _GSList#data.); |
| 901 | if (path == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 902 | path = g_file_get_uricxx . . $ g_file_get_uri(bd69fa69840f32a9). (l->datacxx . . $ _GSList#data.); |
| 903 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, path); |
| 904 | g_freecxx . . $ g_free(5d22bdacc48458e8). (path); |
| 905 | if (l->nextcxx . . $ _GSList#next.) |
| 906 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (str, "\n"); |
| 907 | } |
| 908 | path = g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (str, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 909 | } |
| 910 | |
| 911 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (path != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 912 | |
| 913 | g_output_stream_write_all_asynccxx . . $ g_output_stream_write_all_async(50e9e3a461521cd4). (gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 914 | path, |
| 915 | strlencxx . . $ strlen(751346f8406fd082). (path), |
| 916 | gdk_content_serializer_get_prioritycxx . . $ gdk_content_serializer_get_priority(7397e6e534b8eaab). (serializer), |
| 917 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 918 | file_serializer_finishcxx . . $ file_serializer_finish(aa1d200d824d915d)., |
| 919 | serializer); |
| 920 | gdk_content_serializer_set_task_datacxx . . $ gdk_content_serializer_set_task_data(e0e3f4ef95ab24bc). (serializer, path, g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 921 | } |
| 922 | |
| 923 | static void |
| 924 | color_serializer_finishcxx . . $ color_serializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 925 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 926 | gpointercxx . . $ gpointer# serializer) |
| 927 | { |
| 928 | GOutputStreamcxx . . $ GOutputStream# *stream = G_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:35:9`! (source); |
| 929 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 930 | |
| 931 | if (!g_output_stream_write_all_finishcxx . . $ g_output_stream_write_all_finish(c05eaa1a255c2427). (stream, result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error)) |
| 932 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 933 | else |
| 934 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 935 | } |
| 936 | |
| 937 | static void |
| 938 | color_serializercxx . . $ color_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 939 | { |
| 940 | const GValuecxx . . $ GValue# *value; |
| 941 | GdkRGBAcxx . . $ GdkRGBA# *rgba; |
| 942 | guint16cxx . . $ guint16# *data; |
| 943 | |
| 944 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 945 | rgba = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (value); |
| 946 | data = g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (guint16, 4); |
| 947 | if (rgba) |
| 948 | { |
| 949 | data[0] = (guint16cxx . . $ guint16#) (rgba->redcxx . . $ _GdkRGBA#red. * 65535); |
| 950 | data[1] = (guint16cxx . . $ guint16#) (rgba->greencxx . . $ _GdkRGBA#green. * 65535); |
| 951 | data[2] = (guint16cxx . . $ guint16#) (rgba->bluecxx . . $ _GdkRGBA#blue. * 65535); |
| 952 | data[3] = (guint16cxx . . $ guint16#) (rgba->alphacxx . . $ _GdkRGBA#alpha. * 65535); |
| 953 | } |
| 954 | |
| 955 | g_output_stream_write_all_asynccxx . . $ g_output_stream_write_all_async(50e9e3a461521cd4). (gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 956 | data, |
| 957 | 4 * sizeof (guint16cxx . . $ guint16#), |
| 958 | gdk_content_serializer_get_prioritycxx . . $ gdk_content_serializer_get_priority(7397e6e534b8eaab). (serializer), |
| 959 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 960 | color_serializer_finishcxx . . $ color_serializer_finish(aa1d200d824d915d)., |
| 961 | serializer); |
| 962 | gdk_content_serializer_set_task_datacxx . . $ gdk_content_serializer_set_task_data(e0e3f4ef95ab24bc). (serializer, data, g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 963 | } |
| 964 | |
| 965 | void |
| 966 | gdk_content_init_serializerscxx . . $ gdk_content_init_serializers(49f6e7a06ebc5aa8). (void) |
| 967 | { |
| 968 | static gbooleancxx . . $ gboolean# initialized = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 969 | GSListcxx . . $ GSList# *formats, *f; |
| 970 | const char *charset; |
| 971 | |
| 972 | if (initialized) |
| 973 | return; |
| 974 | |
| 975 | initialized = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 976 | |
| 977 | /* Textures */ |
| 978 | |
| 979 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!, |
| 980 | "image/png", |
| 981 | texture_serializercxx . . $ texture_serializer(9ebddb52e2aecd59)., |
| 982 | 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`!); |
| 983 | |
| 984 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!, |
| 985 | "image/tiff", |
| 986 | texture_serializercxx . . $ texture_serializer(9ebddb52e2aecd59)., |
| 987 | 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`!); |
| 988 | |
| 989 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!, |
| 990 | "image/jpeg", |
| 991 | texture_serializercxx . . $ texture_serializer(9ebddb52e2aecd59)., |
| 992 | 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`!); |
| 993 | |
| 994 | formats = gdk_pixbuf_get_formatscxx . . $ gdk_pixbuf_get_formats(ac8c5e3d2c648916). (); |
| 995 | |
| 996 | for (f = formats; f; f = f->nextcxx . . $ _GSList#next.) |
| 997 | { |
| 998 | GdkPixbufFormatcxx . . $ GdkPixbufFormat# *fmt = f->datacxx . . $ _GSList#data.; |
| 999 | char **mimes, **m; |
| 1000 | char *name; |
| 1001 | |
| 1002 | if (!gdk_pixbuf_format_is_writablecxx . . $ gdk_pixbuf_format_is_writable(ca0cfd0e34bff382). (fmt)) |
| 1003 | continue; |
| 1004 | |
| 1005 | name = gdk_pixbuf_format_get_namecxx . . $ gdk_pixbuf_format_get_name(a52bbad32609dbc9). (fmt); |
| 1006 | mimes = gdk_pixbuf_format_get_mime_typescxx . . $ gdk_pixbuf_format_get_mime_types(892906d4c2897ef3). (fmt); |
| 1007 | for (m = mimes; *m; m++) |
| 1008 | { |
| 1009 | /* Turning textures into pngs, tiffs or jpegs is handled above */ |
| 1010 | if (!g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (name, "png") && |
| 1011 | !g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (name, "tiff") && |
| 1012 | !g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (name, "jpeg")) |
| 1013 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!, |
| 1014 | *m, |
| 1015 | pixbuf_serializercxx . . $ pixbuf_serializer(9ebddb52e2aecd59)., |
| 1016 | gdk_pixbuf_format_get_namecxx . . $ gdk_pixbuf_format_get_name(a52bbad32609dbc9). (fmt), |
| 1017 | g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 1018 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_PIXBUFcxx . . $ `<external>/2450585506247012820/gdk-pixbuf-core.h:91:9`!, |
| 1019 | *m, |
| 1020 | pixbuf_serializercxx . . $ pixbuf_serializer(9ebddb52e2aecd59)., |
| 1021 | gdk_pixbuf_format_get_namecxx . . $ gdk_pixbuf_format_get_name(a52bbad32609dbc9). (fmt), |
| 1022 | g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 1023 | } |
| 1024 | g_strfreevcxx . . $ g_strfreev(3ed91490e421178f). (mimes); |
| 1025 | g_freecxx . . $ g_free(5d22bdacc48458e8). (name); |
| 1026 | } |
| 1027 | |
| 1028 | g_slist_freecxx . . $ g_slist_free(e7f64dba92841206). (formats); |
| 1029 | |
| 1030 | /* Files */ |
| 1031 | |
| 1032 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`!, |
| 1033 | "text/plain;charset=utf-8", |
| 1034 | file_text_serializercxx . . $ file_text_serializer(9ebddb52e2aecd59)., |
| 1035 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1036 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1037 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`!, |
| 1038 | "text/uri-list", |
| 1039 | file_uri_serializercxx . . $ file_uri_serializer(9ebddb52e2aecd59)., |
| 1040 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1041 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1042 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`!, |
| 1043 | "text/plain;charset=utf-8", |
| 1044 | file_text_serializercxx . . $ file_text_serializer(9ebddb52e2aecd59)., |
| 1045 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1046 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1047 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`!, |
| 1048 | "text/uri-list", |
| 1049 | file_uri_serializercxx . . $ file_uri_serializer(9ebddb52e2aecd59)., |
| 1050 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1051 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1052 | |
| 1053 | #if defined(G_OS_UNIXcxx . . $ `<external>/10505296616216143549/glibconfig.h:120:9`!) && !defined(__APPLE__) |
| 1054 | file_transfer_portal_registercxx . . $ file_transfer_portal_register(49f6e7a06ebc5aa8). (); |
| 1055 | #endif |
| 1056 | |
| 1057 | /* Strings */ |
| 1058 | |
| 1059 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!, |
| 1060 | "text/plain;charset=utf-8", |
| 1061 | string_serializercxx . . $ string_serializer(9ebddb52e2aecd59)., |
| 1062 | (gpointercxx . . $ gpointer#) "utf-8", |
| 1063 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1064 | |
| 1065 | if (!g_get_charsetcxx . . $ g_get_charset(15355eb6db2855df). (&charset)) |
| 1066 | { |
| 1067 | char *mime = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("text/plain;charset=%s", charset); |
| 1068 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!, |
| 1069 | mime, |
| 1070 | string_serializercxx . . $ string_serializer(9ebddb52e2aecd59)., |
| 1071 | (gpointercxx . . $ gpointer#) charset, |
| 1072 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1073 | g_freecxx . . $ g_free(5d22bdacc48458e8). (mime); |
| 1074 | } |
| 1075 | |
| 1076 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!, |
| 1077 | "text/plain", |
| 1078 | string_serializercxx . . $ string_serializer(9ebddb52e2aecd59)., |
| 1079 | (gpointercxx . . $ gpointer#) "ASCII", |
| 1080 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1081 | |
| 1082 | /* Colors */ |
| 1083 | |
| 1084 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (GDK_TYPE_RGBAcxx . . $ `gdk/gdkrgba.h:43:9`!, |
| 1085 | "application/x-color", |
| 1086 | color_serializercxx . . $ color_serializer(9ebddb52e2aecd59)., |
| 1087 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 1088 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1089 | } |
| 1090 |