1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gtkmm/recentchooser.h>
7 #include <gtkmm/private/recentchooser_p.h>
8
9
10 /* Copyright 2006 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, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27 #include <glibmm/vectorutils.h>
28
29 #include <gtk/gtk.h>
30
31 // This Signal Proxy allows the C++ coder to specify a sigc::slot instead of a static function.
32
SignalProxy_Compare_gtk_callback(GtkRecentInfo * a,GtkRecentInfo * b,gpointer data)33 static int SignalProxy_Compare_gtk_callback(GtkRecentInfo* a, GtkRecentInfo* b, gpointer data)
34 {
35 const auto the_slot = static_cast<Gtk::RecentChooser::SlotCompare*>(data);
36
37 try
38 {
39 return (*the_slot)(Glib::wrap(a, true /* take reference */), Glib::wrap(b, true /* take reference */));
40 }
41 catch(...)
42 {
43 Glib::exception_handlers_invoke();
44 }
45
46 return 0;
47 }
48
SignalProxy_Compare_gtk_callback_destroy(gpointer data)49 static void SignalProxy_Compare_gtk_callback_destroy(gpointer data)
50 {
51 delete static_cast<Gtk::RecentChooser::SlotCompare*>(data);
52 }
53
54
55 namespace Gtk
56 {
57
set_sort_func(const SlotCompare & slot)58 void RecentChooser::set_sort_func(const SlotCompare& slot)
59 {
60 auto slot_copy = new SlotCompare(slot);
61
62 gtk_recent_chooser_set_sort_func(
63 gobj(),
64 &SignalProxy_Compare_gtk_callback, slot_copy,
65 &SignalProxy_Compare_gtk_callback_destroy);
66 }
67
get_uris() const68 std::vector<Glib::ustring> RecentChooser::get_uris() const
69 {
70 return Glib::ArrayHandler<Glib::ustring>::array_to_vector(gtk_recent_chooser_get_uris(const_cast<GtkRecentChooser*>(gobj()), nullptr), Glib::OWNERSHIP_DEEP);
71 }
72
unset_limit()73 void RecentChooser::unset_limit()
74 {
75 gtk_recent_chooser_set_limit(gobj(), -1 /* See C docs */);
76 }
77
78 } // namespace Gtk
79
80
81 namespace
82 {
83
84
85 static const Glib::SignalProxyInfo RecentChooser_signal_selection_changed_info =
86 {
87 "selection-changed",
88 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
89 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
90 };
91
92
93 static const Glib::SignalProxyInfo RecentChooser_signal_item_activated_info =
94 {
95 "item-activated",
96 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
97 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
98 };
99
100
101 } // anonymous namespace
102
103 // static
value_type()104 GType Glib::Value<Gtk::RecentSortType>::value_type()
105 {
106 return gtk_recent_sort_type_get_type();
107 }
108
109
RecentChooserError(Gtk::RecentChooserError::Code error_code,const Glib::ustring & error_message)110 Gtk::RecentChooserError::RecentChooserError(Gtk::RecentChooserError::Code error_code, const Glib::ustring& error_message)
111 :
112 Glib::Error (GTK_RECENT_CHOOSER_ERROR, error_code, error_message)
113 {}
114
RecentChooserError(GError * gobject)115 Gtk::RecentChooserError::RecentChooserError(GError* gobject)
116 :
117 Glib::Error (gobject)
118 {}
119
code() const120 Gtk::RecentChooserError::Code Gtk::RecentChooserError::code() const
121 {
122 return static_cast<Code>(Glib::Error::code());
123 }
124
throw_func(GError * gobject)125 void Gtk::RecentChooserError::throw_func(GError* gobject)
126 {
127 throw Gtk::RecentChooserError(gobject);
128 }
129
130 // static
value_type()131 GType Glib::Value<Gtk::RecentChooserError::Code>::value_type()
132 {
133 return gtk_recent_chooser_error_get_type();
134 }
135
136
137 namespace Glib
138 {
139
wrap(GtkRecentChooser * object,bool take_copy)140 Glib::RefPtr<Gtk::RecentChooser> wrap(GtkRecentChooser* object, bool take_copy)
141 {
142 return Glib::RefPtr<Gtk::RecentChooser>( dynamic_cast<Gtk::RecentChooser*> (Glib::wrap_auto_interface<Gtk::RecentChooser> ((GObject*)(object), take_copy)) );
143 //We use dynamic_cast<> in case of multiple inheritance.
144 }
145
146 } // namespace Glib
147
148
149 namespace Gtk
150 {
151
152
153 /* The *_Class implementation: */
154
init()155 const Glib::Interface_Class& RecentChooser_Class::init()
156 {
157 if(!gtype_) // create the GType if necessary
158 {
159 // Glib::Interface_Class has to know the interface init function
160 // in order to add interfaces to implementing types.
161 class_init_func_ = &RecentChooser_Class::iface_init_function;
162
163 // We can not derive from another interface, and it is not necessary anyway.
164 gtype_ = gtk_recent_chooser_get_type();
165 }
166
167 return *this;
168 }
169
iface_init_function(void * g_iface,void *)170 void RecentChooser_Class::iface_init_function(void* g_iface, void*)
171 {
172 const auto klass = static_cast<BaseClassType*>(g_iface);
173
174 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
175 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
176 g_assert(klass != nullptr);
177
178 klass->get_current_uri = &get_current_uri_vfunc_callback;
179 klass->unselect_uri = &unselect_uri_vfunc_callback;
180 klass->select_all = &select_all_vfunc_callback;
181 klass->unselect_all = &unselect_all_vfunc_callback;
182 klass->get_recent_manager = &get_recent_manager_vfunc_callback;
183 klass->add_filter = &add_filter_vfunc_callback;
184 klass->remove_filter = &remove_filter_vfunc_callback;
185
186 klass->selection_changed = &selection_changed_callback;
187 klass->item_activated = &item_activated_callback;
188 }
189
get_current_uri_vfunc_callback(GtkRecentChooser * self)190 gchar* RecentChooser_Class::get_current_uri_vfunc_callback(GtkRecentChooser* self)
191 {
192 const auto obj_base = static_cast<Glib::ObjectBase*>(
193 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
194
195 // Non-gtkmmproc-generated custom classes implicitly call the default
196 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
197 // generated classes can use this optimisation, which avoids the unnecessary
198 // parameter conversions if there is no possibility of the virtual function
199 // being overridden:
200 if(obj_base && obj_base->is_derived_())
201 {
202 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
203 if(obj) // This can be NULL during destruction.
204 {
205 try // Trap C++ exceptions which would normally be lost because this is a C callback.
206 {
207 // Call the virtual member method, which derived classes might override.
208 return g_strdup((obj->get_current_uri_vfunc()).c_str());
209 }
210 catch(...)
211 {
212 Glib::exception_handlers_invoke();
213 }
214 }
215 }
216
217 BaseClassType *const base = static_cast<BaseClassType*>(
218 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
219 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
220 ) );
221
222 // Call the original underlying C function:
223 if(base && base->get_current_uri)
224 return (*base->get_current_uri)(self);
225
226 using RType = gchar*;
227 return RType();
228 }
unselect_uri_vfunc_callback(GtkRecentChooser * self,const gchar * uri)229 void RecentChooser_Class::unselect_uri_vfunc_callback(GtkRecentChooser* self, const gchar* uri)
230 {
231 const auto obj_base = static_cast<Glib::ObjectBase*>(
232 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
233
234 // Non-gtkmmproc-generated custom classes implicitly call the default
235 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
236 // generated classes can use this optimisation, which avoids the unnecessary
237 // parameter conversions if there is no possibility of the virtual function
238 // being overridden:
239 if(obj_base && obj_base->is_derived_())
240 {
241 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
242 if(obj) // This can be NULL during destruction.
243 {
244 try // Trap C++ exceptions which would normally be lost because this is a C callback.
245 {
246 // Call the virtual member method, which derived classes might override.
247 obj->unselect_uri_vfunc(Glib::convert_const_gchar_ptr_to_ustring(uri)
248 );
249 return;
250 }
251 catch(...)
252 {
253 Glib::exception_handlers_invoke();
254 }
255 }
256 }
257
258 BaseClassType *const base = static_cast<BaseClassType*>(
259 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
260 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
261 ) );
262
263 // Call the original underlying C function:
264 if(base && base->unselect_uri)
265 (*base->unselect_uri)(self, uri);
266 }
select_all_vfunc_callback(GtkRecentChooser * self)267 void RecentChooser_Class::select_all_vfunc_callback(GtkRecentChooser* self)
268 {
269 const auto obj_base = static_cast<Glib::ObjectBase*>(
270 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
271
272 // Non-gtkmmproc-generated custom classes implicitly call the default
273 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
274 // generated classes can use this optimisation, which avoids the unnecessary
275 // parameter conversions if there is no possibility of the virtual function
276 // being overridden:
277 if(obj_base && obj_base->is_derived_())
278 {
279 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
280 if(obj) // This can be NULL during destruction.
281 {
282 try // Trap C++ exceptions which would normally be lost because this is a C callback.
283 {
284 // Call the virtual member method, which derived classes might override.
285 obj->select_all_vfunc();
286 return;
287 }
288 catch(...)
289 {
290 Glib::exception_handlers_invoke();
291 }
292 }
293 }
294
295 BaseClassType *const base = static_cast<BaseClassType*>(
296 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
297 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
298 ) );
299
300 // Call the original underlying C function:
301 if(base && base->select_all)
302 (*base->select_all)(self);
303 }
unselect_all_vfunc_callback(GtkRecentChooser * self)304 void RecentChooser_Class::unselect_all_vfunc_callback(GtkRecentChooser* self)
305 {
306 const auto obj_base = static_cast<Glib::ObjectBase*>(
307 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
308
309 // Non-gtkmmproc-generated custom classes implicitly call the default
310 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
311 // generated classes can use this optimisation, which avoids the unnecessary
312 // parameter conversions if there is no possibility of the virtual function
313 // being overridden:
314 if(obj_base && obj_base->is_derived_())
315 {
316 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
317 if(obj) // This can be NULL during destruction.
318 {
319 try // Trap C++ exceptions which would normally be lost because this is a C callback.
320 {
321 // Call the virtual member method, which derived classes might override.
322 obj->unselect_all_vfunc();
323 return;
324 }
325 catch(...)
326 {
327 Glib::exception_handlers_invoke();
328 }
329 }
330 }
331
332 BaseClassType *const base = static_cast<BaseClassType*>(
333 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
334 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
335 ) );
336
337 // Call the original underlying C function:
338 if(base && base->unselect_all)
339 (*base->unselect_all)(self);
340 }
get_recent_manager_vfunc_callback(GtkRecentChooser * self)341 GtkRecentManager* RecentChooser_Class::get_recent_manager_vfunc_callback(GtkRecentChooser* self)
342 {
343 const auto obj_base = static_cast<Glib::ObjectBase*>(
344 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
345
346 // Non-gtkmmproc-generated custom classes implicitly call the default
347 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
348 // generated classes can use this optimisation, which avoids the unnecessary
349 // parameter conversions if there is no possibility of the virtual function
350 // being overridden:
351 if(obj_base && obj_base->is_derived_())
352 {
353 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
354 if(obj) // This can be NULL during destruction.
355 {
356 try // Trap C++ exceptions which would normally be lost because this is a C callback.
357 {
358 // Call the virtual member method, which derived classes might override.
359 return Glib::unwrap(obj->get_recent_manager_vfunc());
360 }
361 catch(...)
362 {
363 Glib::exception_handlers_invoke();
364 }
365 }
366 }
367
368 BaseClassType *const base = static_cast<BaseClassType*>(
369 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
370 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
371 ) );
372
373 // Call the original underlying C function:
374 if(base && base->get_recent_manager)
375 return (*base->get_recent_manager)(self);
376
377 using RType = GtkRecentManager*;
378 return RType();
379 }
add_filter_vfunc_callback(GtkRecentChooser * self,GtkRecentFilter * filter)380 void RecentChooser_Class::add_filter_vfunc_callback(GtkRecentChooser* self, GtkRecentFilter* filter)
381 {
382 const auto obj_base = static_cast<Glib::ObjectBase*>(
383 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
384
385 // Non-gtkmmproc-generated custom classes implicitly call the default
386 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
387 // generated classes can use this optimisation, which avoids the unnecessary
388 // parameter conversions if there is no possibility of the virtual function
389 // being overridden:
390 if(obj_base && obj_base->is_derived_())
391 {
392 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
393 if(obj) // This can be NULL during destruction.
394 {
395 try // Trap C++ exceptions which would normally be lost because this is a C callback.
396 {
397 // Call the virtual member method, which derived classes might override.
398 obj->add_filter_vfunc(Glib::wrap(filter, true)
399 );
400 return;
401 }
402 catch(...)
403 {
404 Glib::exception_handlers_invoke();
405 }
406 }
407 }
408
409 BaseClassType *const base = static_cast<BaseClassType*>(
410 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
411 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
412 ) );
413
414 // Call the original underlying C function:
415 if(base && base->add_filter)
416 (*base->add_filter)(self, filter);
417 }
remove_filter_vfunc_callback(GtkRecentChooser * self,GtkRecentFilter * filter)418 void RecentChooser_Class::remove_filter_vfunc_callback(GtkRecentChooser* self, GtkRecentFilter* filter)
419 {
420 const auto obj_base = static_cast<Glib::ObjectBase*>(
421 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
422
423 // Non-gtkmmproc-generated custom classes implicitly call the default
424 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
425 // generated classes can use this optimisation, which avoids the unnecessary
426 // parameter conversions if there is no possibility of the virtual function
427 // being overridden:
428 if(obj_base && obj_base->is_derived_())
429 {
430 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
431 if(obj) // This can be NULL during destruction.
432 {
433 try // Trap C++ exceptions which would normally be lost because this is a C callback.
434 {
435 // Call the virtual member method, which derived classes might override.
436 obj->remove_filter_vfunc(Glib::wrap(filter, true)
437 );
438 return;
439 }
440 catch(...)
441 {
442 Glib::exception_handlers_invoke();
443 }
444 }
445 }
446
447 BaseClassType *const base = static_cast<BaseClassType*>(
448 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
449 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
450 ) );
451
452 // Call the original underlying C function:
453 if(base && base->remove_filter)
454 (*base->remove_filter)(self, filter);
455 }
456
selection_changed_callback(GtkRecentChooser * self)457 void RecentChooser_Class::selection_changed_callback(GtkRecentChooser* self)
458 {
459 const auto obj_base = static_cast<Glib::ObjectBase*>(
460 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
461
462 // Non-gtkmmproc-generated custom classes implicitly call the default
463 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
464 // generated classes can use this optimisation, which avoids the unnecessary
465 // parameter conversions if there is no possibility of the virtual function
466 // being overridden:
467 if(obj_base && obj_base->is_derived_())
468 {
469 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
470 if(obj) // This can be NULL during destruction.
471 {
472 try // Trap C++ exceptions which would normally be lost because this is a C callback.
473 {
474 // Call the virtual member method, which derived classes might override.
475 obj->on_selection_changed();
476 return;
477 }
478 catch(...)
479 {
480 Glib::exception_handlers_invoke();
481 }
482 }
483 }
484
485 const auto base = static_cast<BaseClassType*>(
486 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
487 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
488 ) );
489
490 // Call the original underlying C function:
491 if(base && base->selection_changed)
492 (*base->selection_changed)(self);
493 }
item_activated_callback(GtkRecentChooser * self)494 void RecentChooser_Class::item_activated_callback(GtkRecentChooser* self)
495 {
496 const auto obj_base = static_cast<Glib::ObjectBase*>(
497 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
498
499 // Non-gtkmmproc-generated custom classes implicitly call the default
500 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
501 // generated classes can use this optimisation, which avoids the unnecessary
502 // parameter conversions if there is no possibility of the virtual function
503 // being overridden:
504 if(obj_base && obj_base->is_derived_())
505 {
506 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
507 if(obj) // This can be NULL during destruction.
508 {
509 try // Trap C++ exceptions which would normally be lost because this is a C callback.
510 {
511 // Call the virtual member method, which derived classes might override.
512 obj->on_item_activated();
513 return;
514 }
515 catch(...)
516 {
517 Glib::exception_handlers_invoke();
518 }
519 }
520 }
521
522 const auto base = static_cast<BaseClassType*>(
523 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
524 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
525 ) );
526
527 // Call the original underlying C function:
528 if(base && base->item_activated)
529 (*base->item_activated)(self);
530 }
531
532
wrap_new(GObject * object)533 Glib::ObjectBase* RecentChooser_Class::wrap_new(GObject* object)
534 {
535 return new RecentChooser((GtkRecentChooser*)(object));
536 }
537
538
539 /* The implementation: */
540
RecentChooser()541 RecentChooser::RecentChooser()
542 :
543 Glib::Interface(recentchooser_class_.init())
544 {}
545
RecentChooser(GtkRecentChooser * castitem)546 RecentChooser::RecentChooser(GtkRecentChooser* castitem)
547 :
548 Glib::Interface((GObject*)(castitem))
549 {}
550
RecentChooser(const Glib::Interface_Class & interface_class)551 RecentChooser::RecentChooser(const Glib::Interface_Class& interface_class)
552 : Glib::Interface(interface_class)
553 {
554 }
555
RecentChooser(RecentChooser && src)556 RecentChooser::RecentChooser(RecentChooser&& src) noexcept
557 : Glib::Interface(std::move(src))
558 {}
559
operator =(RecentChooser && src)560 RecentChooser& RecentChooser::operator=(RecentChooser&& src) noexcept
561 {
562 Glib::Interface::operator=(std::move(src));
563 return *this;
564 }
565
~RecentChooser()566 RecentChooser::~RecentChooser() noexcept
567 {}
568
569 // static
add_interface(GType gtype_implementer)570 void RecentChooser::add_interface(GType gtype_implementer)
571 {
572 recentchooser_class_.init().add_interface(gtype_implementer);
573 }
574
575 RecentChooser::CppClassType RecentChooser::recentchooser_class_; // initialize static member
576
get_type()577 GType RecentChooser::get_type()
578 {
579 return recentchooser_class_.init().get_type();
580 }
581
582
get_base_type()583 GType RecentChooser::get_base_type()
584 {
585 return gtk_recent_chooser_get_type();
586 }
587
588
set_show_private(bool show_private)589 void RecentChooser::set_show_private(bool show_private)
590 {
591 gtk_recent_chooser_set_show_private(gobj(), static_cast<int>(show_private));
592 }
593
get_show_private() const594 bool RecentChooser::get_show_private() const
595 {
596 return gtk_recent_chooser_get_show_private(const_cast<GtkRecentChooser*>(gobj()));
597 }
598
set_show_not_found(bool show_not_found)599 void RecentChooser::set_show_not_found(bool show_not_found)
600 {
601 gtk_recent_chooser_set_show_not_found(gobj(), static_cast<int>(show_not_found));
602 }
603
get_show_not_found() const604 bool RecentChooser::get_show_not_found() const
605 {
606 return gtk_recent_chooser_get_show_not_found(const_cast<GtkRecentChooser*>(gobj()));
607 }
608
set_select_multiple(bool select_multiple)609 void RecentChooser::set_select_multiple(bool select_multiple)
610 {
611 gtk_recent_chooser_set_select_multiple(gobj(), static_cast<int>(select_multiple));
612 }
613
get_select_multiple() const614 bool RecentChooser::get_select_multiple() const
615 {
616 return gtk_recent_chooser_get_select_multiple(const_cast<GtkRecentChooser*>(gobj()));
617 }
618
set_limit(int limit)619 void RecentChooser::set_limit(int limit)
620 {
621 gtk_recent_chooser_set_limit(gobj(), limit);
622 }
623
get_limit() const624 int RecentChooser::get_limit() const
625 {
626 return gtk_recent_chooser_get_limit(const_cast<GtkRecentChooser*>(gobj()));
627 }
628
set_local_only(bool local_only)629 void RecentChooser::set_local_only(bool local_only)
630 {
631 gtk_recent_chooser_set_local_only(gobj(), static_cast<int>(local_only));
632 }
633
get_local_only() const634 bool RecentChooser::get_local_only() const
635 {
636 return gtk_recent_chooser_get_local_only(const_cast<GtkRecentChooser*>(gobj()));
637 }
638
set_show_tips(bool show_tips)639 void RecentChooser::set_show_tips(bool show_tips)
640 {
641 gtk_recent_chooser_set_show_tips(gobj(), static_cast<int>(show_tips));
642 }
643
get_show_tips() const644 bool RecentChooser::get_show_tips() const
645 {
646 return gtk_recent_chooser_get_show_tips(const_cast<GtkRecentChooser*>(gobj()));
647 }
648
set_show_icons(bool show_icons)649 void RecentChooser::set_show_icons(bool show_icons)
650 {
651 gtk_recent_chooser_set_show_icons(gobj(), static_cast<int>(show_icons));
652 }
653
get_show_icons() const654 bool RecentChooser::get_show_icons() const
655 {
656 return gtk_recent_chooser_get_show_icons(const_cast<GtkRecentChooser*>(gobj()));
657 }
658
set_sort_type(RecentSortType sort_type)659 void RecentChooser::set_sort_type(RecentSortType sort_type)
660 {
661 gtk_recent_chooser_set_sort_type(gobj(), ((GtkRecentSortType)(sort_type)));
662 }
663
get_sort_type() const664 RecentSortType RecentChooser::get_sort_type() const
665 {
666 return ((RecentSortType)(gtk_recent_chooser_get_sort_type(const_cast<GtkRecentChooser*>(gobj()))));
667 }
668
set_current_uri(const Glib::ustring & uri)669 bool RecentChooser::set_current_uri(const Glib::ustring& uri)
670 {
671 GError* gerror = nullptr;
672 bool retvalue = gtk_recent_chooser_set_current_uri(gobj(), uri.c_str(), &(gerror));
673 if(gerror)
674 ::Glib::Error::throw_exception(gerror);
675 return retvalue;
676 }
677
get_current_uri() const678 Glib::ustring RecentChooser::get_current_uri() const
679 {
680 return Glib::convert_return_gchar_ptr_to_ustring(gtk_recent_chooser_get_current_uri(const_cast<GtkRecentChooser*>(gobj())));
681 }
682
get_current_item()683 Glib::RefPtr<RecentInfo> RecentChooser::get_current_item()
684 {
685 Glib::RefPtr<RecentInfo> retvalue = Glib::wrap(gtk_recent_chooser_get_current_item(gobj()));
686 if(retvalue)
687 retvalue->reference(); //The function does not do a ref for us.
688 return retvalue;
689 }
690
get_current_item() const691 Glib::RefPtr<const RecentInfo> RecentChooser::get_current_item() const
692 {
693 Glib::RefPtr<const RecentInfo> retvalue = Glib::wrap(gtk_recent_chooser_get_current_item(const_cast<GtkRecentChooser*>(gobj())));
694 if(retvalue)
695 retvalue->reference(); //The function does not do a ref for us.
696 return retvalue;
697 }
698
select_uri(const Glib::ustring & uri)699 bool RecentChooser::select_uri(const Glib::ustring& uri)
700 {
701 GError* gerror = nullptr;
702 bool retvalue = gtk_recent_chooser_select_uri(gobj(), uri.c_str(), &(gerror));
703 if(gerror)
704 ::Glib::Error::throw_exception(gerror);
705 return retvalue;
706 }
707
unselect_uri(const Glib::ustring & uri)708 void RecentChooser::unselect_uri(const Glib::ustring& uri)
709 {
710 gtk_recent_chooser_unselect_uri(gobj(), uri.c_str());
711 }
712
select_all()713 void RecentChooser::select_all()
714 {
715 gtk_recent_chooser_select_all(gobj());
716 }
717
unselect_all()718 void RecentChooser::unselect_all()
719 {
720 gtk_recent_chooser_unselect_all(gobj());
721 }
722
get_items() const723 std::vector<Glib::RefPtr<RecentInfo> > RecentChooser::get_items() const
724 {
725 return Glib::ListHandler<Glib::RefPtr<RecentInfo>, RecentInfoTraits>::list_to_vector(gtk_recent_chooser_get_items(const_cast<GtkRecentChooser*>(gobj())), Glib::OWNERSHIP_SHALLOW);
726 }
727
add_filter(const Glib::RefPtr<RecentFilter> & filter)728 void RecentChooser::add_filter(const Glib::RefPtr<RecentFilter>& filter)
729 {
730 gtk_recent_chooser_add_filter(gobj(), Glib::unwrap(filter));
731 }
732
remove_filter(const Glib::RefPtr<RecentFilter> & filter)733 void RecentChooser::remove_filter(const Glib::RefPtr<RecentFilter>& filter)
734 {
735 gtk_recent_chooser_remove_filter(gobj(), Glib::unwrap(filter));
736 }
737
list_filters()738 std::vector< Glib::RefPtr<RecentFilter> > RecentChooser::list_filters()
739 {
740 return Glib::SListHandler<Glib::RefPtr<RecentFilter> >::slist_to_vector(gtk_recent_chooser_list_filters(gobj()), Glib::OWNERSHIP_SHALLOW);
741 }
742
list_filters() const743 std::vector< Glib::RefPtr<const RecentFilter> > RecentChooser::list_filters() const
744 {
745 return Glib::SListHandler<Glib::RefPtr<const RecentFilter> >::slist_to_vector(gtk_recent_chooser_list_filters(const_cast<GtkRecentChooser*>(gobj())), Glib::OWNERSHIP_SHALLOW);
746 }
747
set_filter(const Glib::RefPtr<RecentFilter> & filter)748 void RecentChooser::set_filter(const Glib::RefPtr<RecentFilter>& filter)
749 {
750 gtk_recent_chooser_set_filter(gobj(), Glib::unwrap(filter));
751 }
752
get_filter()753 Glib::RefPtr<RecentFilter> RecentChooser::get_filter()
754 {
755 Glib::RefPtr<RecentFilter> retvalue = Glib::wrap(gtk_recent_chooser_get_filter(gobj()));
756 if(retvalue)
757 retvalue->reference(); //The function does not do a ref for us.
758 return retvalue;
759 }
760
get_filter() const761 Glib::RefPtr<const RecentFilter> RecentChooser::get_filter() const
762 {
763 return const_cast<RecentChooser*>(this)->get_filter();
764 }
765
766
signal_selection_changed()767 Glib::SignalProxy< void > RecentChooser::signal_selection_changed()
768 {
769 return Glib::SignalProxy< void >(this, &RecentChooser_signal_selection_changed_info);
770 }
771
772
signal_item_activated()773 Glib::SignalProxy< void > RecentChooser::signal_item_activated()
774 {
775 return Glib::SignalProxy< void >(this, &RecentChooser_signal_item_activated_info);
776 }
777
778
property_show_private()779 Glib::PropertyProxy< bool > RecentChooser::property_show_private()
780 {
781 return Glib::PropertyProxy< bool >(this, "show-private");
782 }
783
property_show_private() const784 Glib::PropertyProxy_ReadOnly< bool > RecentChooser::property_show_private() const
785 {
786 return Glib::PropertyProxy_ReadOnly< bool >(this, "show-private");
787 }
788
property_show_tips()789 Glib::PropertyProxy< bool > RecentChooser::property_show_tips()
790 {
791 return Glib::PropertyProxy< bool >(this, "show-tips");
792 }
793
property_show_tips() const794 Glib::PropertyProxy_ReadOnly< bool > RecentChooser::property_show_tips() const
795 {
796 return Glib::PropertyProxy_ReadOnly< bool >(this, "show-tips");
797 }
798
property_show_icons()799 Glib::PropertyProxy< bool > RecentChooser::property_show_icons()
800 {
801 return Glib::PropertyProxy< bool >(this, "show-icons");
802 }
803
property_show_icons() const804 Glib::PropertyProxy_ReadOnly< bool > RecentChooser::property_show_icons() const
805 {
806 return Glib::PropertyProxy_ReadOnly< bool >(this, "show-icons");
807 }
808
property_show_not_found()809 Glib::PropertyProxy< bool > RecentChooser::property_show_not_found()
810 {
811 return Glib::PropertyProxy< bool >(this, "show-not-found");
812 }
813
property_show_not_found() const814 Glib::PropertyProxy_ReadOnly< bool > RecentChooser::property_show_not_found() const
815 {
816 return Glib::PropertyProxy_ReadOnly< bool >(this, "show-not-found");
817 }
818
property_select_multiple()819 Glib::PropertyProxy< bool > RecentChooser::property_select_multiple()
820 {
821 return Glib::PropertyProxy< bool >(this, "select-multiple");
822 }
823
property_select_multiple() const824 Glib::PropertyProxy_ReadOnly< bool > RecentChooser::property_select_multiple() const
825 {
826 return Glib::PropertyProxy_ReadOnly< bool >(this, "select-multiple");
827 }
828
property_local_only()829 Glib::PropertyProxy< bool > RecentChooser::property_local_only()
830 {
831 return Glib::PropertyProxy< bool >(this, "local-only");
832 }
833
property_local_only() const834 Glib::PropertyProxy_ReadOnly< bool > RecentChooser::property_local_only() const
835 {
836 return Glib::PropertyProxy_ReadOnly< bool >(this, "local-only");
837 }
838
property_limit()839 Glib::PropertyProxy< int > RecentChooser::property_limit()
840 {
841 return Glib::PropertyProxy< int >(this, "limit");
842 }
843
property_limit() const844 Glib::PropertyProxy_ReadOnly< int > RecentChooser::property_limit() const
845 {
846 return Glib::PropertyProxy_ReadOnly< int >(this, "limit");
847 }
848
property_sort_type()849 Glib::PropertyProxy< RecentSortType > RecentChooser::property_sort_type()
850 {
851 return Glib::PropertyProxy< RecentSortType >(this, "sort-type");
852 }
853
property_sort_type() const854 Glib::PropertyProxy_ReadOnly< RecentSortType > RecentChooser::property_sort_type() const
855 {
856 return Glib::PropertyProxy_ReadOnly< RecentSortType >(this, "sort-type");
857 }
858
property_filter()859 Glib::PropertyProxy< Glib::RefPtr<RecentFilter> > RecentChooser::property_filter()
860 {
861 return Glib::PropertyProxy< Glib::RefPtr<RecentFilter> >(this, "filter");
862 }
863
property_filter() const864 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<RecentFilter> > RecentChooser::property_filter() const
865 {
866 return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<RecentFilter> >(this, "filter");
867 }
868
869
on_selection_changed()870 void Gtk::RecentChooser::on_selection_changed()
871 {
872 const auto base = static_cast<BaseClassType*>(
873 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
874 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
875 ) );
876
877 if(base && base->selection_changed)
878 (*base->selection_changed)(gobj());
879 }
on_item_activated()880 void Gtk::RecentChooser::on_item_activated()
881 {
882 const auto base = static_cast<BaseClassType*>(
883 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
884 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
885 ) );
886
887 if(base && base->item_activated)
888 (*base->item_activated)(gobj());
889 }
890
get_current_uri_vfunc() const891 Glib::ustring Gtk::RecentChooser::get_current_uri_vfunc() const
892 {
893 const auto base = static_cast<BaseClassType*>(
894 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
895 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
896 ) );
897
898 if(base && base->get_current_uri)
899 {
900 Glib::ustring retval(Glib::convert_return_gchar_ptr_to_ustring((*base->get_current_uri)(const_cast<GtkRecentChooser*>(gobj()))));
901 return retval;
902 }
903
904 using RType = Glib::ustring;
905 return RType();
906 }
unselect_uri_vfunc(const Glib::ustring & uri)907 void Gtk::RecentChooser::unselect_uri_vfunc(const Glib::ustring& uri)
908 {
909 const auto base = static_cast<BaseClassType*>(
910 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
911 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
912 ) );
913
914 if(base && base->unselect_uri)
915 {
916 (*base->unselect_uri)(gobj(),uri.c_str());
917 }
918 }
select_all_vfunc()919 void Gtk::RecentChooser::select_all_vfunc()
920 {
921 const auto base = static_cast<BaseClassType*>(
922 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
923 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
924 ) );
925
926 if(base && base->select_all)
927 {
928 (*base->select_all)(gobj());
929 }
930 }
unselect_all_vfunc()931 void Gtk::RecentChooser::unselect_all_vfunc()
932 {
933 const auto base = static_cast<BaseClassType*>(
934 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
935 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
936 ) );
937
938 if(base && base->unselect_all)
939 {
940 (*base->unselect_all)(gobj());
941 }
942 }
get_recent_manager_vfunc()943 Glib::RefPtr<RecentManager> Gtk::RecentChooser::get_recent_manager_vfunc()
944 {
945 const auto base = static_cast<BaseClassType*>(
946 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
947 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
948 ) );
949
950 if(base && base->get_recent_manager)
951 {
952 Glib::RefPtr<RecentManager> retval(Glib::wrap((*base->get_recent_manager)(gobj())));
953 return retval;
954 }
955
956 using RType = Glib::RefPtr<RecentManager>;
957 return RType();
958 }
add_filter_vfunc(const Glib::RefPtr<RecentFilter> & filter)959 void Gtk::RecentChooser::add_filter_vfunc(const Glib::RefPtr<RecentFilter>& filter)
960 {
961 const auto base = static_cast<BaseClassType*>(
962 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
963 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
964 ) );
965
966 if(base && base->add_filter)
967 {
968 (*base->add_filter)(gobj(),Glib::unwrap(filter));
969 }
970 }
remove_filter_vfunc(const Glib::RefPtr<RecentFilter> & filter)971 void Gtk::RecentChooser::remove_filter_vfunc(const Glib::RefPtr<RecentFilter>& filter)
972 {
973 const auto base = static_cast<BaseClassType*>(
974 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
975 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
976 ) );
977
978 if(base && base->remove_filter)
979 {
980 (*base->remove_filter)(gobj(),Glib::unwrap(filter));
981 }
982 }
983
984
985 } // namespace Gtk
986
987
988