~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to include/gdkmm-2.4/gdkmm/dragcontext.h

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GDKMM_DRAGCONTEXT_H
 
4
#define _GDKMM_DRAGCONTEXT_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: dragcontext.hg,v 1.11 2006/03/22 16:53:21 murrayc Exp $ */
 
10
 
 
11
/* dragcontext.h
 
12
 *
 
13
 * Copyright (C) 1998-2002 The gtkmm Development Team
 
14
 *
 
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.
 
19
 *
 
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.
 
24
 *
 
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.
 
28
 */
 
29
 
 
30
 
 
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>
 
36
 
 
37
 
 
38
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
39
typedef struct _GdkDragContext GdkDragContext;
 
40
typedef struct _GdkDragContextClass GdkDragContextClass;
 
41
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
42
 
 
43
 
 
44
namespace Gdk
 
45
{ class DragContext_Class; } // namespace Gdk
 
46
namespace Gdk
 
47
{
 
48
 
 
49
/** @addtogroup gdkmmEnums gdkmm Enums and Flags */
 
50
 
 
51
/**
 
52
 * @ingroup gdkmmEnums
 
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>
 
61
 */
 
62
enum DragAction
 
63
{
 
64
  ACTION_DEFAULT = 1 << 0,
 
65
  ACTION_COPY = 1 << 1,
 
66
  ACTION_MOVE = 1 << 2,
 
67
  ACTION_LINK = 1 << 3,
 
68
  ACTION_PRIVATE = 1 << 4,
 
69
  ACTION_ASK = 1 << 5
 
70
};
 
71
 
 
72
/** @ingroup gdkmmEnums */
 
73
inline DragAction operator|(DragAction lhs, DragAction rhs)
 
74
  { return static_cast<DragAction>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
 
75
 
 
76
/** @ingroup gdkmmEnums */
 
77
inline DragAction operator&(DragAction lhs, DragAction rhs)
 
78
  { return static_cast<DragAction>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
 
79
 
 
80
/** @ingroup gdkmmEnums */
 
81
inline DragAction operator^(DragAction lhs, DragAction rhs)
 
82
  { return static_cast<DragAction>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
 
83
 
 
84
/** @ingroup gdkmmEnums */
 
85
inline DragAction operator~(DragAction flags)
 
86
  { return static_cast<DragAction>(~static_cast<unsigned>(flags)); }
 
87
 
 
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))); }
 
91
 
 
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))); }
 
95
 
 
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))); }
 
99
 
 
100
} // namespace Gdk
 
101
 
 
102
 
 
103
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
104
namespace Glib
 
105
{
 
106
 
 
107
template <>
 
108
class Value<Gdk::DragAction> : public Glib::Value_Flags<Gdk::DragAction>
 
109
{
 
110
public:
 
111
  static GType value_type() G_GNUC_CONST;
 
112
};
 
113
 
 
114
} // namespace Glib
 
115
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
116
 
 
117
 
 
118
namespace Gdk
 
119
{
 
120
 
 
121
/**
 
122
 * @ingroup gdkmmEnums
 
123
 */
 
124
enum DragProtocol
 
125
{
 
126
  DRAG_PROTO_MOTIF,
 
127
  DRAG_PROTO_XDND,
 
128
  DRAG_PROTO_NONE,
 
129
  DRAG_PROTO_WIN32_DROPFILES,
 
130
  DRAG_PROTO_OLE2,
 
131
  DRAG_PROTO_LOCAL
 
132
};
 
133
 
 
134
} // namespace Gdk
 
135
 
 
136
 
 
137
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
138
namespace Glib
 
139
{
 
140
 
 
141
template <>
 
142
class Value<Gdk::DragProtocol> : public Glib::Value_Enum<Gdk::DragProtocol>
 
143
{
 
144
public:
 
145
  static GType value_type() G_GNUC_CONST;
 
146
};
 
147
 
 
148
} // namespace Glib
 
149
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
150
 
 
151
 
 
152
namespace Gdk
 
