Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / iconview.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/iconview.h>
4 #include <gtkmm/private/iconview_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* Copyright 1998-2004 The gtkmm Development Team
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25
26 #include <gtkmm/adjustment.h> 
27 #include <gtk/gtkiconview.h>
28
29 namespace //anonymous namespace
30 {
31
32 void proxy_foreach_callback(GtkIconView* /* icon_view */, GtkTreePath* path, void* data)
33 {
34   typedef Gtk::IconView::SlotForeach SlotType;
35   SlotType& slot = *static_cast<SlotType*>(data);
36
37   try
38   {
39     slot(Gtk::TreeModel::Path(path, true));
40   }
41   catch(...)
42   {
43     Glib::exception_handlers_invoke();
44   }
45 }
46
47 } //anonymous namespace
48
49
50 namespace Gtk
51 {
52
53 //Allow the generated code to work without the prefix:
54 typedef IconView::ArrayHandle_TreePaths ArrayHandle_TreePaths;
55
56 void IconView::selected_foreach(const SlotForeach& slot)
57 {
58   SlotForeach slot_copy(slot);
59   gtk_icon_view_selected_foreach(const_cast<GtkIconView*>(gobj()), &proxy_foreach_callback, &slot_copy);
60 }
61   
62
63 } // namespace Gtk
64
65
66 namespace
67 {
68
69 void IconView_signal_set_scroll_adjustments_callback(GtkIconView* self, GtkAdjustment* p0,GtkAdjustment* p1,void* data)
70 {
71   using namespace Gtk;
72   typedef sigc::slot< void,Adjustment*,Adjustment* > SlotType;
73
74   // Do not try to call a signal on a disassociated wrapper.
75   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
76   {
77     try
78     {
79       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
80         (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
81 , Glib::wrap(p1)
82 );
83     }
84     catch(...)
85     {
86       Glib::exception_handlers_invoke();
87     }
88   }
89 }
90
91 const Glib::SignalProxyInfo IconView_signal_set_scroll_adjustments_info =
92 {
93   "set_scroll_adjustments",
94   (GCallback) &IconView_signal_set_scroll_adjustments_callback,
95   (GCallback) &IconView_signal_set_scroll_adjustments_callback
96 };
97
98
99 void IconView_signal_item_activated_callback(GtkIconView* self, GtkTreePath* p0,void* data)
100 {
101   using namespace Gtk;
102   typedef sigc::slot< void,const TreeModel::Path& > SlotType;
103
104   // Do not try to call a signal on a disassociated wrapper.
105   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
106   {
107     try
108     {
109       if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
110         (*static_cast<SlotType*>(slot))(Gtk::TreePath(p0, true)
111 );
112     }
113     catch(...)
114     {
115       Glib::exception_handlers_invoke();
116     }
117   }
118 }
119
120 const Glib::SignalProxyInfo IconView_signal_item_activated_info =
121 {
122   "item_activated",
123   (GCallback) &IconView_signal_item_activated_callback,
124   (GCallback) &IconView_signal_item_activated_callback
125 };
126
127
128 const Glib::SignalProxyInfo IconView_signal_selection_changed_info =
129 {
130   "selection_changed",
131   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
132   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
133 };
134
135 } // anonymous namespace
136
137
138 namespace Glib
139 {
140
141 Gtk::IconView* wrap(GtkIconView* object, bool take_copy)
142 {
143   return dynamic_cast<Gtk::IconView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
144 }
145
146 } /* namespace Glib */
147
148 namespace Gtk
149 {
150
151
152 /* The *_Class implementation: */
153
154 const Glib::Class& IconView_Class::init()
155 {
156   if(!gtype_) // create the GType if necessary
157   {
158     // Glib::Class has to know the class init function to clone custom types.
159     class_init_func_ = &IconView_Class::class_init_function;
160
161     // This is actually just optimized away, apparently with no harm.
162     // Make sure that the parent type has been created.
163     //CppClassParent::CppObjectType::get_type();
164
165     // Create the wrapper type, with the same class/instance size as the base type.
166     register_derived_type(gtk_icon_view_get_type());
167
168     // Add derived versions of interfaces, if the C type implements any interfaces:
169   }
170
171   return *this;
172 }
173
174 void IconView_Class::class_init_function(void* g_class, void* class_data)
175 {
176   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
177   CppClassParent::class_init_function(klass, class_data);
178
179   klass->set_scroll_adjustments = &set_scroll_adjustments_callback;
180   klass->item_activated = &item_activated_callback;
181   klass->selection_changed = &selection_changed_callback;
182 }
183
184
185 void IconView_Class::set_scroll_adjustments_callback(GtkIconView* self, GtkAdjustment* p0, GtkAdjustment* p1)
186 {
187   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
188       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
189
190   // Non-gtkmmproc-generated custom classes implicitly call the default
191   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
192   // generated classes can use this optimisation, which avoids the unnecessary
193   // parameter conversions if there is no possibility of the virtual function
194   // being overridden:
195   if(obj && obj->is_derived_())
196   {
197     try // Trap C++ exceptions which would normally be lost because this is a C callback.
198     {
199       // Call the virtual member method, which derived classes might override.
200       obj->on_set_scroll_adjustments(Glib::wrap(p0)
201 , Glib::wrap(p1)
202 );
203     }
204     catch(...)
205     {
206       Glib::exception_handlers_invoke();
207     }
208   }
209   else
210   {
211     BaseClassType *const base = static_cast<BaseClassType*>(
212         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
213     );
214
215     // Call the original underlying C function:
216     if(base && base->set_scroll_adjustments)
217       (*base->set_scroll_adjustments)(self, p0, p1);
218   }
219 }
220
221 void IconView_Class::item_activated_callback(GtkIconView* self, GtkTreePath* p0)
222 {
223   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
224       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
225
226   // Non-gtkmmproc-generated custom classes implicitly call the default
227   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
228   // generated classes can use this optimisation, which avoids the unnecessary
229   // parameter conversions if there is no possibility of the virtual function
230   // being overridden:
231   if(obj && obj->is_derived_())
232   {
233     try // Trap C++ exceptions which would normally be lost because this is a C callback.
234     {
235       // Call the virtual member method, which derived classes might override.
236       obj->on_item_activated(Gtk::TreePath(p0, true)
237 );
238     }
239     catch(...)
240     {
241       Glib::exception_handlers_invoke();
242     }
243   }
244   else
245   {
246     BaseClassType *const base = static_cast<BaseClassType*>(
247         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
248     );
249
250     // Call the original underlying C function:
251     if(base && base->item_activated)
252       (*base->item_activated)(self, p0);
253   }
254 }
255
256 void IconView_Class::selection_changed_callback(GtkIconView* self)
257 {
258   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
259       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
260
261   // Non-gtkmmproc-generated custom classes implicitly call the default
262   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
263   // generated classes can use this optimisation, which avoids the unnecessary
264   // parameter conversions if there is no possibility of the virtual function
265   // being overridden:
266   if(obj && obj->is_derived_())
267   {
268     try // Trap C++ exceptions which would normally be lost because this is a C callback.
269     {
270       // Call the virtual member method, which derived classes might override.
271       obj->on_selection_changed();
272     }
273     catch(...)
274     {
275       Glib::exception_handlers_invoke();
276     }
277   }
278   else
279   {
280     BaseClassType *const base = static_cast<BaseClassType*>(
281         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
282     );
283
284     // Call the original underlying C function:
285     if(base && base->selection_changed)
286       (*base->selection_changed)(self);
287   }
288 }
289
290
291 Glib::ObjectBase* IconView_Class::wrap_new(GObject* o)
292 {
293   return manage(new IconView((GtkIconView*)(o)));
294
295 }
296
297
298 /* The implementation: */
299
300 IconView::IconView(const Glib::ConstructParams& construct_params)
301 :
302   Gtk::Container(construct_params)
303 {
304   }
305
306 IconView::IconView(GtkIconView* castitem)
307 :
308   Gtk::Container((GtkContainer*)(castitem))
309 {
310   }
311
312 IconView::~IconView()
313 {
314   destroy_();
315 }
316
317 IconView::CppClassType IconView::iconview_class_; // initialize static member
318
319 GType IconView::get_type()
320 {
321   return iconview_class_.init().get_type();
322 }
323
324 GType IconView::get_base_type()
325 {
326   return gtk_icon_view_get_type();
327 }
328
329
330 IconView::IconView()
331 :
332   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
333   Gtk::Container(Glib::ConstructParams(iconview_class_.init()))
334 {
335   }
336
337 IconView::IconView(const Glib::RefPtr<TreeModel>& model)
338 :
339   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
340   Gtk::Container(Glib::ConstructParams(iconview_class_.init(), "model", Glib::unwrap(model), (char*) 0))
341 {
342   }
343
344 void IconView::set_model(const Glib::RefPtr<TreeModel>& model)
345 {
346   gtk_icon_view_set_model(gobj(), Glib::unwrap(model));
347 }
348
349 Glib::RefPtr<TreeModel> IconView::get_model()
350 {
351   return Glib::wrap(gtk_icon_view_get_model(gobj()));
352 }
353
354 Glib::RefPtr<const TreeModel> IconView::get_model() const
355 {
356   return Glib::wrap(gtk_icon_view_get_model(const_cast<GtkIconView*>(gobj())));
357 }
358
359 void IconView::set_text_column(int column)
360 {
361   gtk_icon_view_set_text_column(gobj(), column);
362 }
363
364 void IconView::set_text_column(const TreeModelColumnBase& model_column)
365 {
366   gtk_icon_view_set_text_column(gobj(), (model_column).index());
367 }
368
369 int IconView::get_text_column() const
370 {
371   return gtk_icon_view_get_text_column(const_cast<GtkIconView*>(gobj()));
372 }
373
374 void IconView::set_markup_column(int column)
375 {
376   gtk_icon_view_set_markup_column(gobj(), column);
377 }
378
379 void IconView::set_markup_column(const TreeModelColumnBase& column)
380 {
381   gtk_icon_view_set_markup_column(gobj(), (column).index());
382 }
383
384 int IconView::get_markup_column() const
385 {
386   return gtk_icon_view_get_markup_column(const_cast<GtkIconView*>(gobj()));
387 }
388
389 void IconView::set_pixbuf_column(int column)
390 {
391   gtk_icon_view_set_pixbuf_column(gobj(), column);
392 }
393
394 void IconView::set_pixbuf_column(const TreeModelColumnBase& column)
395 {
396   gtk_icon_view_set_pixbuf_column(gobj(), (column).index());
397 }
398
399 int IconView::get_pixbuf_column() const
400 {
401   return gtk_icon_view_get_pixbuf_column(const_cast<GtkIconView*>(gobj()));
402 }
403
404 void IconView::set_orientation(Orientation orientation)
405 {
406   gtk_icon_view_set_orientation(gobj(), ((GtkOrientation)(orientation)));
407 }
408
409 Orientation IconView::get_orientation() const
410 {
411   return ((Orientation)(gtk_icon_view_get_orientation(const_cast<GtkIconView*>(gobj()))));
412 }
413
414 void IconView::set_columns(int columns)
415 {
416   gtk_icon_view_set_columns(gobj(), columns);
417 }
418
419 int IconView::get_columns() const
420 {
421   return gtk_icon_view_get_columns(const_cast<GtkIconView*>(gobj()));
422 }
423
424 void IconView::set_item_width(int item_width)
425 {
426   gtk_icon_view_set_item_width(gobj(), item_width);
427 }
428
429 int IconView::get_icon_width() const
430 {
431   return gtk_icon_view_get_item_width(const_cast<GtkIconView*>(gobj()));
432 }
433
434 void IconView::set_spacing(int spacing)
435 {
436   gtk_icon_view_set_spacing(gobj(), spacing);
437 }
438
439 int IconView::get_spacing() const
440 {
441   return gtk_icon_view_get_spacing(const_cast<GtkIconView*>(gobj()));
442 }
443
444 void IconView::set_row_spacing(int row_spacing)
445 {
446   gtk_icon_view_set_row_spacing(gobj(), row_spacing);
447 }
448
449 gint IconView::get_row_spacing() const
450 {
451   return gtk_icon_view_get_row_spacing(const_cast<GtkIconView*>(gobj()));
452 }
453
454 void IconView::set_column_spacing(int column_spacing)
455 {
456   gtk_icon_view_set_column_spacing(gobj(), column_spacing);
457 }
458
459 int IconView::get_column_spacing() const
460 {
461   return gtk_icon_view_get_column_spacing(const_cast<GtkIconView*>(gobj()));
462 }
463
464 void IconView::set_margin(int margin)
465 {
466   gtk_icon_view_set_margin(gobj(), margin);
467 }
468
469 int IconView::get_margin() const
470 {
471   return gtk_icon_view_get_margin(const_cast<GtkIconView*>(gobj()));
472 }
473
474 TreeModel::Path IconView::get_path_at_pos(int x, int y) const
475 {
476   return Gtk::TreePath(gtk_icon_view_get_path_at_pos(const_cast<GtkIconView*>(gobj()), x, y), false);
477 }
478
479 void IconView::set_selection_mode(SelectionMode mode)
480 {
481   gtk_icon_view_set_selection_mode(gobj(), ((GtkSelectionMode)(mode)));
482 }
483
484 SelectionMode IconView::get_selection_mode() const
485 {
486   return ((SelectionMode)(gtk_icon_view_get_selection_mode(const_cast<GtkIconView*>(gobj()))));
487 }
488
489 void IconView::select_path(const TreeModel::Path& path)
490 {
491   gtk_icon_view_select_path(gobj(), const_cast<GtkTreePath*>((path).gobj()));
492 }
493
494 void IconView::unselect_path(const TreeModel::Path& path)
495 {
496   gtk_icon_view_unselect_path(gobj(), const_cast<GtkTreePath*>((path).gobj()));
497 }
498
499 bool IconView::path_is_selected(const TreeModel::Path& path) const
500 {
501   return gtk_icon_view_path_is_selected(const_cast<GtkIconView*>(gobj()), const_cast<GtkTreePath*>((path).gobj()));
502 }
503
504 ArrayHandle_TreePaths IconView::get_selected_items() const
505 {
506   return ArrayHandle_TreePaths(gtk_icon_view_get_selected_items(const_cast<GtkIconView*>(gobj())), Glib::OWNERSHIP_SHALLOW);
507 }
508
509 void IconView::select_all()
510 {
511   gtk_icon_view_select_all(gobj());
512 }
513
514 void IconView::unselect_all()
515 {
516   gtk_icon_view_unselect_all(gobj());
517 }
518
519 void IconView::item_activated(const TreeModel::Path& path)
520 {
521   gtk_icon_view_item_activated(gobj(), const_cast<GtkTreePath*>((path).gobj()));
522 }
523
524
525 Glib::SignalProxy2< void,Adjustment*,Adjustment* > IconView::signal_set_scroll_adjustments()
526 {
527   return Glib::SignalProxy2< void,Adjustment*,Adjustment* >(this, &IconView_signal_set_scroll_adjustments_info);
528 }
529
530 Glib::SignalProxy1< void,const TreeModel::Path& > IconView::signal_item_activated()
531 {
532   return Glib::SignalProxy1< void,const TreeModel::Path& >(this, &IconView_signal_item_activated_info);
533 }
534
535 Glib::SignalProxy0< void > IconView::signal_selection_changed()
536 {
537   return Glib::SignalProxy0< void >(this, &IconView_signal_selection_changed_info);
538 }
539
540
541 Glib::PropertyProxy<int> IconView::property_pixbuf_column() 
542 {
543   return Glib::PropertyProxy<int>(this, "pixbuf-column");
544 }
545
546 Glib::PropertyProxy_ReadOnly<int> IconView::property_pixbuf_column() const
547 {
548   return Glib::PropertyProxy_ReadOnly<int>(this, "pixbuf-column");
549 }
550
551 Glib::PropertyProxy<int> IconView::property_text_column() 
552 {
553   return Glib::PropertyProxy<int>(this, "text-column");
554 }
555
556 Glib::PropertyProxy_ReadOnly<int> IconView::property_text_column() const
557 {
558   return Glib::PropertyProxy_ReadOnly<int>(this, "text-column");
559 }
560
561 Glib::PropertyProxy<int> IconView::property_markup_column() 
562 {
563   return Glib::PropertyProxy<int>(this, "markup-column");
564 }
565
566 Glib::PropertyProxy_ReadOnly<int> IconView::property_markup_column() const
567 {
568   return Glib::PropertyProxy_ReadOnly<int>(this, "markup-column");
569 }
570
571 Glib::PropertyProxy<SelectionMode> IconView::property_selection_mode() 
572 {
573   return Glib::PropertyProxy<SelectionMode>(this, "selection-mode");
574 }
575
576 Glib::PropertyProxy_ReadOnly<SelectionMode> IconView::property_selection_mode() const
577 {
578   return Glib::PropertyProxy_ReadOnly<SelectionMode>(this, "selection-mode");
579 }
580
581 Glib::PropertyProxy<Orientation> IconView::property_orientation() 
582 {
583   return Glib::PropertyProxy<Orientation>(this, "orientation");
584 }
585
586 Glib::PropertyProxy_ReadOnly<Orientation> IconView::property_orientation() const
587 {
588   return Glib::PropertyProxy_ReadOnly<Orientation>(this, "orientation");
589 }
590
591 Glib::PropertyProxy< Glib::RefPtr<TreeModel> > IconView::property_model() 
592 {
593   return Glib::PropertyProxy< Glib::RefPtr<TreeModel> >(this, "model");
594 }
595
596 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > IconView::property_model() const
597 {
598   return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> >(this, "model");
599 }
600
601 Glib::PropertyProxy<int> IconView::property_columns() 
602 {
603   return Glib::PropertyProxy<int>(this, "columns");
604 }
605
606 Glib::PropertyProxy_ReadOnly<int> IconView::property_columns() const
607 {
608   return Glib::PropertyProxy_ReadOnly<int>(this, "columns");
609 }
610
611 Glib::PropertyProxy<int> IconView::property_item_width() 
612 {
613   return Glib::PropertyProxy<int>(this, "item-width");
614 }
615
616 Glib::PropertyProxy_ReadOnly<int> IconView::property_item_width() const
617 {
618   return Glib::PropertyProxy_ReadOnly<int>(this, "item-width");
619 }
620
621 Glib::PropertyProxy<int> IconView::property_spacing() 
622 {
623   return Glib::PropertyProxy<int>(this, "spacing");
624 }
625
626 Glib::PropertyProxy_ReadOnly<int> IconView::property_spacing() const
627 {
628   return Glib::PropertyProxy_ReadOnly<int>(this, "spacing");
629 }
630
631 Glib::PropertyProxy<int> IconView::property_row_spacing() 
632 {
633   return Glib::PropertyProxy<int>(this, "row-spacing");
634 }
635
636 Glib::PropertyProxy_ReadOnly<int> IconView::property_row_spacing() const
637 {
638   return Glib::PropertyProxy_ReadOnly<int>(this, "row-spacing");
639 }
640
641 Glib::PropertyProxy<int> IconView::property_column_spacing() 
642 {
643   return Glib::PropertyProxy<int>(this, "column-spacing");
644 }
645
646 Glib::PropertyProxy_ReadOnly<int> IconView::property_column_spacing() const
647 {
648   return Glib::PropertyProxy_ReadOnly<int>(this, "column-spacing");
649 }
650
651 Glib::PropertyProxy<int> IconView::property_margin() 
652 {
653   return Glib::PropertyProxy<int>(this, "margin");
654 }
655
656 Glib::PropertyProxy_ReadOnly<int> IconView::property_margin() const
657 {
658   return Glib::PropertyProxy_ReadOnly<int>(this, "margin");
659 }
660
661
662 void Gtk::IconView::on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment)
663 {
664   BaseClassType *const base = static_cast<BaseClassType*>(
665       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
666   );
667
668   if(base && base->set_scroll_adjustments)
669     (*base->set_scroll_adjustments)(gobj(),(GtkAdjustment*)Glib::unwrap(hadjustment),(GtkAdjustment*)Glib::unwrap(vadjustment));
670 }
671
672 void Gtk::IconView::on_item_activated(const TreeModel::Path& path)
673 {
674   BaseClassType *const base = static_cast<BaseClassType*>(
675       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
676   );
677
678   if(base && base->item_activated)
679     (*base->item_activated)(gobj(),const_cast<GtkTreePath*>((path).gobj()));
680 }
681
682 void Gtk::IconView::on_selection_changed()
683 {
684   BaseClassType *const base = static_cast<BaseClassType*>(
685       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
686   );
687
688   if(base && base->selection_changed)
689     (*base->selection_changed)(gobj());
690 }
691
692
693 } // namespace Gtk
694
695