2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _GDKMM_DRAGCONTEXT_H
4
#define _GDKMM_DRAGCONTEXT_H
9
/* $Id: dragcontext.hg,v 1.11 2006/03/22 16:53:21 murrayc Exp $ */
13
* Copyright (C) 1998-2002 The gtkmm Development Team
15
* This library is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU Lesser General Public
17
* License as published by the Free Software Foundation; either
18
* version 2.1 of the License, or (at your option) any later version.
20
* This library is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
* Lesser General Public License for more details.
25
* You should have received a copy of the GNU Lesser General Public
26
* License along with this library; if not, write to the Free
27
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31
#include <glibmm/object.h>
32
#include <gdkmm/pixbuf.h>
33
//#include <gdkmm/bitmap.h>
34
#include <gdkmm/colormap.h>
35
#include <glibmm/listhandle.h>
38
#ifndef DOXYGEN_SHOULD_SKIP_THIS
39
typedef struct _GdkDragContext GdkDragContext;
40
typedef struct _GdkDragContextClass GdkDragContextClass;
41
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
45
{ class DragContext_Class; } // namespace Gdk
49
/** @addtogroup gdkmmEnums gdkmm Enums and Flags */
53
* @par Bitwise operators:
54
* <tt>%DragAction operator|(DragAction, DragAction)</tt><br>
55
* <tt>%DragAction operator&(DragAction, DragAction)</tt><br>
56
* <tt>%DragAction operator^(DragAction, DragAction)</tt><br>
57
* <tt>%DragAction operator~(DragAction)</tt><br>
58
* <tt>%DragAction& operator|=(DragAction&, DragAction)</tt><br>
59
* <tt>%DragAction& operator&=(DragAction&, DragAction)</tt><br>
60
* <tt>%DragAction& operator^=(DragAction&, DragAction)</tt><br>
64
ACTION_DEFAULT = 1 << 0,
68
ACTION_PRIVATE = 1 << 4,
72
/** @ingroup gdkmmEnums */
73
inline DragAction operator|(DragAction lhs, DragAction rhs)
74
{ return static_cast<DragAction>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
76
/** @ingroup gdkmmEnums */
77
inline DragAction operator&(DragAction lhs, DragAction rhs)
78
{ return static_cast<DragAction>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
80
/** @ingroup gdkmmEnums */
81
inline DragAction operator^(DragAction lhs, DragAction rhs)
82
{ return static_cast<DragAction>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
84
/** @ingroup gdkmmEnums */
85
inline DragAction operator~(DragAction flags)
86
{ return static_cast<DragAction>(~static_cast<unsigned>(flags)); }
88
/** @ingroup gdkmmEnums */
89
inline DragAction& operator|=(DragAction& lhs, DragAction rhs)
90
{ return (lhs = static_cast<DragAction>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
92
/** @ingroup gdkmmEnums */
93
inline DragAction& operator&=(DragAction& lhs, DragAction rhs)
94
{ return (lhs = static_cast<DragAction>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
96
/** @ingroup gdkmmEnums */
97
inline DragAction& operator^=(DragAction& lhs, DragAction rhs)
98
{ return (lhs = static_cast<DragAction>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
103
#ifndef DOXYGEN_SHOULD_SKIP_THIS
108
class Value<Gdk::DragAction> : public Glib::Value_Flags<Gdk::DragAction>
111
static GType value_type() G_GNUC_CONST;
115
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
122
* @ingroup gdkmmEnums
129
DRAG_PROTO_WIN32_DROPFILES,
137
#ifndef DOXYGEN_SHOULD_SKIP_THIS
142
class Value<Gdk::DragProtocol> : public Glib::Value_Enum<Gdk::DragProtocol>
145
static GType value_type() G_GNUC_CONST;
149
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
156
/** A Gdk::DragContext holds information about a drag in progress. It is used on both source and destination sides.
159
class DragContext : public Glib::Object
162
#ifndef DOXYGEN_SHOULD_SKIP_THIS
165
typedef DragContext CppObjectType;
166
typedef DragContext_Class CppClassType;
167
typedef GdkDragContext BaseObjectType;
168
typedef GdkDragContextClass BaseClassType;
170
private: friend class DragContext_Class;
171
static CppClassType dragcontext_class_;
175
DragContext(const DragContext&);
176
DragContext& operator=(const DragContext&);
179
explicit DragContext(const Glib::ConstructParams& construct_params);
180
explicit DragContext(GdkDragContext* castitem);
182
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
185
virtual ~DragContext();
187
#ifndef DOXYGEN_SHOULD_SKIP_THIS
188
static GType get_type() G_GNUC_CONST;
191
static GType get_base_type() G_GNUC_CONST;
194
///Provides access to the underlying C GObject.
195
GdkDragContext* gobj() { return reinterpret_cast<GdkDragContext*>(gobject_); }
197
///Provides access to the underlying C GObject.
198
const GdkDragContext* gobj() const { return reinterpret_cast<GdkDragContext*>(gobject_); }
200
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
201
GdkDragContext* gobj_copy();
208
#ifndef GDKMM_DISABLE_DEPRECATED
210
/** @deprecated This method is not useful, you always obtain drag contexts by Gdk::Window::drag_begin() or similar.
213
#endif // GDKMM_DISABLE_DEPRECATED
217
#ifndef GDKMM_DISABLE_DEPRECATED
219
/** @deprecated This method is not useful, you always obtain drag contexts by Gdk::Window::drag_begin() or similar.
222
static Glib::RefPtr<DragContext> create();
224
#endif // GDKMM_DISABLE_DEPRECATED
227
/** Selects one of the actions offered by the drag source.
229
* This function is called by the drag destination in response to
230
* gdk_drag_motion() called by the drag source.
231
* @param action The selected action which will be taken when a drop happens,
232
* or 0 to indicate that a drop will not be accepted.
233
* @param time The timestamp for this operation.
235
void drag_status(DragAction action, guint32 time);
237
/** Indicate that a drop will not be accepted.
238
* This function may be called by the drag destination in response to gdk_drag_motion() called by the drag source.
239
* Alternatively, call drag_status() to indicate which drag action will be accepted.
241
* @param time The timestamp for this operation.
243
void drag_refuse(guint32 time);
245
//gdk_drag_motion is only used in GDK internally.
248
/** Accepts or rejects a drop.
250
* This function is called by the drag destination in response
251
* to a drop initiated by the drag source.
252
* @param ok <tt>true</tt> if the drop is accepted.
253
* @param time The timestamp for this operation.
255
void drop_reply(bool ok, guint32 time);
257
/** Ends the drag operation after a drop.
259
* This function is called by the drag destination.
260
* @param success <tt>true</tt> if the data was successfully received.
261
* @param time The timestamp for this operation.
263
void drop_finish(bool success, guint32 time);
265
/** Returns the selection atom for the current source window.
266
* @return The selection atom.
268
Glib::ustring get_selection() const;
270
//For some reason this is not in our *_docs.xml file.
272
/** Informs the drag source that the drop is finished, and that the data of the drag will no longer be required.
273
* @param success A flag indicating whether the drop was successful.
274
* @param del Aa flag indicating whether the source should delete the original data. (This should be true for a move.)
275
* time The timestamp from the "drag_data_drop" signal.
277
void drag_finish(bool success, bool del, guint32 time);
278
//Gtk::Widget* get_source_widget() - see Gtk::Widget::drag_get_source_widget()
280
// void set_icon(Gtk::Widget* widget, int hot_x, int hot_y) - see Gtk::Widget::set_as_icon().
282
void set_icon(const Glib::RefPtr<Gdk::Colormap>& colormap, const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask, int hot_x, int hot_y);
284
void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, int hot_x, int hot_y);
286
// The first argument was changed from StockID to ustring to avoid
287
// cross-dependence between gdkmm and gtkmm.
288
// See http://bugzilla.gnome.org/show_bug.cgi?id=79124 for details
290
void set_icon(const Glib::ustring& stock_id, int hot_x, int hot_y);
292
void set_icon_name(const Glib::ustring& name, int hot_x, int hot_y);
297
/** Returns the Gdk::Window where the DND operation started.
300
* @return A Gdk::Window.
302
Glib::RefPtr<Window> get_source_window();
304
/** Returns the Gdk::Window where the DND operation started.
307
* @return A Gdk::Window.
309
Glib::RefPtr<const Window> get_source_window() const;
311
//gtkmmproc error: gdk_drag_context_get_destination_window : method defs lookup failed (1)
312
//gtkmmproc error: gdk_drag_context_get_destination_window : method defs lookup failed (1)
314
/** Get a list of targets offered by the source.
315
* @result a list of targets offered by the source.
317
Gdk::ListHandle_AtomString get_targets() const;
319
/** Get the DND protocol which governs this drag.
320
* @result the DND protocol which governs this drag.
322
DragProtocol get_protocol() const;
324
/** Discover whether the context is used on the source side.
325
* @result true if the context is used on the source side.
327
bool get_is_source() const;
330
/** Determines the bitmask of actions proposed by the source if
331
* gdk_drag_context_suggested_action() returns GDK_ACTION_ASK.
334
* @return The Gdk::DragAction flags.
336
DragAction get_actions() const;
338
/** Determines the suggested drag action of the context.
341
* @return A Gdk::DragAction value.
343
DragAction get_suggested_action() const;
346
#ifndef GDKMM_DISABLE_DEPRECATED
348
/** Determines the action chosen by the drag destination.
351
* @deprecated Use get_selected_action()
352
* @return A Gdk::DragAction value.
354
DragAction get_action() const;
355
#endif // GDKMM_DISABLE_DEPRECATED
358
/** Determines the action chosen by the drag destination.
361
* @return A Gdk::DragAction value.
363
DragAction get_selected_action() const;
365
/** Get a timestamp recording the start time of this drag.
366
* @result a timestamp recording the start time of this drag.
368
guint32 get_start_time() const;
371
/** Finds the destination window and DND protocol to use at the
372
* given pointer position.
374
* This function is called by the drag source to obtain the
375
* @a dest_window and @a protocol parameters for gdk_drag_motion().
378
* @param drag_window A window which may be at the pointer position, but
379
* should be ignored, since it is put up by the drag source as an icon.
380
* @param screen The screen where the destination window is sought.
381
* @param x_root The x position of the pointer in root coordinates.
382
* @param y_root The y position of the pointer in root coordinates.
383
* @param dest_window Location to store the destination window in.
384
* @param protocol Location to store the DND protocol in.
387
void find_window_for_screen(const Glib::RefPtr<Window>& drag_window, const Glib::RefPtr<Screen>& screen, int x_root, int y_root, Glib::RefPtr<Window>& dest_window, DragProtocol* protocol) const;
393
//C++ methods used to invoke GTK+ virtual functions:
396
//GTK+ Virtual Functions (override these to change behaviour):
398
//Default Signal Handlers::
403
} /* namespace Gdk */
408
/** A Glib::wrap() method for this object.
410
* @param object The C instance.
411
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
412
* @result A C++ instance that wraps this C instance.
414
* @relates Gdk::DragContext
416
Glib::RefPtr<Gdk::DragContext> wrap(GdkDragContext* object, bool take_copy = false);
420
#endif /* _GDKMM_DRAGCONTEXT_H */