153
{
 
154
 
 
155
 
 
156
/** A Gdk::DragContext holds information about a drag in progress. It is used on both source and destination sides.
 
157
 */
 
158
 
 
159
class DragContext : public Glib::Object
 
160
{
 
161
  
 
162
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
163
 
 
164
public:
 
165
  typedef DragContext CppObjectType;
 
166
  typedef DragContext_Class CppClassType;
 
167
  typedef GdkDragContext BaseObjectType;
 
168
  typedef GdkDragContextClass BaseClassType;
 
169
 
 
170
private:  friend class DragContext_Class;
 
171
  static CppClassType dragcontext_class_;
 
172
 
 
173
private:
 
174
  // noncopyable
 
175
  DragContext(const DragContext&);
 
176
  DragContext& operator=(const DragContext&);
 
177
 
 
178
protected:
 
179
  explicit DragContext(const Glib::ConstructParams& construct_params);
 
180
  explicit DragContext(GdkDragContext* castitem);
 
181
 
 
182
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
183
 
 
184
public:
 
185
  virtual ~DragContext();
 
186
 
 
187
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
188
  static GType get_type()      G_GNUC_CONST;
 
189
 
 
190
 
 
191
  static GType get_base_type() G_GNUC_CONST;
 
192
#endif
 
193
 
 
194
  ///Provides access to the underlying C GObject.
 
195
  GdkDragContext*       gobj()       { return reinterpret_cast<GdkDragContext*>(gobject_); }
 
196
 
 
197
  ///Provides access to the underlying C GObject.
 
198
  const GdkDragContext* gobj() const { return reinterpret_cast<GdkDragContext*>(gobject_); }
 
199
 
 
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();
 
202
 
 
203
private:
 
204
 
 
205
  
 
206
protected:
 
207
 
 
208
  #ifndef GDKMM_DISABLE_DEPRECATED
 
209
 
 
210
  /** @deprecated This method is not useful, you always obtain drag contexts by Gdk::Window::drag_begin() or similar.
 
211
   */
 
212
  DragContext();
 
213
  #endif // GDKMM_DISABLE_DEPRECATED
 
214
 
 
215
 
 
216
public:
 
217
  #ifndef GDKMM_DISABLE_DEPRECATED
 
218
 
 
219
  /** @deprecated This method is not useful, you always obtain drag contexts by Gdk::Window::drag_begin() or similar.
 
220
   */
 
221
  
 
222
  static Glib::RefPtr<DragContext> create();
 
223
 
 
224
  #endif // GDKMM_DISABLE_DEPRECATED
 
225
 
 
226
 
 
227
  /** Selects one of the actions offered by the drag source.
 
228
   * 
 
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.
 
234
   */
 
235
  void drag_status(DragAction action, guint32 time);
 
236
 
 
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.
 
240
   *
 
241
   * @param time The timestamp for this operation.
 
242
   */
 
243
  void drag_refuse(guint32 time);
 
244
 
 
245
   //gdk_drag_motion is only used in GDK internally.
 
246
 
 
247
  
 
248
  /** Accepts or rejects a drop. 
 
249
   * 
 
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.
 
254
   */
 
255
  void drop_reply(bool ok, guint32 time);
 
256
  
 
257
  /** Ends the drag operation after a drop.
 
258
   * 
 
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.
 
262
   */
 
263
  void drop_finish(bool success, guint32 time);
 
264
  
 
265
  /** Returns the selection atom for the current source window.
 
266
   * @return The selection atom.
 
267
   */
 
268
  Glib::ustring get_selection() const;
 
269
 
 
270
  //For some reason this is not in our *_docs.xml file.
 
271
  
 
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.
 
276
   */
 
277
  void drag_finish(bool success, bool del, guint32 time);
 
278
  //Gtk::Widget* get_source_widget() - see Gtk::Widget::drag_get_source_widget()
 
279
 
 
280
  // void set_icon(Gtk::Widget* widget, int hot_x, int hot_y) - see Gtk::Widget::set_as_icon().
 
281
  
 
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);
 
283
  
 
284
  void set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, int hot_x, int hot_y);
 
285
 
 
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
 
289
  
 
290
  void set_icon(const Glib::ustring& stock_id, int hot_x, int hot_y);
 
