1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gtkmm/gesture.h>
7 #include <gtkmm/private/gesture_p.h>
8
9
10 /* Copyright (C) 2014 The gtkmm Development Team
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #include <gtk/gtk.h>
27
28 namespace Gtk
29 {
30 // Glib::ListHandler is not well suited for this case, where the contents
31 // of the GList shall not be converted to a C++ type.
get_sequences() const32 std::vector<const GdkEventSequence*> Gesture::get_sequences() const
33 {
34 std::vector<const GdkEventSequence*> sequences;
35 auto list = g_list_first(gtk_gesture_get_sequences(const_cast<GtkGesture*>(gobj())));
36
37 for (GList* node = list; node; node = g_list_next(node))
38 sequences.emplace_back(static_cast<GdkEventSequence*>(node->data));
39
40 g_list_free(list);
41
42 return sequences;
43 }
44
unset_window()45 void Gesture::unset_window()
46 {
47 gtk_gesture_set_window(gobj(), nullptr);
48 }
49
50 } //namespace Gtk
51
52 namespace
53 {
54
55
Gesture_signal_begin_callback(GtkGesture * self,GdkEventSequence * p0,void * data)56 static void Gesture_signal_begin_callback(GtkGesture* self, GdkEventSequence* p0,void* data)
57 {
58 using namespace Gtk;
59 using SlotType = sigc::slot< void,GdkEventSequence* >;
60
61 auto obj = dynamic_cast<Gesture*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
62 // Do not try to call a signal on a disassociated wrapper.
63 if(obj)
64 {
65 try
66 {
67 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
68 (*static_cast<SlotType*>(slot))(p0);
69 }
70 catch(...)
71 {
72 Glib::exception_handlers_invoke();
73 }
74 }
75 }
76
77 static const Glib::SignalProxyInfo Gesture_signal_begin_info =
78 {
79 "begin",
80 (GCallback) &Gesture_signal_begin_callback,
81 (GCallback) &Gesture_signal_begin_callback
82 };
83
84
Gesture_signal_end_callback(GtkGesture * self,GdkEventSequence * p0,void * data)85 static void Gesture_signal_end_callback(GtkGesture* self, GdkEventSequence* p0,void* data)
86 {
87 using namespace Gtk;
88 using SlotType = sigc::slot< void,GdkEventSequence* >;
89
90 auto obj = dynamic_cast<Gesture*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
91 // Do not try to call a signal on a disassociated wrapper.
92 if(obj)
93 {
94 try
95 {
96 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
97 (*static_cast<SlotType*>(slot))(p0);
98 }
99 catch(...)
100 {
101 Glib::exception_handlers_invoke();
102 }
103 }
104 }
105
106 static const Glib::SignalProxyInfo Gesture_signal_end_info =
107 {
108 "end",
109 (GCallback) &Gesture_signal_end_callback,
110 (GCallback) &Gesture_signal_end_callback
111 };
112
113
Gesture_signal_update_callback(GtkGesture * self,GdkEventSequence * p0,void * data)114 static void Gesture_signal_update_callback(GtkGesture* self, GdkEventSequence* p0,void* data)
115 {
116 using namespace Gtk;
117 using SlotType = sigc::slot< void,GdkEventSequence* >;
118
119 auto obj = dynamic_cast<Gesture*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
120 // Do not try to call a signal on a disassociated wrapper.
121 if(obj)
122 {
123 try
124 {
125 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
126 (*static_cast<SlotType*>(slot))(p0);
127 }
128 catch(...)
129 {
130 Glib::exception_handlers_invoke();
131 }
132 }
133 }
134
135 static const Glib::SignalProxyInfo Gesture_signal_update_info =
136 {
137 "update",
138 (GCallback) &Gesture_signal_update_callback,
139 (GCallback) &Gesture_signal_update_callback
140 };
141
142
Gesture_signal_cancel_callback(GtkGesture * self,GdkEventSequence * p0,void * data)143 static void Gesture_signal_cancel_callback(GtkGesture* self, GdkEventSequence* p0,void* data)
144 {
145 using namespace Gtk;
146 using SlotType = sigc::slot< void,GdkEventSequence* >;
147
148 auto obj = dynamic_cast<Gesture*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
149 // Do not try to call a signal on a disassociated wrapper.
150 if(obj)
151 {
152 try
153 {
154 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
155 (*static_cast<SlotType*>(slot))(p0);
156 }
157 catch(...)
158 {
159 Glib::exception_handlers_invoke();
160 }
161 }
162 }
163
164 static const Glib::SignalProxyInfo Gesture_signal_cancel_info =
165 {
166 "cancel",
167 (GCallback) &Gesture_signal_cancel_callback,
168 (GCallback) &Gesture_signal_cancel_callback
169 };
170
171
Gesture_signal_sequence_state_changed_callback(GtkGesture * self,GdkEventSequence * p0,GtkEventSequenceState p1,void * data)172 static void Gesture_signal_sequence_state_changed_callback(GtkGesture* self, GdkEventSequence* p0,GtkEventSequenceState p1,void* data)
173 {
174 using namespace Gtk;
175 using SlotType = sigc::slot< void,GdkEventSequence*,EventSequenceState >;
176
177 auto obj = dynamic_cast<Gesture*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
178 // Do not try to call a signal on a disassociated wrapper.
179 if(obj)
180 {
181 try
182 {
183 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
184 (*static_cast<SlotType*>(slot))(p0, ((EventSequenceState)(p1))
185 );
186 }
187 catch(...)
188 {
189 Glib::exception_handlers_invoke();
190 }
191 }
192 }
193
194 static const Glib::SignalProxyInfo Gesture_signal_sequence_state_changed_info =
195 {
196 "sequence_state_changed",
197 (GCallback) &Gesture_signal_sequence_state_changed_callback,
198 (GCallback) &Gesture_signal_sequence_state_changed_callback
199 };
200
201
202 } // anonymous namespace
203
204 // static
value_type()205 GType Glib::Value<Gtk::EventSequenceState>::value_type()
206 {
207 return gtk_event_sequence_state_get_type();
208 }
209
210
211 namespace Glib
212 {
213
wrap(GtkGesture * object,bool take_copy)214 Glib::RefPtr<Gtk::Gesture> wrap(GtkGesture* object, bool take_copy)
215 {
216 return Glib::RefPtr<Gtk::Gesture>( dynamic_cast<Gtk::Gesture*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
217 //We use dynamic_cast<> in case of multiple inheritance.
218 }
219
220 } /* namespace Glib */
221
222
223 namespace Gtk
224 {
225
226
227 /* The *_Class implementation: */
228
init()229 const Glib::Class& Gesture_Class::init()
230 {
231 if(!gtype_) // create the GType if necessary
232 {
233 // Glib::Class has to know the class init function to clone custom types.
234 class_init_func_ = &Gesture_Class::class_init_function;
235
236 // This is actually just optimized away, apparently with no harm.
237 // Make sure that the parent type has been created.
238 //CppClassParent::CppObjectType::get_type();
239
240 // Create the wrapper type, with the same class/instance size as the base type.
241 register_derived_type(gtk_gesture_get_type());
242
243 // Add derived versions of interfaces, if the C type implements any interfaces:
244
245 }
246
247 return *this;
248 }
249
250
class_init_function(void * g_class,void * class_data)251 void Gesture_Class::class_init_function(void* g_class, void* class_data)
252 {
253 const auto klass = static_cast<BaseClassType*>(g_class);
254 CppClassParent::class_init_function(klass, class_data);
255
256
257 }
258
259
wrap_new(GObject * object)260 Glib::ObjectBase* Gesture_Class::wrap_new(GObject* object)
261 {
262 return new Gesture((GtkGesture*)object);
263 }
264
265
266 /* The implementation: */
267
gobj_copy()268 GtkGesture* Gesture::gobj_copy()
269 {
270 reference();
271 return gobj();
272 }
273
Gesture(const Glib::ConstructParams & construct_params)274 Gesture::Gesture(const Glib::ConstructParams& construct_params)
275 :
276 EventController(construct_params)
277 {
278
279 }
280
Gesture(GtkGesture * castitem)281 Gesture::Gesture(GtkGesture* castitem)
282 :
283 EventController((GtkEventController*)(castitem))
284 {}
285
286
Gesture(Gesture && src)287 Gesture::Gesture(Gesture&& src) noexcept
288 : EventController(std::move(src))
289 {}
290
operator =(Gesture && src)291 Gesture& Gesture::operator=(Gesture&& src) noexcept
292 {
293 EventController::operator=(std::move(src));
294 return *this;
295 }
296
297
~Gesture()298 Gesture::~Gesture() noexcept
299 {}
300
301
302 Gesture::CppClassType Gesture::gesture_class_; // initialize static member
303
get_type()304 GType Gesture::get_type()
305 {
306 return gesture_class_.init().get_type();
307 }
308
309
get_base_type()310 GType Gesture::get_base_type()
311 {
312 return gtk_gesture_get_type();
313 }
314
315
Gesture()316 Gesture::Gesture()
317 :
318 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
319 Glib::ObjectBase(nullptr),
320 EventController(Glib::ConstructParams(gesture_class_.init()))
321 {
322
323
324 }
325
get_device()326 Glib::RefPtr<Gdk::Device> Gesture::get_device()
327 {
328 Glib::RefPtr<Gdk::Device> retvalue = Glib::wrap(gtk_gesture_get_device(gobj()));
329 if(retvalue)
330 retvalue->reference(); //The function does not do a ref for us.
331 return retvalue;
332 }
333
get_device() const334 Glib::RefPtr<const Gdk::Device> Gesture::get_device() const
335 {
336 return const_cast<Gesture*>(this)->get_device();
337 }
338
set_state(EventSequenceState state)339 bool Gesture::set_state(EventSequenceState state)
340 {
341 return gtk_gesture_set_state(gobj(), ((GtkEventSequenceState)(state)));
342 }
343
get_sequence_state(GdkEventSequence * sequence) const344 EventSequenceState Gesture::get_sequence_state(GdkEventSequence* sequence) const
345 {
346 return ((EventSequenceState)(gtk_gesture_get_sequence_state(const_cast<GtkGesture*>(gobj()), sequence)));
347 }
348
set_sequence_state(GdkEventSequence * sequence,EventSequenceState state)349 bool Gesture::set_sequence_state(GdkEventSequence* sequence, EventSequenceState state)
350 {
351 return gtk_gesture_set_sequence_state(gobj(), sequence, ((GtkEventSequenceState)(state)));
352 }
353
get_last_updated_sequence()354 GdkEventSequence* Gesture::get_last_updated_sequence()
355 {
356 return gtk_gesture_get_last_updated_sequence(gobj());
357 }
358
get_last_updated_sequence() const359 const GdkEventSequence* Gesture::get_last_updated_sequence() const
360 {
361 return const_cast<Gesture*>(this)->get_last_updated_sequence();
362 }
363
handles_sequence(GdkEventSequence * sequence) const364 bool Gesture::handles_sequence(GdkEventSequence* sequence) const
365 {
366 return gtk_gesture_handles_sequence(const_cast<GtkGesture*>(gobj()), sequence);
367 }
368
get_last_event(GdkEventSequence * sequence) const369 const GdkEvent* Gesture::get_last_event(GdkEventSequence* sequence) const
370 {
371 return gtk_gesture_get_last_event(const_cast<GtkGesture*>(gobj()), sequence);
372 }
373
get_point(GdkEventSequence * sequence,double & x,double & y) const374 bool Gesture::get_point(GdkEventSequence* sequence, double& x, double& y) const
375 {
376 return gtk_gesture_get_point(const_cast<GtkGesture*>(gobj()), sequence, &(x), &(y));
377 }
378
get_bounding_box(Gdk::Rectangle & rect) const379 bool Gesture::get_bounding_box(Gdk::Rectangle& rect) const
380 {
381 return gtk_gesture_get_bounding_box(const_cast<GtkGesture*>(gobj()), (rect).gobj());
382 }
383
get_bounding_box_center(double & x,double & y) const384 bool Gesture::get_bounding_box_center(double& x, double& y) const
385 {
386 return gtk_gesture_get_bounding_box_center(const_cast<GtkGesture*>(gobj()), &(x), &(y));
387 }
388
is_active() const389 bool Gesture::is_active() const
390 {
391 return gtk_gesture_is_active(const_cast<GtkGesture*>(gobj()));
392 }
393
is_recognized() const394 bool Gesture::is_recognized() const
395 {
396 return gtk_gesture_is_recognized(const_cast<GtkGesture*>(gobj()));
397 }
398
get_window()399 Glib::RefPtr<Gdk::Window> Gesture::get_window()
400 {
401 Glib::RefPtr<Gdk::Window> retvalue = Glib::wrap(gtk_gesture_get_window(gobj()));
402 if(retvalue)
403 retvalue->reference(); //The function does not do a ref for us.
404 return retvalue;
405 }
406
get_window() const407 Glib::RefPtr<const Gdk::Window> Gesture::get_window() const
408 {
409 return const_cast<Gesture*>(this)->get_window();
410 }
411
set_window(const Glib::RefPtr<Gdk::Window> & window)412 void Gesture::set_window(const Glib::RefPtr<Gdk::Window>& window)
413 {
414 gtk_gesture_set_window(gobj(), Glib::unwrap(window));
415 }
416
group(const Glib::RefPtr<Gesture> & group_gesture)417 void Gesture::group(const Glib::RefPtr<Gesture>& group_gesture)
418 {
419 gtk_gesture_group(gobj(), Glib::unwrap(group_gesture));
420 }
421
ungroup()422 void Gesture::ungroup()
423 {
424 gtk_gesture_ungroup(gobj());
425 }
426
get_group()427 std::vector< Glib::RefPtr<Gesture> > Gesture::get_group()
428 {
429 return Glib::ListHandler< Glib::RefPtr<Gesture> >::list_to_vector(gtk_gesture_get_group(gobj()), Glib::OWNERSHIP_SHALLOW);
430 }
431
get_group() const432 std::vector< Glib::RefPtr<const Gesture> > Gesture::get_group() const
433 {
434 return Glib::ListHandler< Glib::RefPtr<const Gesture> >::list_to_vector(gtk_gesture_get_group(const_cast<GtkGesture*>(gobj())), Glib::OWNERSHIP_SHALLOW);
435 }
436
is_grouped_with(const Glib::RefPtr<Gesture> & other) const437 bool Gesture::is_grouped_with(const Glib::RefPtr<Gesture>& other) const
438 {
439 return gtk_gesture_is_grouped_with(const_cast<GtkGesture*>(gobj()), Glib::unwrap(other));
440 }
441
442
signal_begin()443 Glib::SignalProxy< void,GdkEventSequence* > Gesture::signal_begin()
444 {
445 return Glib::SignalProxy< void,GdkEventSequence* >(this, &Gesture_signal_begin_info);
446 }
447
448
signal_end()449 Glib::SignalProxy< void,GdkEventSequence* > Gesture::signal_end()
450 {
451 return Glib::SignalProxy< void,GdkEventSequence* >(this, &Gesture_signal_end_info);
452 }
453
454
signal_update()455 Glib::SignalProxy< void,GdkEventSequence* > Gesture::signal_update()
456 {
457 return Glib::SignalProxy< void,GdkEventSequence* >(this, &Gesture_signal_update_info);
458 }
459
460
signal_cancel()461 Glib::SignalProxy< void,GdkEventSequence* > Gesture::signal_cancel()
462 {
463 return Glib::SignalProxy< void,GdkEventSequence* >(this, &Gesture_signal_cancel_info);
464 }
465
466
signal_sequence_state_changed()467 Glib::SignalProxy< void,GdkEventSequence*,EventSequenceState > Gesture::signal_sequence_state_changed()
468 {
469 return Glib::SignalProxy< void,GdkEventSequence*,EventSequenceState >(this, &Gesture_signal_sequence_state_changed_info);
470 }
471
472
property_n_points() const473 Glib::PropertyProxy_ReadOnly< unsigned int > Gesture::property_n_points() const
474 {
475 return Glib::PropertyProxy_ReadOnly< unsigned int >(this, "n-points");
476 }
477
property_window()478 Glib::PropertyProxy< Glib::RefPtr<Gdk::Window> > Gesture::property_window()
479 {
480 return Glib::PropertyProxy< Glib::RefPtr<Gdk::Window> >(this, "window");
481 }
482
property_window() const483 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Window> > Gesture::property_window() const
484 {
485 return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Window> >(this, "window");
486 }
487
488
489 } // namespace Gtk
490
491
492