Ardour  9.0-pre0-582-g084a23a80d
iconview.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONVIEW_H
4 #define _GTKMM_ICONVIEW_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: iconview.hg,v 1.11 2006/07/08 16:31:38 murrayc Exp $ */
11 
12 /* iconview.h
13  *
14  * Copyright (C) 1998-2004 The gtkmm Development Team
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free
28  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 
31 
32 #include <gtkmm/container.h>
33 #include <gtkmm/treemodel.h>
34 #include <gtkmm/treepath.h>
35 #include <gtkmm/cellrenderer.h>
36 #include <gtkmm/tooltip.h>
37 
38 
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 typedef struct _GtkIconView GtkIconView;
41 typedef struct _GtkIconViewClass GtkIconViewClass;
42 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
43 
44 
45 namespace Gtk
46 { class IconView_Class; } // namespace Gtk
47 namespace Gtk
48 {
49 
57 {
64 };
65 
66 } // namespace Gtk
67 
68 
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 namespace Glib
71 {
72 
73 template <>
74 class Value<Gtk::IconViewDropPosition> : public Glib::Value_Enum<Gtk::IconViewDropPosition>
75 {
76 public:
77  static GType value_type() G_GNUC_CONST;
78 };
79 
80 } // namespace Glib
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 
83 
84 namespace Gtk
85 {
86 
87 
88 //TODO: This should derive+implement from CellLayout when we can break ABI.
89 
101 class IconView : public Container
102 {
103  public:
104 #ifndef DOXYGEN_SHOULD_SKIP_THIS
105  typedef IconView CppObjectType;
106  typedef IconView_Class CppClassType;
107  typedef GtkIconView BaseObjectType;
108  typedef GtkIconViewClass BaseClassType;
109 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
110 
111  virtual ~IconView();
112 
113 #ifndef DOXYGEN_SHOULD_SKIP_THIS
114 
115 private:
116  friend class IconView_Class;
117  static CppClassType iconview_class_;
118 
119  // noncopyable
120  IconView(const IconView&);
121  IconView& operator=(const IconView&);
122 
123 protected:
124  explicit IconView(const Glib::ConstructParams& construct_params);
125  explicit IconView(GtkIconView* castitem);
126 
127 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
128 
129 public:
130 #ifndef DOXYGEN_SHOULD_SKIP_THIS
131  static GType get_type() G_GNUC_CONST;
132 
133 
134  static GType get_base_type() G_GNUC_CONST;
135 #endif
136 
138  GtkIconView* gobj() { return reinterpret_cast<GtkIconView*>(gobject_); }
139 
141  const GtkIconView* gobj() const { return reinterpret_cast<GtkIconView*>(gobject_); }
142 
143 
144 public:
145  //C++ methods used to invoke GTK+ virtual functions:
146 
147 protected:
148  //GTK+ Virtual Functions (override these to change behaviour):
149 
150  //Default Signal Handlers::
152  virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment);
154  virtual void on_item_activated(const TreeModel::Path& path);
156  virtual void on_selection_changed();
157 
158 
159 private:
160 
161 public:
162 
164  explicit IconView(const Glib::RefPtr<TreeModel>& model);
165 
166 
174  void set_model(const Glib::RefPtr<TreeModel>& model);
175 
182  Glib::RefPtr<TreeModel> get_model();
183 
190  Glib::RefPtr<const TreeModel> get_model() const;
191 
196  void unset_model();
197 
198 
204  void set_text_column(int column);
205 
211  void set_text_column(const TreeModelColumnBase& model_column);
212 
217  int get_text_column() const;
218 
226  void set_markup_column(int column);
227 
236 
241  int get_markup_column() const;
242 
248  void set_pixbuf_column(int column);
249 
256 
261  int get_pixbuf_column() const;
262 
263 
271  void set_orientation(Orientation orientation);
272 
281 
282 
289 
296 
297 
305  void set_columns(int columns);
306 
311  int get_columns() const;
312 
319  void set_item_width(int item_width);
320 
325  int get_icon_width() const;
326 
333  void set_spacing(int spacing);
334 
339  int get_spacing() const;
340 
346  void set_row_spacing(int row_spacing);
347 
352  gint get_row_spacing() const;
353 
359  void set_column_spacing(int column_spacing);
360 
365  int get_column_spacing() const;
366 
367 
374  void set_margin(int margin);
375 
380  int get_margin() const;
381 
382 
394  TreeModel::Path get_path_at_pos(int x, int y) const;
395 
396 
406  bool get_item_at_pos(int x, int y, TreeModel::Path& path, CellRenderer*& cell) const;
407 
416  bool get_item_at_pos(int x, int y, TreeModel::Path& path) const;
417 
426  bool get_item_at_pos(int x, int y, CellRenderer*& cell) const;
427 
428 
429  bool get_visible_range(TreeModel::Path& start_path, TreeModel::Path& end_path) const;
430 
431 
435  typedef sigc::slot<void, const TreeModel::Path&> SlotForeach;
436 
442  void selected_foreach(const SlotForeach& slot);
443 
444 
445 //Default value?:
446 
452 
458 
464 
470 
478 
479 
480  #ifndef DOXYGEN_SHOULD_SKIP_THIS
481  //TODO: I'm not sure about these to_*() functions. murrayc.
482  struct TreePathTraits
483  {
484  typedef TreePath CppType;
485  typedef const GtkTreePath* CType;
486  typedef GtkTreePath* CTypeNonConst;
487 
488  static CType to_c_type (const CppType& obj) { return obj.gobj(); }
489  static CType to_c_type (const CType& obj) { return obj; }
490  static CppType to_cpp_type (const CType& obj) { return CppType(const_cast<CTypeNonConst>(obj), true); }
491  static void release_c_type (const CType&) {}
492  };
493  #endif //DOXYGEN_SHOULD_SKIP_THIS
494 
495  typedef Glib::ListHandle<TreePath, TreePathTraits> ArrayHandle_TreePaths;
496 
497 
510 
511 
515  void select_all();
516 
519  void unselect_all();
520 
526 
527  //TODO: Add a version with no cell parameter.
528 
543  void set_cursor(const TreeModel::Path& path, CellRenderer& cell, bool start_editing);
544 
554 
563 
571  bool get_cursor(CellRenderer*& cell) const;
572 
573 
594  void scroll_to_path(const TreeModel::Path& path, bool use_align, gfloat row_align, gfloat col_align);
595 
596 /* Drag-and-Drop support */
605  Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
607 
608 
615 
616 
621 
626 
627 
643  void set_reorderable(bool reorderable = true);
644 
650  bool get_reorderable() const;
651 
652 
653 /* These are useful to implement your own custom stuff. */
654  //TODO: Discover what arguments are output arguments:
655 
662 
669 
675 
681 
682 
691  bool get_dest_item_at_pos(int drag_x, int drag_y, TreeModel::Path& path, IconViewDropPosition& pos) const;
692 
700  bool get_dest_item_at_pos(int drag_x, int drag_y, TreeModel::Path& path) const;
701 
709  bool get_dest_item_at_pos(int drag_x, int drag_y, IconViewDropPosition& pos) const;
710 
711 
718  Glib::RefPtr<Gdk::Pixmap> create_drag_icon(const TreeModel::Path& path);
719 
720 
729  void convert_widget_to_bin_window_coords(int wx, int wy, int& bx, int& by) const;
730 
731 
738  void set_tooltip_item(const Glib::RefPtr<Tooltip>& tooltip, const TreeModel::Path& path);
739 
747  void set_tooltip_cell(const Glib::RefPtr<Tooltip>& tooltip, const TreeModel::Path& path, CellRenderer& cell);
748 
754  void set_tooltip_cell(const Glib::RefPtr<Tooltip>& tooltip, const TreeModel::Path& path);
755 
756 
777  bool get_tooltip_context_path(int& x, int& y,
778  bool keyboard_tip,
780 
801  bool get_tooltip_context_iter(int& x, int& y,
802  bool keyboard_tip,
804 
805 
816  void set_tooltip_column(int column);
817 
824  int get_tooltip_column() const;
825 
826 
833  Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
834 
835 
842  Glib::SignalProxy1< void,const TreeModel::Path& > signal_item_activated();
843 
844 
851  Glib::SignalProxy0< void > signal_selection_changed();
852 
853 
854  /* Key binding signals */
855 
856 
862  Glib::PropertyProxy< int > property_pixbuf_column() ;
863 
869  Glib::PropertyProxy_ReadOnly< int > property_pixbuf_column() const;
870 
876  Glib::PropertyProxy< int > property_text_column() ;
877 
883  Glib::PropertyProxy_ReadOnly< int > property_text_column() const;
884 
890  Glib::PropertyProxy< int > property_markup_column() ;
891 
897  Glib::PropertyProxy_ReadOnly< int > property_markup_column() const;
898 
904  Glib::PropertyProxy< int > property_tooltip_column() ;
905 
911  Glib::PropertyProxy_ReadOnly< int > property_tooltip_column() const;
912 
918  Glib::PropertyProxy< SelectionMode > property_selection_mode() ;
919 
925  Glib::PropertyProxy_ReadOnly< SelectionMode > property_selection_mode() const;
926 
932  Glib::PropertyProxy< Orientation > property_orientation() ;
933 
939  Glib::PropertyProxy_ReadOnly< Orientation > property_orientation() const;
940  //deprecated
946  Glib::PropertyProxy< Orientation > property_item_orientation() ;
947 
953  Glib::PropertyProxy_ReadOnly< Orientation > property_item_orientation() const;
954 
960  Glib::PropertyProxy< bool > property_reorderable() ;
961 
967  Glib::PropertyProxy_ReadOnly< bool > property_reorderable() const;
968 
974  Glib::PropertyProxy< Glib::RefPtr<TreeModel> > property_model() ;
975 
981  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > property_model() const;
982 
988  Glib::PropertyProxy< int > property_columns() ;
989 
995  Glib::PropertyProxy_ReadOnly< int > property_columns() const;
996 
1002  Glib::PropertyProxy< int > property_item_width() ;
1003 
1009  Glib::PropertyProxy_ReadOnly< int > property_item_width() const;
1010 
1016  Glib::PropertyProxy< int > property_spacing() ;
1017 
1023  Glib::PropertyProxy_ReadOnly< int > property_spacing() const;
1024 
1030  Glib::PropertyProxy< int > property_row_spacing() ;
1031 
1037  Glib::PropertyProxy_ReadOnly< int > property_row_spacing() const;
1038 
1044  Glib::PropertyProxy< int > property_column_spacing() ;
1045 
1051  Glib::PropertyProxy_ReadOnly< int > property_column_spacing() const;
1052 
1058  Glib::PropertyProxy< int > property_margin() ;
1059 
1065  Glib::PropertyProxy_ReadOnly< int > property_margin() const;
1066 
1072  Glib::PropertyProxy< int > property_item_padding() ;
1073 
1079  Glib::PropertyProxy_ReadOnly< int > property_item_padding() const;
1080 
1081 
1082 };
1083 
1084 } // namespace Gtk
1085 
1086 
1087 namespace Glib
1088 {
1097  Gtk::IconView* wrap(GtkIconView* object, bool take_copy = false);
1098 } //namespace Glib
1099 
1100 
1101 #endif /* _GTKMM_ICONVIEW_H */
1102 
void select_all()
Glib::SignalProxy1< void, const TreeModel::Path & > signal_item_activated()
void set_reorderable(bool reorderable=true)
Glib::PropertyProxy< int > property_pixbuf_column()
void set_orientation(Orientation orientation)
Glib::PropertyProxy_ReadOnly< int > property_column_spacing() const
Glib::PropertyProxy< int > property_margin()
Glib::RefPtr< const TreeModel > get_model() const
ArrayHandle_TreePaths get_selected_items() const
void get_drag_dest_item(IconViewDropPosition &pos) const
void set_tooltip_column(int column)
void set_tooltip_cell(const Glib::RefPtr< Tooltip > &tooltip, const TreeModel::Path &path, CellRenderer &cell)
int get_markup_column() const
void unselect_path(const TreeModel::Path &path)
void set_pixbuf_column(const TreeModelColumnBase &column)
void set_margin(int margin)
bool get_dest_item_at_pos(int drag_x, int drag_y, TreeModel::Path &path) const
void set_text_column(int column)
Glib::PropertyProxy_ReadOnly< int > property_item_width() const
Glib::PropertyProxy_ReadOnly< Orientation > property_item_orientation() const
Glib::PropertyProxy< int > property_column_spacing()
Glib::RefPtr< TreeModel > get_model()
Glib::PropertyProxy< bool > property_reorderable()
int get_pixbuf_column() const
Glib::PropertyProxy< Orientation > property_orientation()
bool get_cursor(TreeModel::Path &path, CellRenderer *&cell) const
void set_drag_dest_item(const TreeModel::Path &path, IconViewDropPosition pos)
void scroll_to_path(const TreeModel::Path &path, bool use_align, gfloat row_align, gfloat col_align)
void set_selection_mode(SelectionMode mode)
Orientation get_orientation() const
void set_markup_column(const TreeModelColumnBase &column)
Glib::PropertyProxy_ReadOnly< int > property_text_column() const
Glib::PropertyProxy_ReadOnly< int > property_tooltip_column() const
void select_path(const TreeModel::Path &path)
void unset_model_drag_source()
int get_tooltip_column() const
void set_tooltip_item(const Glib::RefPtr< Tooltip > &tooltip, const TreeModel::Path &path)
Glib::PropertyProxy< int > property_text_column()
void set_columns(int columns)
int get_column_spacing() const
bool get_tooltip_context_path(int &x, int &y, bool keyboard_tip, TreeModel::Path &path)
virtual void on_selection_changed()
This is a default handler for the signal signal_selection_changed().
Glib::PropertyProxy< int > property_columns()
void set_text_column(const TreeModelColumnBase &model_column)
Glib::PropertyProxy< int > property_markup_column()
bool get_item_at_pos(int x, int y, CellRenderer *&cell) const
Glib::PropertyProxy_ReadOnly< int > property_item_padding() const
Glib::RefPtr< Gdk::Pixmap > create_drag_icon(const TreeModel::Path &path)
Orientation get_item_orientation() const
void unselect_all()
Glib::PropertyProxy< SelectionMode > property_selection_mode()
virtual void on_set_scroll_adjustments(Adjustment *hadjustment, Adjustment *vadjustment)
This is a default handler for the signal signal_set_scroll_adjustments().
Glib::PropertyProxy< Orientation > property_item_orientation()
bool get_cursor(CellRenderer *&cell) const
void enable_model_drag_source(const ArrayHandle_TargetEntry &targets, Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
void convert_widget_to_bin_window_coords(int wx, int wy, int &bx, int &by) const
Glib::PropertyProxy_ReadOnly< bool > property_reorderable() const
void set_spacing(int spacing)
Glib::PropertyProxy< Glib::RefPtr< TreeModel > > property_model()
void set_pixbuf_column(int column)
bool get_dest_item_at_pos(int drag_x, int drag_y, IconViewDropPosition &pos) const
Glib::SignalProxy2< void, Adjustment *, Adjustment * > signal_set_scroll_adjustments()
int get_margin() const
Glib::ListHandle< TreePath, TreePathTraits > ArrayHandle_TreePaths
Definition: iconview.h:495
bool get_cursor(TreeModel::Path &path) const
bool get_item_at_pos(int x, int y, TreeModel::Path &path) const
Glib::PropertyProxy_ReadOnly< int > property_margin() const
Glib::PropertyProxy< int > property_spacing()
void set_column_spacing(int column_spacing)
void get_drag_dest_item(TreeModel::Path &path, IconViewDropPosition &pos) const
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< TreeModel > > property_model() const
bool get_tooltip_context_iter(int &x, int &y, bool keyboard_tip, Gtk::TreeModel::iterator &iter)
Glib::PropertyProxy< int > property_row_spacing()
Glib::PropertyProxy_ReadOnly< int > property_markup_column() const
Glib::PropertyProxy_ReadOnly< int > property_row_spacing() const
Glib::PropertyProxy_ReadOnly< int > property_columns() const
sigc::slot< void, const TreeModel::Path & > SlotForeach
Definition: iconview.h:435
void set_cursor(const TreeModel::Path &path, CellRenderer &cell, bool start_editing)
virtual ~IconView()
void set_item_orientation(Orientation orientation)
Glib::PropertyProxy_ReadOnly< SelectionMode > property_selection_mode() const
Glib::PropertyProxy_ReadOnly< Orientation > property_orientation() const
bool get_visible_range(TreeModel::Path &start_path, TreeModel::Path &end_path) const
Glib::PropertyProxy< int > property_item_width()
int get_spacing() const
Glib::PropertyProxy_ReadOnly< int > property_spacing() const
GtkIconView * gobj()
Provides access to the underlying C GtkObject.
Definition: iconview.h:138
IconView(const Glib::RefPtr< TreeModel > &model)
void enable_model_drag_dest(const ArrayHandle_TargetEntry &targets, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
void set_tooltip_cell(const Glib::RefPtr< Tooltip > &tooltip, const TreeModel::Path &path)
Glib::PropertyProxy< int > property_item_padding()
int get_icon_width() const
void set_model(const Glib::RefPtr< TreeModel > &model)
bool get_reorderable() const
int get_text_column() const
gint get_row_spacing() const
void unset_model()
Gtk::IconView * wrap(GtkIconView *object, bool take_copy=false)
bool path_is_selected(const TreeModel::Path &path) const
void selected_foreach(const SlotForeach &slot)
Glib::PropertyProxy_ReadOnly< int > property_pixbuf_column() const
const GtkIconView * gobj() const
Provides access to the underlying C GtkObject.
Definition: iconview.h:141
SelectionMode get_selection_mode() const
int get_columns() const
void item_activated(const TreeModel::Path &path)
void set_markup_column(int column)
bool get_item_at_pos(int x, int y, TreeModel::Path &path, CellRenderer *&cell) const
Glib::SignalProxy0< void > signal_selection_changed()
void set_item_width(int item_width)
TreeModel::Path get_path_at_pos(int x, int y) const
void unset_model_drag_dest()
Glib::PropertyProxy< int > property_tooltip_column()
void set_row_spacing(int row_spacing)
virtual void on_item_activated(const TreeModel::Path &path)
This is a default handler for the signal signal_item_activated().
bool get_dest_item_at_pos(int drag_x, int drag_y, TreeModel::Path &path, IconViewDropPosition &pos) const
void get_drag_dest_item(TreeModel::Path &path) const
GtkTreePath * gobj()
Provides access to the underlying C instance.
Definition: treepath.h:80
void path(Glib::ustring &path, Glib::ustring &path_reversed)
Compute a widget's path of the form "GtkWindow.MyLabel".
DragAction
Definition: dragcontext.h:68
@ ACTION_MOVE
Definition: dragcontext.h:71
@ ACTION_COPY
Definition: dragcontext.h:70
IconViewDropPosition
Definition: iconview.h:57
@ ICON_VIEW_DROP_ABOVE
Definition: iconview.h:62
@ ICON_VIEW_NO_DROP
Definition: iconview.h:58
@ ICON_VIEW_DROP_RIGHT
Definition: iconview.h:61
@ ICON_VIEW_DROP_LEFT
Definition: iconview.h:60
@ ICON_VIEW_DROP_INTO
Definition: iconview.h:59
@ ICON_VIEW_DROP_BELOW
Definition: iconview.h:63
struct _GtkTreePath GtkTreePath
Definition: gtktreemodel.h:44
Definition: ardour_ui.h:188
Glib::ArrayHandle< TargetEntry, TargetEntry_Traits > ArrayHandle_TargetEntry
Definition: targetentry.h:91
Definition: lobject.h:100