~ubuntu-branches/ubuntu/vivid/ardour/vivid-proposed

« back to all changes in this revision

Viewing changes to libs/gtkmm2/gdk/gdkmm/dragcontext.cc

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler, Jaromír Mikeš, Felipe Sateler
  • Date: 2014-05-22 14:39:25 UTC
  • mfrom: (29 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: package-import@ubuntu.com-20140522143925-vwqfo9287pmkrroe
Tags: 1:2.8.16+git20131003-3
* Team upload

[ Jaromír Mikeš ]
* Add -dbg package

[ Felipe Sateler ]
* Upload to experimental

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Generated by gtkmmproc -- DO NOT MODIFY!
 
2
 
 
3
#include <gdkmm/dragcontext.h>
 
4
#include <gdkmm/private/dragcontext_p.h>
 
5
 
 
6
#include <gdk/gdkenumtypes.h>
 
7
// -*- c++ -*-
 
8
/* $Id$ */
 
9
 
 
10
/*
 
11
 *
 
12
 * Copyright 2002 The gtkmm Development Team
 
13
 *
 
14
 * This library is free software; you can redistribute it and/or
 
15
 * modify it under the terms of the GNU Library General Public
 
16
 * License as published by the Free Software Foundation; either
 
17
 * version 2 of the License, or (at your option) any later version.
 
18
 *
 
19
 * This library is distributed in the hope that it will be useful,
 
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
22
 * Library General Public License for more details.
 
23
 *
 
24
 * You should have received a copy of the GNU Library General Public
 
25
 * License along with this library; if not, write to the Free
 
26
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
27
 */
 
28
 
 
29
#include <gdkmm/window.h>
 
30
#include <gtk/gtkdnd.h>
 
31
#include <gdk/gdkwindow.h>
 
32
#include <glibmm/utility.h> //For ScopedPtr<>.
 
33
 
 
34
namespace Gdk
 
35
{
 
36
 
 
37
void DragContext::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
 
38
{
 
39
  GdkWindow* cWindow = 0;
 
40
  gdk_drag_find_window_for_screen(const_cast<GdkDragContext*>(gobj()), drag_window->gobj(), screen->gobj(), x_root, y_root, &cWindow, (GdkDragProtocol*)(protocol));
 
41
  dest_window = Glib::wrap((GdkWindowObject*)cWindow);
 
42
}
 
43
 
 
44
void DragContext::drag_refuse(guint32 time)
 
45
{
 
46
  gdk_drag_status(gobj(), ((GdkDragAction)(0)) /* see GDK docs */, time);
 
47
}
 
48
 
 
49
Glib::StringArrayHandle DragContext::get_targets() const
 
50
{
 
51
  std::list<Glib::ustring> listTargets;
 
52
 
 
53
  //Get a newly-allocated array of atoms:
 
54
  GList* list = gobj()->targets;
 
55
  while(list)
 
56
  {
 
57
    GdkAtom atom = (GdkAtom)list->data;
 
58
    
 
59
    //Convert the atom to a string:
 
60
    gchar* const atom_name = gdk_atom_name(atom);
 
61
 
 
62
    Glib::ustring target;
 
63
    if(atom_name)
 
64
      target = Glib::ScopedPtr<char>(atom_name).get(); //This frees the gchar*.
 
65
      
 
66
    listTargets.push_back(target);
 
67
 
 
68
    list = list->next;
 
69
  }
 
70
 
 
71
  return listTargets;
 
72
}
 
73
 
 
74
} /* namespace Gdk */
 
75
 
 
76
 
 
77
namespace
 
78
{
 
79
} // anonymous namespace
 
80
 
 
81
// static
 
82
GType Glib::Value<Gdk::DragAction>::value_type()
 
83
{
 
84
  return gdk_drag_action_get_type();
 
85
}
 
86
 
 
87
// static
 
88
GType Glib::Value<Gdk::DragProtocol>::value_type()
 
89
{
 
90
  return gdk_drag_protocol_get_type();
 
91
}
 
92
 
 
93
 
 
94
namespace Glib
 
95
{
 
96
 
 
97
Glib::RefPtr<Gdk::DragContext> wrap(GdkDragContext* object, bool take_copy)
 
98
{
 
99
  return Glib::RefPtr<Gdk::DragContext>( dynamic_cast<Gdk::DragContext*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
 
100
  //We use dynamic_cast<> in case of multiple inheritance.
 
101
}
 
102
 
 
103
} /* namespace Glib */
 
104
 
 
105
 
 
106
namespace Gdk
 
107
{
 
108
 
 
109
 
 
110
/* The *_Class implementation: */
 
111
 
 
112
const Glib::Class& DragContext_Class::init()
 
113
{
 
114
  if(!gtype_) // create the GType if necessary
 
115
  {
 
116
    // Glib::Class has to know the class init function to clone custom types.
 
117
    class_init_func_ = &DragContext_Class::class_init_function;
 
118
 
 
119
    // This is actually just optimized away, apparently with no harm.
 
120
    // Make sure that the parent type has been created.
 
121
    //CppClassParent::CppObjectType::get_type();
 
122
 
 
123
    // Create the wrapper type, with the same class/instance size as the base type.
 
124
    register_derived_type(gdk_drag_context_get_type());
 
125
 
 
126
    // Add derived versions of interfaces, if the C type implements any interfaces:
 
127
  }
 
128
 
 
129
  return *this;
 
130
}
 
131
 
 
132
void DragContext_Class::class_init_function(void* g_class, void* class_data)
 
133
{
 
134
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
 
135
  CppClassParent::class_init_function(klass, class_data);
 
136
 
 
137
}
 
138
 
 
139
 
 
140
Glib::ObjectBase* DragContext_Class::wrap_new(GObject* object)
 
141
{
 
142
  return new DragContext((GdkDragContext*)object);
 
143
}
 
144
 
 
145
 
 
146
/* The implementation: */
 
147
 
 
148
GdkDragContext* DragContext::gobj_copy()
 
149
{
 
150
  reference();
 
151
  return gobj();
 
152
}
 
153
 
 
154
DragContext::DragContext(const Glib::ConstructParams& construct_params)
 
155
:
 
156
  Glib::Object(construct_params)
 
157
{}
 
158
 
 
159
DragContext::DragContext(GdkDragContext* castitem)
 
160
:
 
161
  Glib::Object((GObject*)(castitem))
 
162
{}
 
163
 
 
164
DragContext::~DragContext()
 
165
{}
 
166
 
 
167
 
 
168
DragContext::CppClassType DragContext::dragcontext_class_; // initialize static member
 
169
 
 
170
GType DragContext::get_type()
 
171
{
 
172
  return dragcontext_class_.init().get_type();
 
173
}
 
174
 
 
175
GType DragContext::get_base_type()
 
176
{
 
177
  return gdk_drag_context_get_type();
 
178
}
 
179
 
 
180
 
 
181
DragContext::DragContext()
 
182
:
 
183
  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
 
184
  Glib::Object(Glib::ConstructParams(dragcontext_class_.init()))
 
185
{
 
186
  }
 
187
 
 
188
Glib::RefPtr<DragContext> DragContext::create()
 
189
{
 
190
  return Glib::RefPtr<DragContext>( new DragContext() );
 
191
}
 
192
void DragContext::drag_status(DragAction action, guint32 time)
 
193
{
 
194
  gdk_drag_status(gobj(), ((GdkDragAction)(action)), time);
 
195
}
 
196
 
 
197
void DragContext::drop_reply(bool ok, guint32 time)
 
198
{
 
199
  gdk_drop_reply(gobj(), static_cast<int>(ok), time);
 
200
}
 
201
 
 
202
void DragContext::drop_finish(bool success, guint32 time)
 
203
{
 
204
  gdk_drop_finish(gobj(), static_cast<int>(success), time);
 
205
}
 
206
 
 
207
Glib::ustring DragContext::get_selection() const
 
208
{
 
209
  return Gdk::AtomString::to_cpp_type(gdk_drag_get_selection(const_cast<GdkDragContext*>(gobj())));
 
210
}
 
211
 
 
212
void DragContext::drag_finish(bool success, bool del, guint32 time)
 
213
{
 
214
  gtk_drag_finish(gobj(), static_cast<int>(success), static_cast<int>(del), time);
 
215
}
 
216
 
 
217
void DragContext::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)
 
218
{
 
219
  gtk_drag_set_icon_pixmap(gobj(), Glib::unwrap(colormap), Glib::unwrap(pixmap), Glib::unwrap(mask), hot_x, hot_y);
 
220
}
 
221
 
 
222
void DragContext::set_icon(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, int hot_x, int hot_y)
 
223
{
 
224
  gtk_drag_set_icon_pixbuf(gobj(), Glib::unwrap(pixbuf), hot_x, hot_y);
 
225
}
 
226
 
 
227
void DragContext::set_icon(const Glib::ustring& stock_id, int hot_x, int hot_y)
 
228
{
 
229
  gtk_drag_set_icon_stock(gobj(), stock_id.c_str(), hot_x, hot_y);
 
230
}
 
231
 
 
232
void DragContext::set_icon()
 
233
{
 
234
  gtk_drag_set_icon_default(gobj());
 
235
}
 
236
 
 
237
Glib::RefPtr<Window> DragContext::get_source_window()
 
238
{
 
239
  Glib::RefPtr<Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->source_window)));
 