291
  
 
292
  void set_icon_name(const Glib::ustring& name, int hot_x, int hot_y);
 
293
  
 
294
  void set_icon();
 
295
 
 
296
  
 
297
  /** Returns the Gdk::Window where the DND operation started.
 
298
   * 
 
299
   * @newin{2,22}
 
300
   * @return A Gdk::Window.
 
301
   */
 
302
  Glib::RefPtr<Window> get_source_window();
 
303
  
 
304
  /** Returns the Gdk::Window where the DND operation started.
 
305
   * 
 
306
   * @newin{2,22}
 
307
   * @return A Gdk::Window.
 
308
   */
 
309
  Glib::RefPtr<const Window> get_source_window() const;
 
310
 
 
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)
 
313
 
 
314
  /** Get a list of targets offered by the source.
 
315
   * @result a list of targets offered by the source.
 
316
   */
 
317
  Gdk::ListHandle_AtomString get_targets() const;
 
318
 
 
319
  /** Get the DND protocol which governs this drag.
 
320
   * @result the DND protocol which governs this drag.
 
321
   */
 
322
   DragProtocol get_protocol() const;
 
323
 
 
324
  /** Discover whether the context is used on the source side.
 
325
   * @result true if the context is used on the source side.
 
326
   */
 
327
   bool get_is_source() const;
 
328
 
 
329
  
 
330
  /** Determines the bitmask of actions proposed by the source if
 
331
   * gdk_drag_context_suggested_action() returns GDK_ACTION_ASK.
 
332
   * 
 
333
   * @newin{2,22}
 
334
   * @return The Gdk::DragAction flags.
 
335
   */
 
336
  DragAction get_actions() const;
 
337
  
 
338
  /** Determines the suggested drag action of the context.
 
339
   * 
 
340
   * @newin{2,22}
 
341
   * @return A Gdk::DragAction value.
 
342
   */
 
343
  DragAction get_suggested_action() const;
 
344
 
 
345
  
 
346
#ifndef GDKMM_DISABLE_DEPRECATED
 
347
 
 
348
  /** Determines the action chosen by the drag destination.
 
349
   * 
 
350
   * @newin{2,22}
 
351
   * @deprecated Use get_selected_action()
 
352
   * @return A Gdk::DragAction value.
 
353
   */
 
354
  DragAction get_action() const;
 
355
#endif // GDKMM_DISABLE_DEPRECATED
 
356
 
 
357
 
 
358
  /** Determines the action chosen by the drag destination.
 
359
   * 
 
360
   * @newin{2,22}
 
361
   * @return A Gdk::DragAction value.
 
362
   */
 
363
  DragAction get_selected_action() const;
 
364
 
 
365
  /** Get a timestamp recording the start time of this drag.
 
366
   * @result a timestamp recording the start time of this drag.
 
367
   */
 
368
   guint32 get_start_time() const;
 
369
 
 
370
  
 
371
  /** Finds the destination window and DND protocol to use at the
 
372
   * given pointer position.
 
373
   * 
 
374
   * This function is called by the drag source to obtain the 
 
375
   *  @a dest_window and @a protocol parameters for gdk_drag_motion().
 
376
   * 
 
377
   * @newin{2,2}
 
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.
 
385
   */
 
386
 
 
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;
 
388
  
 
389
 
 
390
public:
 
391
 
 
392
public:
 
393
  //C++ methods used to invoke GTK+ virtual functions:
 
394
 
 
395
protected:
 
396
  //GTK+ Virtual Functions (override these to change behaviour):
 
397
 
 
398
  //Default Signal Handlers::
 
399
 
 
400
 
 
401
};
 
402
 
 
403
} /* namespace Gdk */
 
404
 
 
405
 
 
406
namespace Glib
 
407
{
 
408
  /** A Glib::wrap() method for this object.
 
409
   * 
 
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.
 
413
   *
 
414
   * @relates Gdk::DragContext
 
415
   */
 
416
  Glib::RefPtr<Gdk::DragContext> wrap(GdkDragContext* object, bool take_copy = false);
 
417
}
 
418
 
 
419
 
 
420
#endif /* _GDKMM_DRAGCONTEXT_H */
 
421