| 1 | /* GTK - The GIMP Toolkit |
| 2 | * Copyright (C) 1995-1999 Peter Mattis, Spencer Kimball and Josh MacDonald |
| 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 | /* |
| 19 | * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS |
| 20 | * file for a list of people on the GTK+ Team. See the ChangeLog |
| 21 | * files for a list of changes. These files are distributed with |
| 22 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
| 23 | */ |
| 24 | |
| 25 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 26 | |
| 27 | #include "gtkdroptargetasync.h"cxx . . $ `<file>/gtk/gtkdroptargetasync.h`/ |
| 28 | |
| 29 | #include "gtkdropprivate.h"cxx . . $ `<file>/gtk/gtkdropprivate.h`/ |
| 30 | #include "gdk/gdkdropprivate.h"cxx . . $ `<file>/gdk/gdkdropprivate.h`/ |
| 31 | #include "gtkeventcontrollerprivate.h"cxx . . $ `<file>/gtk/gtkeventcontrollerprivate.h`/ |
| 32 | #include "gtkmarshalers.h"cxx . . $ `<file>/build/gtk/gtkmarshalers.h`/ |
| 33 | #include "gdk/gdkmarshalers.h"cxx . . $ `<file>/build/gdk/gdkmarshalers.h`/ |
| 34 | #include "gtknative.h"cxx . . $ `<file>/gtk/gtknative.h`/ |
| 35 | #include "gtktypebuiltins.h"cxx . . $ `<file>/build/gtk/gtktypebuiltins.h`/ |
| 36 | #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/ |
| 37 | |
| 38 | |
| 39 | /** |
| 40 | * GtkDropTargetAsync: |
| 41 | * |
| 42 | * An event controller to receive Drag-and-Drop operations, asynchronously. |
| 43 | * |
| 44 | * It is the more complete but also more complex method of handling drop |
| 45 | * operations compared to [[email protected]], and you should only use |
| 46 | * it if `GtkDropTarget` doesn't provide all the features you need. |
| 47 | * |
| 48 | * To use a `GtkDropTargetAsync` to receive drops on a widget, you create |
| 49 | * a `GtkDropTargetAsync` object, configure which data formats and actions |
| 50 | * you support, connect to its signals, and then attach it to the widget |
| 51 | * with [[email protected]_controller]. |
| 52 | * |
| 53 | * During a drag operation, the first signal that a `GtkDropTargetAsync` |
| 54 | * emits is [[email protected]::accept], which is meant to determine |
| 55 | * whether the target is a possible drop site for the ongoing drop. The |
| 56 | * default handler for the ::accept signal accepts the drop if it finds |
| 57 | * a compatible data format and an action that is supported on both sides. |
| 58 | * |
| 59 | * If it is, and the widget becomes a target, you will receive a |
| 60 | * [[email protected]::drag-enter] signal, followed by |
| 61 | * [[email protected]::drag-motion] signals as the pointer moves, |
| 62 | * optionally a [[email protected]::drop] signal when a drop happens, |
| 63 | * and finally a [[email protected]::drag-leave] signal when the |
| 64 | * pointer moves off the widget. |
| 65 | * |
| 66 | * The ::drag-enter and ::drag-motion handler return a `GdkDragAction` |
| 67 | * to update the status of the ongoing operation. The ::drop handler |
| 68 | * should decide if it ultimately accepts the drop and if it does, it |
| 69 | * should initiate the data transfer and finish the operation by calling |
| 70 | * [[email protected]]. |
| 71 | * |
| 72 | * Between the ::drag-enter and ::drag-leave signals the widget is a |
| 73 | * current drop target, and will receive the %GTK_STATE_FLAG_DROP_ACTIVE |
| 74 | * state, which can be used by themes to style the widget as a drop target. |
| 75 | */ |
| 76 | |
| 77 | struct _GtkDropTargetAsynccxx . . $ _GtkDropTargetAsync# |
| 78 | { |
| 79 | GtkEventControllercxx . . $ GtkEventController# parent_objectcxx . . $ _GtkDropTargetAsync#parent_object.; |
| 80 | |
| 81 | GdkContentFormatscxx . . $ GdkContentFormats# *formatscxx . . $ _GtkDropTargetAsync#formats.; |
| 82 | GdkDragActioncxx . . $ GdkDragAction# actionscxx . . $ _GtkDropTargetAsync#actions.; |
| 83 | |
| 84 | GdkDropcxx . . $ GdkDrop# *dropcxx . . $ _GtkDropTargetAsync#drop.; |
| 85 | gbooleancxx . . $ gboolean# rejectedcxx . . $ _GtkDropTargetAsync#rejected.; |
| 86 | }; |
| 87 | |
| 88 | struct _GtkDropTargetAsyncClasscxx . . $ _GtkDropTargetAsyncClass# |
| 89 | { |
| 90 | GtkEventControllerClasscxx . . $ GtkEventControllerClass# parent_classcxx . . $ _GtkDropTargetAsyncClass#parent_class.; |
| 91 | |
| 92 | gbooleancxx . . $ gboolean# (* acceptcxx . . $ _GtkDropTargetAsyncClass#accept.) (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 93 | GdkDropcxx . . $ GdkDrop# *drop); |
| 94 | GdkDragActioncxx . . $ GdkDragAction# (* drag_entercxx . . $ _GtkDropTargetAsyncClass#drag_enter.) (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 95 | GdkDropcxx . . $ GdkDrop# *drop, |
| 96 | double x, |
| 97 | double y); |
| 98 | GdkDragActioncxx . . $ GdkDragAction# (* drag_motioncxx . . $ _GtkDropTargetAsyncClass#drag_motion.) (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 99 | GdkDropcxx . . $ GdkDrop# *drop, |
| 100 | double x, |
| 101 | double y); |
| 102 | void (* drag_leavecxx . . $ _GtkDropTargetAsyncClass#drag_leave.) (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 103 | GdkDropcxx . . $ GdkDrop# *drop); |
| 104 | gbooleancxx . . $ gboolean# (* dropcxx . . $ _GtkDropTargetAsyncClass#drop.) (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 105 | GdkDropcxx . . $ GdkDrop# *drop, |
| 106 | double x, |
| 107 | double y); |
| 108 | }; |
| 109 | |
| 110 | enumcxx . . $ $anonymous_type_6f25b4bd74ea23fa_0# { |
| 111 | PROP_0cxx . . $ PROP_0., |
| 112 | PROP_ACTIONScxx . . $ PROP_ACTIONS., |
| 113 | PROP_FORMATScxx . . $ PROP_FORMATS., |
| 114 | NUM_PROPERTIEScxx . . $ NUM_PROPERTIES. |
| 115 | }; |
| 116 | |
| 117 | static GParamSpeccxx . . $ GParamSpec# *propertiescxx . . $ properties.[NUM_PROPERTIEScxx . . $ NUM_PROPERTIES.]; |
| 118 | |
| 119 | enumcxx . . $ $anonymous_type_6f25b4bd74ea23fa_1# { |
| 120 | ACCEPTcxx . . $ ACCEPT., |
| 121 | DRAG_ENTERcxx . . $ DRAG_ENTER., |
| 122 | DRAG_MOTIONcxx . . $ DRAG_MOTION., |
| 123 | DRAG_LEAVEcxx . . $ DRAG_LEAVE., |
| 124 | DROPcxx . . $ DROP., |
| 125 | NUM_SIGNALScxx . . $ NUM_SIGNALS. |
| 126 | }; |
| 127 | |
| 128 | static guintcxx . . $ guint# signalscxx . . $ signals.[NUM_SIGNALScxx . . $ NUM_SIGNALS.]; |
| 129 | |
| 130 | G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (GtkDropTargetAsync, gtk_drop_target_async, GTK_TYPE_EVENT_CONTROLLERcxx . . $ `gtk/gtkeventcontroller.h:34:9`!); |
| 131 | |
| 132 | static gbooleancxx . . $ gboolean# |
| 133 | gtk_drop_target_async_acceptcxx . . $ gtk_drop_target_async_accept(9a21b7ac1a9954e4). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 134 | GdkDropcxx . . $ GdkDrop# *drop) |
| 135 | { |
| 136 | if ((gdk_drop_get_actionscxx . . $ gdk_drop_get_actions(eccb8339fb91a1e3). (drop) & self->actionscxx . . $ _GtkDropTargetAsync#actions.) == GDK_ACTION_NONEcxx . . $ GDK_ACTION_NONE.) |
| 137 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 138 | |
| 139 | if (self->formatscxx . . $ _GtkDropTargetAsync#formats. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 140 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 141 | |
| 142 | return gdk_content_formats_matchcxx . . $ gdk_content_formats_match(9d36aeec16d82b2f). (self->formatscxx . . $ _GtkDropTargetAsync#formats., gdk_drop_get_formatscxx . . $ gdk_drop_get_formats(e1cfed1536de1d54). (drop)); |
| 143 | } |
| 144 | |
| 145 | static GdkDragActioncxx . . $ GdkDragAction# |
| 146 | make_action_uniquecxx . . $ make_action_unique(32f6a09033160413). (GdkDragActioncxx . . $ GdkDragAction# actions) |
| 147 | { |
| 148 | if (actions & GDK_ACTION_COPYcxx . . $ GDK_ACTION_COPY.) |
| 149 | return GDK_ACTION_COPYcxx . . $ GDK_ACTION_COPY.; |
| 150 | |
| 151 | if (actions & GDK_ACTION_MOVEcxx . . $ GDK_ACTION_MOVE.) |
| 152 | return GDK_ACTION_MOVEcxx . . $ GDK_ACTION_MOVE.; |
| 153 | |
| 154 | if (actions & GDK_ACTION_LINKcxx . . $ GDK_ACTION_LINK.) |
| 155 | return GDK_ACTION_LINKcxx . . $ GDK_ACTION_LINK.; |
| 156 | |
| 157 | return GDK_ACTION_NONEcxx . . $ GDK_ACTION_NONE.; |
| 158 | } |
| 159 | |
| 160 | static GdkDragActioncxx . . $ GdkDragAction# |
| 161 | gtk_drop_target_async_drag_entercxx . . $ gtk_drop_target_async_drag_enter(82ac0511f91d8cf1). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 162 | GdkDropcxx . . $ GdkDrop# *drop, |
| 163 | double x, |
| 164 | double y) |
| 165 | { |
| 166 | return make_action_uniquecxx . . $ make_action_unique(32f6a09033160413). (self->actionscxx . . $ _GtkDropTargetAsync#actions. & gdk_drop_get_actionscxx . . $ gdk_drop_get_actions(eccb8339fb91a1e3). (drop)); |
| 167 | } |
| 168 | |
| 169 | static GdkDragActioncxx . . $ GdkDragAction# |
| 170 | gtk_drop_target_async_drag_motioncxx . . $ gtk_drop_target_async_drag_motion(82ac0511f91d8cf1). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 171 | GdkDropcxx . . $ GdkDrop# *drop, |
| 172 | double x, |
| 173 | double y) |
| 174 | { |
| 175 | return make_action_uniquecxx . . $ make_action_unique(32f6a09033160413). (self->actionscxx . . $ _GtkDropTargetAsync#actions. & gdk_drop_get_actionscxx . . $ gdk_drop_get_actions(eccb8339fb91a1e3). (drop)); |
| 176 | } |
| 177 | |
| 178 | static gbooleancxx . . $ gboolean# |
| 179 | gtk_drop_target_async_dropcxx . . $ gtk_drop_target_async_drop(22e2af26c68dc7fc). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 180 | GdkDropcxx . . $ GdkDrop# *drop, |
| 181 | double x, |
| 182 | double y) |
| 183 | { |
| 184 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 185 | } |
| 186 | |
| 187 | static gbooleancxx . . $ gboolean# |
| 188 | gtk_drop_target_async_filter_eventcxx . . $ gtk_drop_target_async_filter_event(7ad650e377e57494). (GtkEventControllercxx . . $ GtkEventController# *controller, |
| 189 | GdkEventcxx . . $ GdkEvent# *event) |
| 190 | { |
| 191 | switch ((int)gdk_event_get_event_typecxx . . $ gdk_event_get_event_type(af0289f7121992bc). (event)) |
| 192 | { |
| 193 | case GDK_DRAG_ENTERcxx . . $ GDK_DRAG_ENTER.: |
| 194 | case GDK_DRAG_LEAVEcxx . . $ GDK_DRAG_LEAVE.: |
| 195 | case GDK_DRAG_MOTIONcxx . . $ GDK_DRAG_MOTION.: |
| 196 | case GDK_DROP_STARTcxx . . $ GDK_DROP_START.: |
| 197 | return GTK_EVENT_CONTROLLER_CLASScxx . . $ `gtk/gtkeventcontroller.h:36:9`! (gtk_drop_target_async_parent_class)->filter_eventcxx . . $ _GtkEventControllerClass#filter_event. (controller, event); |
| 198 | |
| 199 | default:; |
| 200 | } |
| 201 | |
| 202 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 203 | } |
| 204 | |
| 205 | static gbooleancxx . . $ gboolean# |
| 206 | gtk_drop_target_async_handle_eventcxx . . $ gtk_drop_target_async_handle_event(df5f496728f85019). (GtkEventControllercxx . . $ GtkEventController# *controller, |
| 207 | GdkEventcxx . . $ GdkEvent# *event, |
| 208 | double x, |
| 209 | double y) |
| 210 | { |
| 211 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self = GTK_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:43:9`! (controller); |
| 212 | GtkWidgetcxx . . $ GtkWidget# *widget = gtk_event_controller_get_widgetcxx . . $ gtk_event_controller_get_widget(71aab0125320da1a). (controller); |
| 213 | GdkDropcxx . . $ GdkDrop# *drop; |
| 214 | |
| 215 | switch ((int) gdk_event_get_event_typecxx . . $ gdk_event_get_event_type(af0289f7121992bc). (event)) |
| 216 | { |
| 217 | case GDK_DRAG_MOTIONcxx . . $ GDK_DRAG_MOTION.: |
| 218 | { |
| 219 | GdkDragActioncxx . . $ GdkDragAction# preferred_action; |
| 220 | |
| 221 | drop = gdk_dnd_event_get_dropcxx . . $ gdk_dnd_event_get_drop(44788e062aa6540f). (event); |
| 222 | /* sanity check */ |
| 223 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (self->drop == drop, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 224 | if (self->rejectedcxx . . $ _GtkDropTargetAsync#rejected.) |
| 225 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 226 | |
| 227 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, signalscxx . . $ signals.[DRAG_MOTIONcxx . . $ DRAG_MOTION.], 0, drop, x, y, &preferred_action); |
| 228 | if (preferred_action && self->dropcxx . . $ _GtkDropTargetAsync#drop. && !self->rejectedcxx . . $ _GtkDropTargetAsync#rejected. && |
| 229 | gtk_drop_statuscxx . . $ gtk_drop_status(1927672dff2036b). (self->dropcxx . . $ _GtkDropTargetAsync#drop., self->actionscxx . . $ _GtkDropTargetAsync#actions., preferred_action)) |
| 230 | { |
| 231 | gtk_widget_set_state_flagscxx . . $ gtk_widget_set_state_flags(2b95d95a3c3aa236). (widget, GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE., FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | gtk_widget_unset_state_flagscxx . . $ gtk_widget_unset_state_flags(e7d7ee4ea524d63). (widget, GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE.); |
| 236 | } |
| 237 | } |
| 238 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 239 | |
| 240 | case GDK_DROP_STARTcxx . . $ GDK_DROP_START.: |
| 241 | { |
| 242 | gbooleancxx . . $ gboolean# handled; |
| 243 | |
| 244 | drop = gdk_dnd_event_get_dropcxx . . $ gdk_dnd_event_get_drop(44788e062aa6540f). (event); |
| 245 | /* sanity check */ |
| 246 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (self->drop == drop, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 247 | if (self->rejectedcxx . . $ _GtkDropTargetAsync#rejected.) |
| 248 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 249 | |
| 250 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, signalscxx . . $ signals.[DROPcxx . . $ DROP.], 0, self->dropcxx . . $ _GtkDropTargetAsync#drop., x, y, &handled); |
| 251 | |
| 252 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->drop); |
| 253 | gtk_widget_unset_state_flagscxx . . $ gtk_widget_unset_state_flags(e7d7ee4ea524d63). (widget, GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE.); |
| 254 | |
| 255 | return handled; |
| 256 | } |
| 257 | |
| 258 | default: |
| 259 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | static void |
| 264 | gtk_drop_target_async_handle_crossingcxx . . $ gtk_drop_target_async_handle_crossing(640db48255c9900f). (GtkEventControllercxx . . $ GtkEventController# *controller, |
| 265 | const GtkCrossingDatacxx . . $ GtkCrossingData# *crossing, |
| 266 | double x, |
| 267 | double y) |
| 268 | { |
| 269 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self = GTK_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:43:9`! (controller); |
| 270 | GtkWidgetcxx . . $ GtkWidget# *widget = gtk_event_controller_get_widgetcxx . . $ gtk_event_controller_get_widget(71aab0125320da1a). (controller); |
| 271 | |
| 272 | if (crossing->typecxx . . $ _GtkCrossingData#type. != GTK_CROSSING_DROPcxx . . $ GTK_CROSSING_DROP.) |
| 273 | return; |
| 274 | |
| 275 | if (self->dropcxx . . $ _GtkDropTargetAsync#drop. && gdk_drop_is_finishedcxx . . $ gdk_drop_is_finished(1fff6b3cf0749be). (self->dropcxx . . $ _GtkDropTargetAsync#drop.)) |
| 276 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->drop); |
| 277 | |
| 278 | /* sanity check */ |
| 279 | g_warn_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:563:9`! (self->drop == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || self->drop == crossing->drop); |
| 280 | |
| 281 | if (crossing->directioncxx . . $ _GtkCrossingData#direction. == GTK_CROSSING_INcxx . . $ GTK_CROSSING_IN.) |
| 282 | { |
| 283 | gbooleancxx . . $ gboolean# accept = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 284 | GdkDragActioncxx . . $ GdkDragAction# preferred_action; |
| 285 | |
| 286 | if (self->dropcxx . . $ _GtkDropTargetAsync#drop. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 287 | return; |
| 288 | |
| 289 | self->dropcxx . . $ _GtkDropTargetAsync#drop. = g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (crossing->drop); |
| 290 | |
| 291 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, signalscxx . . $ signals.[ACCEPTcxx . . $ ACCEPT.], 0, self->dropcxx . . $ _GtkDropTargetAsync#drop., &accept); |
| 292 | self->rejectedcxx . . $ _GtkDropTargetAsync#rejected. = !accept; |
| 293 | if (self->rejectedcxx . . $ _GtkDropTargetAsync#rejected. || !self->dropcxx . . $ _GtkDropTargetAsync#drop.) |
| 294 | return; |
| 295 | |
| 296 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, signalscxx . . $ signals.[DRAG_ENTERcxx . . $ DRAG_ENTER.], 0, self->dropcxx . . $ _GtkDropTargetAsync#drop., x, y, &preferred_action); |
| 297 | if (preferred_action && self->dropcxx . . $ _GtkDropTargetAsync#drop. && !self->rejectedcxx . . $ _GtkDropTargetAsync#rejected. && |
| 298 | gtk_drop_statuscxx . . $ gtk_drop_status(1927672dff2036b). (self->dropcxx . . $ _GtkDropTargetAsync#drop., self->actionscxx . . $ _GtkDropTargetAsync#actions., preferred_action)) |
| 299 | { |
| 300 | gtk_widget_set_state_flagscxx . . $ gtk_widget_set_state_flags(2b95d95a3c3aa236). (widget, GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE., FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 301 | } |
| 302 | } |
| 303 | else |
| 304 | { |
| 305 | if (crossing->new_descendentcxx . . $ _GtkCrossingData#new_descendent. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || |
| 306 | crossing->new_targetcxx . . $ _GtkCrossingData#new_target. == widget || |
| 307 | self->dropcxx . . $ _GtkDropTargetAsync#drop. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 308 | return; |
| 309 | |
| 310 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, signalscxx . . $ signals.[DRAG_LEAVEcxx . . $ DRAG_LEAVE.], 0, self->dropcxx . . $ _GtkDropTargetAsync#drop.); |
| 311 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->drop); |
| 312 | gtk_widget_unset_state_flagscxx . . $ gtk_widget_unset_state_flags(e7d7ee4ea524d63). (widget, GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE.); |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | static void |
| 317 | gtk_drop_target_async_resetcxx . . $ gtk_drop_target_async_reset(9b408ea79d359342). (GtkEventControllercxx . . $ GtkEventController# *controller) |
| 318 | { |
| 319 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self = GTK_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:43:9`! (controller); |
| 320 | GtkWidgetcxx . . $ GtkWidget# *widget = gtk_event_controller_get_widgetcxx . . $ gtk_event_controller_get_widget(71aab0125320da1a). (controller); |
| 321 | |
| 322 | if (self->dropcxx . . $ _GtkDropTargetAsync#drop.) |
| 323 | { |
| 324 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (self, signalscxx . . $ signals.[DRAG_LEAVEcxx . . $ DRAG_LEAVE.], 0, self->dropcxx . . $ _GtkDropTargetAsync#drop.); |
| 325 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->drop); |
| 326 | } |
| 327 | if (widget) |
| 328 | gtk_widget_unset_state_flagscxx . . $ gtk_widget_unset_state_flags(e7d7ee4ea524d63). (widget, GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE.); |
| 329 | } |
| 330 | |
| 331 | static void |
| 332 | gtk_drop_target_async_finalizecxx . . $ gtk_drop_target_async_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 333 | { |
| 334 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self = GTK_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:43:9`! (object); |
| 335 | |
| 336 | g_clear_objectcxx . . $ `<external>/1341695927569185362/gobject.h:695:9`! (&self->drop); |
| 337 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->formats, gdk_content_formats_unref); |
| 338 | |
| 339 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_drop_target_async_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 340 | } |
| 341 | |
| 342 | static void |
| 343 | gtk_drop_target_async_set_propertycxx . . $ gtk_drop_target_async_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object, |
| 344 | guintcxx . . $ guint# prop_id, |
| 345 | const GValuecxx . . $ GValue# *value, |
| 346 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 347 | { |
| 348 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self = GTK_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:43:9`! (object); |
| 349 | |
| 350 | switch (prop_id) |
| 351 | { |
| 352 | case PROP_ACTIONScxx . . $ PROP_ACTIONS.: |
| 353 | gtk_drop_target_async_set_actionscxx . . $ gtk_drop_target_async_set_actions(2ab2c52af4f5a740). (self, g_value_get_flagscxx . . $ g_value_get_flags(1e175b1568bd83e1). (value)); |
| 354 | break; |
| 355 | |
| 356 | case PROP_FORMATScxx . . $ PROP_FORMATS.: |
| 357 | gtk_drop_target_async_set_formatscxx . . $ gtk_drop_target_async_set_formats(e1a026ac430a3f3). (self, g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (value)); |
| 358 | break; |
| 359 | |
| 360 | default: |
| 361 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | static void |
| 366 | gtk_drop_target_async_get_propertycxx . . $ gtk_drop_target_async_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object, |
| 367 | guintcxx . . $ guint# prop_id, |
| 368 | GValuecxx . . $ GValue# *value, |
| 369 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 370 | { |
| 371 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self = GTK_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:43:9`! (object); |
| 372 | |
| 373 | switch (prop_id) |
| 374 | { |
| 375 | case PROP_ACTIONScxx . . $ PROP_ACTIONS.: |
| 376 | g_value_set_flagscxx . . $ g_value_set_flags(f81c5c84daf56975). (value, gtk_drop_target_async_get_actionscxx . . $ gtk_drop_target_async_get_actions(d3c280250c531fca). (self)); |
| 377 | break; |
| 378 | |
| 379 | case PROP_FORMATScxx . . $ PROP_FORMATS.: |
| 380 | g_value_set_boxedcxx . . $ g_value_set_boxed(806599f585dac18b). (value, gtk_drop_target_async_get_formatscxx . . $ gtk_drop_target_async_get_formats(ef2aa6a9e1ddbb27). (self)); |
| 381 | break; |
| 382 | |
| 383 | default: |
| 384 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | static void |
| 389 | gtk_drop_target_async_class_initcxx . . $ gtk_drop_target_async_class_init(1c76f51c97414350). (GtkDropTargetAsyncClasscxx . . $ GtkDropTargetAsyncClass# *class) |
| 390 | { |
| 391 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class); |
| 392 | GtkEventControllerClasscxx . . $ GtkEventControllerClass# *controller_class = GTK_EVENT_CONTROLLER_CLASScxx . . $ `gtk/gtkeventcontroller.h:36:9`! (class); |
| 393 | |
| 394 | object_class->finalizecxx . . $ _GObjectClass#finalize. = gtk_drop_target_async_finalizecxx . . $ gtk_drop_target_async_finalize(6087475fa43034d3).; |
| 395 | object_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_drop_target_async_set_propertycxx . . $ gtk_drop_target_async_set_property(d7c4bb29f36c0dc4).; |
| 396 | object_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_drop_target_async_get_propertycxx . . $ gtk_drop_target_async_get_property(cee2c52f22407c66).; |
| 397 | |
| 398 | controller_class->handle_eventcxx . . $ _GtkEventControllerClass#handle_event. = gtk_drop_target_async_handle_eventcxx . . $ gtk_drop_target_async_handle_event(df5f496728f85019).; |
| 399 | controller_class->filter_eventcxx . . $ _GtkEventControllerClass#filter_event. = gtk_drop_target_async_filter_eventcxx . . $ gtk_drop_target_async_filter_event(7ad650e377e57494).; |
| 400 | controller_class->handle_crossingcxx . . $ _GtkEventControllerClass#handle_crossing. = gtk_drop_target_async_handle_crossingcxx . . $ gtk_drop_target_async_handle_crossing(640db48255c9900f).; |
| 401 | controller_class->resetcxx . . $ _GtkEventControllerClass#reset. = gtk_drop_target_async_resetcxx . . $ gtk_drop_target_async_reset(9b408ea79d359342).; |
| 402 | |
| 403 | class->acceptcxx . . $ _GtkDropTargetAsyncClass#accept. = gtk_drop_target_async_acceptcxx . . $ gtk_drop_target_async_accept(9a21b7ac1a9954e4).; |
| 404 | class->drag_entercxx . . $ _GtkDropTargetAsyncClass#drag_enter. = gtk_drop_target_async_drag_entercxx . . $ gtk_drop_target_async_drag_enter(82ac0511f91d8cf1).; |
| 405 | class->drag_motioncxx . . $ _GtkDropTargetAsyncClass#drag_motion. = gtk_drop_target_async_drag_motioncxx . . $ gtk_drop_target_async_drag_motion(82ac0511f91d8cf1).; |
| 406 | class->dropcxx . . $ _GtkDropTargetAsyncClass#drop. = gtk_drop_target_async_dropcxx . . $ gtk_drop_target_async_drop(22e2af26c68dc7fc).; |
| 407 | |
| 408 | /** |
| 409 | * GtkDropTargetAsync:actions: |
| 410 | * |
| 411 | * The `GdkDragActions` that this drop target supports. |
| 412 | */ |
| 413 | propertiescxx . . $ properties.[PROP_ACTIONScxx . . $ PROP_ACTIONS.] = |
| 414 | g_param_spec_flagscxx . . $ g_param_spec_flags(8782cb85a73af5de). ("actions", 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`!, |
| 415 | GDK_TYPE_DRAG_ACTIONcxx . . $ `build/gdk/gdkenumtypes.h:81:9`!, GDK_ACTION_NONEcxx . . $ GDK_ACTION_NONE., |
| 416 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 417 | |
| 418 | /** |
| 419 | * GtkDropTargetAsync:formats: |
| 420 | * |
| 421 | * The `GdkContentFormats` that determines the supported data formats. |
| 422 | */ |
| 423 | propertiescxx . . $ properties.[PROP_FORMATScxx . . $ PROP_FORMATS.] = |
| 424 | 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`!, |
| 425 | GDK_TYPE_CONTENT_FORMATScxx . . $ `gdk/gdkcontentformats.h:28:9`!, |
| 426 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`! | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 427 | |
| 428 | g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (object_class, NUM_PROPERTIEScxx . . $ NUM_PROPERTIES., propertiescxx . . $ properties.); |
| 429 | |
| 430 | /** |
| 431 | * GtkDropTargetAsync::accept: |
| 432 | * @self: the `GtkDropTargetAsync` |
| 433 | * @drop: the `GdkDrop` |
| 434 | * |
| 435 | * Emitted on the drop site when a drop operation is about to begin. |
| 436 | * |
| 437 | * If the drop is not accepted, %FALSE will be returned and the drop target |
| 438 | * will ignore the drop. If %TRUE is returned, the drop is accepted for now |
| 439 | * but may be rejected later via a call to [[email protected]_drop] |
| 440 | * or ultimately by returning %FALSE from a [[email protected]::drop] |
| 441 | * handler. |
| 442 | * |
| 443 | * The default handler for this signal decides whether to accept the drop |
| 444 | * based on the formats provided by the @drop. |
| 445 | * |
| 446 | * If the decision whether the drop will be accepted or rejected needs |
| 447 | * further processing, such as inspecting the data, this function should |
| 448 | * return %TRUE and proceed as is @drop was accepted and if it decides to |
| 449 | * reject the drop later, it should call [[email protected]_drop]. |
| 450 | * |
| 451 | * Returns: %TRUE if @drop is accepted |
| 452 | */ |
| 453 | signalscxx . . $ signals.[ACCEPTcxx . . $ ACCEPT.] = |
| 454 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("accept"), |
| 455 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (class), |
| 456 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 457 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkDropTargetAsyncClass, accept), |
| 458 | g_signal_accumulator_first_winscxx . . $ g_signal_accumulator_first_wins(76292f232a01f816)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 459 | _gdk_marshal_BOOLEAN__OBJECTcxx . . $ _gdk_marshal_BOOLEAN__OBJECT(cba270afb0f82555)., |
| 460 | G_TYPE_BOOLEANcxx . . $ `<external>/9567554376676449156/gtype.h:99:9`!, 1, |
| 461 | GDK_TYPE_DROPcxx . . $ `gdk/gdkdrop.h:31:9`!); |
| 462 | g_signal_set_va_marshallercxx . . $ g_signal_set_va_marshaller(4fd870c04a9d6fe7). (signalscxx . . $ signals.[ACCEPTcxx . . $ ACCEPT.], |
| 463 | GTK_TYPE_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:42:9`!, |
| 464 | _gdk_marshal_BOOLEAN__OBJECTvcxx . . $ _gdk_marshal_BOOLEAN__OBJECTv(d309f4be92d1737c).); |
| 465 | |
| 466 | /** |
| 467 | * GtkDropTargetAsync::drag-enter: |
| 468 | * @self: the `GtkDropTargetAsync` |
| 469 | * @drop: the `GdkDrop` |
| 470 | * @x: the x coordinate of the current pointer position |
| 471 | * @y: the y coordinate of the current pointer position |
| 472 | * |
| 473 | * Emitted on the drop site when the pointer enters the widget. |
| 474 | * |
| 475 | * It can be used to set up custom highlighting. |
| 476 | * |
| 477 | * Returns: Preferred action for this drag operation. |
| 478 | */ |
| 479 | signalscxx . . $ signals.[DRAG_ENTERcxx . . $ DRAG_ENTER.] = |
| 480 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("drag-enter"), |
| 481 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (class), |
| 482 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 483 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkDropTargetAsyncClass, drag_enter), |
| 484 | g_signal_accumulator_first_winscxx . . $ g_signal_accumulator_first_wins(76292f232a01f816)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 485 | _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLEcxx . . $ _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLE(cba270afb0f82555)., |
| 486 | GDK_TYPE_DRAG_ACTIONcxx . . $ `build/gdk/gdkenumtypes.h:81:9`!, 3, |
| 487 | GDK_TYPE_DROPcxx . . $ `gdk/gdkdrop.h:31:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!); |
| 488 | g_signal_set_va_marshallercxx . . $ g_signal_set_va_marshaller(4fd870c04a9d6fe7). (signalscxx . . $ signals.[DRAG_ENTERcxx . . $ DRAG_ENTER.], |
| 489 | GTK_TYPE_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:42:9`!, |
| 490 | _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLEvcxx . . $ _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLEv(d309f4be92d1737c).); |
| 491 | |
| 492 | /** |
| 493 | * GtkDropTargetAsync::drag-motion: |
| 494 | * @self: the `GtkDropTargetAsync` |
| 495 | * @drop: the `GdkDrop` |
| 496 | * @x: the x coordinate of the current pointer position |
| 497 | * @y: the y coordinate of the current pointer position |
| 498 | * |
| 499 | * Emitted while the pointer is moving over the drop target. |
| 500 | * |
| 501 | * Returns: Preferred action for this drag operation. |
| 502 | */ |
| 503 | signalscxx . . $ signals.[DRAG_MOTIONcxx . . $ DRAG_MOTION.] = |
| 504 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("drag-motion"), |
| 505 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (class), |
| 506 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 507 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkDropTargetAsyncClass, drag_motion), |
| 508 | g_signal_accumulator_first_winscxx . . $ g_signal_accumulator_first_wins(76292f232a01f816)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 509 | _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLEcxx . . $ _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLE(cba270afb0f82555)., |
| 510 | GDK_TYPE_DRAG_ACTIONcxx . . $ `build/gdk/gdkenumtypes.h:81:9`!, 3, |
| 511 | GDK_TYPE_DROPcxx . . $ `gdk/gdkdrop.h:31:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!); |
| 512 | g_signal_set_va_marshallercxx . . $ g_signal_set_va_marshaller(4fd870c04a9d6fe7). (signalscxx . . $ signals.[DRAG_MOTIONcxx . . $ DRAG_MOTION.], |
| 513 | GTK_TYPE_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:42:9`!, |
| 514 | _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLEvcxx . . $ _gtk_marshal_FLAGS__OBJECT_DOUBLE_DOUBLEv(d309f4be92d1737c).); |
| 515 | |
| 516 | /** |
| 517 | * GtkDropTargetAsync::drag-leave: |
| 518 | * @self: the `GtkDropTargetAsync` |
| 519 | * @drop: the `GdkDrop` |
| 520 | * |
| 521 | * Emitted on the drop site when the pointer leaves the widget. |
| 522 | * |
| 523 | * Its main purpose it to undo things done in |
| 524 | * `GtkDropTargetAsync`::drag-enter. |
| 525 | */ |
| 526 | signalscxx . . $ signals.[DRAG_LEAVEcxx . . $ DRAG_LEAVE.] = |
| 527 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("drag-leave"), |
| 528 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (class), |
| 529 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 530 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkDropTargetAsyncClass, drag_leave), |
| 531 | 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`!, |
| 532 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 533 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1, |
| 534 | GDK_TYPE_DROPcxx . . $ `gdk/gdkdrop.h:31:9`!); |
| 535 | |
| 536 | /** |
| 537 | * GtkDropTargetAsync::drop: |
| 538 | * @self: the `GtkDropTargetAsync` |
| 539 | * @drop: the `GdkDrop` |
| 540 | * @x: the x coordinate of the current pointer position |
| 541 | * @y: the y coordinate of the current pointer position |
| 542 | * |
| 543 | * Emitted on the drop site when the user drops the data onto the widget. |
| 544 | * |
| 545 | * The signal handler must determine whether the pointer position is in a |
| 546 | * drop zone or not. If it is not in a drop zone, it returns %FALSE and no |
| 547 | * further processing is necessary. |
| 548 | * |
| 549 | * Otherwise, the handler returns %TRUE. In this case, this handler will |
| 550 | * accept the drop. The handler must ensure that [[email protected]] |
| 551 | * is called to let the source know that the drop is done. The call to |
| 552 | * [[email protected]] must only be done when all data has been received. |
| 553 | * |
| 554 | * To receive the data, use one of the read functions provided by |
| 555 | * [[email protected]] such as [[email protected]_async] or |
| 556 | * [[email protected]_value_async]. |
| 557 | * |
| 558 | * Returns: whether the drop is accepted at the given pointer position |
| 559 | */ |
| 560 | signalscxx . . $ signals.[DROPcxx . . $ DROP.] = |
| 561 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("drop"), |
| 562 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (class), |
| 563 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 564 | 0, |
| 565 | g_signal_accumulator_first_winscxx . . $ g_signal_accumulator_first_wins(76292f232a01f816)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 566 | _gtk_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLEcxx . . $ _gtk_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE(cba270afb0f82555)., |
| 567 | G_TYPE_BOOLEANcxx . . $ `<external>/9567554376676449156/gtype.h:99:9`!, 3, |
| 568 | GDK_TYPE_DROPcxx . . $ `gdk/gdkdrop.h:31:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!); |
| 569 | g_signal_set_va_marshallercxx . . $ g_signal_set_va_marshaller(4fd870c04a9d6fe7). (signalscxx . . $ signals.[DROPcxx . . $ DROP.], |
| 570 | GTK_TYPE_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:42:9`!, |
| 571 | _gtk_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLEvcxx . . $ _gtk_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLEv(d309f4be92d1737c).); |
| 572 | } |
| 573 | |
| 574 | static void |
| 575 | gtk_drop_target_async_initcxx . . $ gtk_drop_target_async_init(4a12913cd8fe75c5). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self) |
| 576 | { |
| 577 | } |
| 578 | |
| 579 | /** |
| 580 | * gtk_drop_target_async_new: |
| 581 | * @formats: (nullable) (transfer full): the supported data formats |
| 582 | * @actions: the supported actions |
| 583 | * |
| 584 | * Creates a new `GtkDropTargetAsync` object. |
| 585 | * |
| 586 | * Returns: the new `GtkDropTargetAsync` |
| 587 | */ |
| 588 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# * |
| 589 | gtk_drop_target_async_newcxx . . $ gtk_drop_target_async_new(3879352fc08d370e). (GdkContentFormatscxx . . $ GdkContentFormats# *formats, |
| 590 | GdkDragActioncxx . . $ GdkDragAction# actions) |
| 591 | { |
| 592 | GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *result; |
| 593 | |
| 594 | result = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:42:9`!, |
| 595 | "formats", formats, |
| 596 | "actions", actions, |
| 597 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 598 | |
| 599 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&formats, gdk_content_formats_unref); |
| 600 | |
| 601 | return result; |
| 602 | } |
| 603 | |
| 604 | /** |
| 605 | * gtk_drop_target_async_set_formats: |
| 606 | * @self: a `GtkDropTargetAsync` |
| 607 | * @formats: (nullable): the supported data formats or %NULL for any format |
| 608 | * |
| 609 | * Sets the data formats that this drop target will accept. |
| 610 | */ |
| 611 | void |
| 612 | gtk_drop_target_async_set_formatscxx . . $ gtk_drop_target_async_set_formats(e1a026ac430a3f3). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 613 | GdkContentFormatscxx . . $ GdkContentFormats# *formats) |
| 614 | { |
| 615 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:45:9`! (self)); |
| 616 | |
| 617 | if (self->formatscxx . . $ _GtkDropTargetAsync#formats. == formats) |
| 618 | return; |
| 619 | |
| 620 | if (self->formatscxx . . $ _GtkDropTargetAsync#formats.) |
| 621 | gdk_content_formats_unrefcxx . . $ gdk_content_formats_unref(b987afd44ddd231a). (self->formatscxx . . $ _GtkDropTargetAsync#formats.); |
| 622 | |
| 623 | self->formatscxx . . $ _GtkDropTargetAsync#formats. = formats; |
| 624 | |
| 625 | if (self->formatscxx . . $ _GtkDropTargetAsync#formats.) |
| 626 | gdk_content_formats_refcxx . . $ gdk_content_formats_ref(f9c6e94556d0b4d1). (self->formatscxx . . $ _GtkDropTargetAsync#formats.); |
| 627 | |
| 628 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_FORMATScxx . . $ PROP_FORMATS.]); |
| 629 | } |
| 630 | |
| 631 | /** |
| 632 | * gtk_drop_target_async_get_formats: |
| 633 | * @self: a `GtkDropTargetAsync` |
| 634 | * |
| 635 | * Gets the data formats that this drop target accepts. |
| 636 | * |
| 637 | * If the result is %NULL, all formats are expected to be supported. |
| 638 | * |
| 639 | * Returns: (nullable) (transfer none): the supported data formats |
| 640 | */ |
| 641 | GdkContentFormatscxx . . $ GdkContentFormats# * |
| 642 | gtk_drop_target_async_get_formatscxx . . $ gtk_drop_target_async_get_formats(ef2aa6a9e1ddbb27). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self) |
| 643 | { |
| 644 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:45:9`! (self), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 645 | |
| 646 | return self->formatscxx . . $ _GtkDropTargetAsync#formats.; |
| 647 | } |
| 648 | |
| 649 | /** |
| 650 | * gtk_drop_target_async_set_actions: |
| 651 | * @self: a `GtkDropTargetAsync` |
| 652 | * @actions: the supported actions |
| 653 | * |
| 654 | * Sets the actions that this drop target supports. |
| 655 | */ |
| 656 | void |
| 657 | gtk_drop_target_async_set_actionscxx . . $ gtk_drop_target_async_set_actions(2ab2c52af4f5a740). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 658 | GdkDragActioncxx . . $ GdkDragAction# actions) |
| 659 | { |
| 660 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:45:9`! (self)); |
| 661 | |
| 662 | if (self->actionscxx . . $ _GtkDropTargetAsync#actions. == actions) |
| 663 | return; |
| 664 | |
| 665 | self->actionscxx . . $ _GtkDropTargetAsync#actions. = actions; |
| 666 | |
| 667 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_ACTIONScxx . . $ PROP_ACTIONS.]); |
| 668 | } |
| 669 | |
| 670 | /** |
| 671 | * gtk_drop_target_async_get_actions: |
| 672 | * @self: a `GtkDropTargetAsync` |
| 673 | * |
| 674 | * Gets the actions that this drop target supports. |
| 675 | * |
| 676 | * Returns: the actions that this drop target supports |
| 677 | */ |
| 678 | GdkDragActioncxx . . $ GdkDragAction# |
| 679 | gtk_drop_target_async_get_actionscxx . . $ gtk_drop_target_async_get_actions(d3c280250c531fca). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self) |
| 680 | { |
| 681 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:45:9`! (self), GDK_ACTION_NONE); |
| 682 | |
| 683 | return self->actionscxx . . $ _GtkDropTargetAsync#actions.; |
| 684 | } |
| 685 | |
| 686 | /** |
| 687 | * gtk_drop_target_async_reject_drop: |
| 688 | * @self: a `GtkDropTargetAsync` |
| 689 | * @drop: the `GdkDrop` of an ongoing drag operation |
| 690 | * |
| 691 | * Sets the @drop as not accepted on this drag site. |
| 692 | * |
| 693 | * This function should be used when delaying the decision |
| 694 | * on whether to accept a drag or not until after reading |
| 695 | * the data. |
| 696 | */ |
| 697 | void |
| 698 | gtk_drop_target_async_reject_dropcxx . . $ gtk_drop_target_async_reject_drop(c4c3c5c2b87e57e7). (GtkDropTargetAsynccxx . . $ GtkDropTargetAsync# *self, |
| 699 | GdkDropcxx . . $ GdkDrop# *drop) |
| 700 | { |
| 701 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_DROP_TARGET_ASYNCcxx . . $ `gtk/gtkdroptargetasync.h:45:9`! (self)); |
| 702 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_DROPcxx . . $ `gdk/gdkdrop.h:33:9`! (drop)); |
| 703 | |
| 704 | if (self->rejectedcxx . . $ _GtkDropTargetAsync#rejected.) |
| 705 | return; |
| 706 | |
| 707 | if (self->dropcxx . . $ _GtkDropTargetAsync#drop. != drop) |
| 708 | return; |
| 709 | |
| 710 | self->rejectedcxx . . $ _GtkDropTargetAsync#rejected. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 711 | gtk_widget_unset_state_flagscxx . . $ gtk_widget_unset_state_flags(e7d7ee4ea524d63). (gtk_event_controller_get_widgetcxx . . $ gtk_event_controller_get_widget(71aab0125320da1a). (GTK_EVENT_CONTROLLERcxx . . $ `gtk/gtkeventcontroller.h:35:9`! (self)), |
| 712 | GTK_STATE_FLAG_DROP_ACTIVEcxx . . $ GTK_STATE_FLAG_DROP_ACTIVE.); |
| 713 | } |