240
 
 
241
  if(ref_ptr)
 
242
    ref_ptr->reference();
 
243
 
 
244
  return ref_ptr;
 
245
}
 
246
 
 
247
Glib::RefPtr<const Window> DragContext::get_source_window() const
 
248
{
 
249
  Glib::RefPtr<const Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->source_window)));
 
250
 
 
251
  if(ref_ptr)
 
252
    ref_ptr->reference();
 
253
 
 
254
  return ref_ptr;
 
255
}
 
256
 
 
257
Glib::RefPtr<Window> DragContext::get_destination_window()
 
258
{
 
259
  Glib::RefPtr<Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->dest_window)));
 
260
 
 
261
  if(ref_ptr)
 
262
    ref_ptr->reference();
 
263
 
 
264
  return ref_ptr;
 
265
}
 
266
 
 
267
Glib::RefPtr<const Window> DragContext::get_destination_window() const
 
268
{
 
269
  Glib::RefPtr<const Window> ref_ptr(Glib::wrap((GdkWindowObject*)(gobj()->dest_window)));
 
270
 
 
271
  if(ref_ptr)
 
272
    ref_ptr->reference();
 
273
 
 
274
  return ref_ptr;
 
275
}
 
276
 
 
277
DragProtocol DragContext::get_protocol() const
 
278
{
 
279
  return ((DragProtocol)(gobj()->protocol));
 
280
}
 
281
 
 
282
bool DragContext::get_is_source() const
 
283
{
 
284
  return gobj()->is_source;
 
285
}
 
286
 
 
287
DragAction DragContext::get_actions() const
 
288
{
 
289
  return ((DragAction)(gobj()->actions));
 
290
}
 
291
 
 
292
DragAction DragContext::get_suggested_action() const
 
293
{
 
294
  return ((DragAction)(gobj()->suggested_action));
 
295
}
 
296
 
 
297
DragAction DragContext::get_action() const
 
298
{
 
299
  return ((DragAction)(gobj()->action));
 
300
}
 
301
 
 
302
guint32 DragContext::get_start_time() const
 
303
{
 
304
  return gobj()->start_time;
 
305
}
 
306
 
 
307
 
 
308
} // namespace Gdk
 
309
 
 
310