Ardour  8.7-14-g57a6773833
menushell.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_MENUSHELL_H
4 #define _GTKMM_MENUSHELL_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: menushell.hg,v 1.9 2006/06/21 20:04:25 murrayc Exp $ */
11 
12 /* Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 #include <gdk/gdkkeysyms.h>
30 
31 
32 #include <gtkmm/container.h>
33 #include <gtkmm/menu_elems.h>
34 #include <glibmm/helperlist.h>
35 
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 typedef struct _GtkMenuShell GtkMenuShell;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 
41 
42 namespace Gtk
43 { class MenuShell_Class; } // namespace Gtk
44 namespace Gtk
45 {
46 
47 class Menu;
48 class MenuShell;
49 class Window;
50 
51 namespace Menu_Helpers
52 {
53 
54 /*********************************************************************
55 ***** List properties
56 *********************************************************************/
57 
58 
59 class MenuList : public Glib::HelperList< MenuItem, const Element, Glib::List_Cpp_Iterator<GtkMenuItem,MenuItem> >
60 {
61 public:
64  MenuList(const MenuList& src);
65  virtual ~MenuList() {}
66 
67  MenuList& operator=(const MenuList& src);
68 
69  typedef Glib::HelperList< MenuItem, const Element, Glib::List_Cpp_Iterator<GtkMenuItem,MenuItem> > type_base;
70 
72  const GtkMenuShell* gparent() const;
73 
74  virtual GList*& glist() const; // front of list
75 
76  virtual void erase(iterator start, iterator stop);
77  virtual iterator erase(iterator); //Implented as custom or by LIST_CONTAINER_REMOVE
78  virtual void remove(const_reference); //Implented as custom or by LIST_CONTAINER_REMOVE
79 
81  reference operator[](size_type l) const;
82 
83 public:
84  iterator insert(iterator position, element_type& e); //custom-implemented.
85 
86  template <class InputIterator>
87  inline void insert(iterator position, InputIterator first, InputIterator last)
88  {
89  for(;first != last; ++first)
90  position = insert(position, *first);
91  }
92 
93  inline void push_front(element_type& e)
94  { insert(begin(), e); }
95  inline void push_back(element_type& e)
96  { insert(end(), e); }
97 
98 
99  virtual void remove(Widget& widget); //custom
100  };
101 
102 
103 } // namespace Menu_Helpers
104 
105 
116 class MenuShell : public Container
117 {
118  public:
119 #ifndef DOXYGEN_SHOULD_SKIP_THIS
120  typedef MenuShell CppObjectType;
121  typedef MenuShell_Class CppClassType;
122  typedef GtkMenuShell BaseObjectType;
123  typedef GtkMenuShellClass BaseClassType;
124 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
125 
126  virtual ~MenuShell();
127 
128 #ifndef DOXYGEN_SHOULD_SKIP_THIS
129 
130 private:
131  friend class MenuShell_Class;
132  static CppClassType menushell_class_;
133 
134  // noncopyable
135  MenuShell(const MenuShell&);
136  MenuShell& operator=(const MenuShell&);
137 
138 protected:
139  explicit MenuShell(const Glib::ConstructParams& construct_params);
140  explicit MenuShell(GtkMenuShell* castitem);
141 
142 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
143 
144 public:
145 #ifndef DOXYGEN_SHOULD_SKIP_THIS
146  static GType get_type() G_GNUC_CONST;
147 
148 
149  static GType get_base_type() G_GNUC_CONST;
150 #endif
151 
153  GtkMenuShell* gobj() { return reinterpret_cast<GtkMenuShell*>(gobject_); }
154 
156  const GtkMenuShell* gobj() const { return reinterpret_cast<GtkMenuShell*>(gobject_); }
157 
158 
159 public:
160  //C++ methods used to invoke GTK+ virtual functions:
161 
162 protected:
163  //GTK+ Virtual Functions (override these to change behaviour):
164 
165  //Default Signal Handlers::
167  virtual void on_deactivate();
169  virtual void on_selection_done();
170 
171 
172 private:
173 
174 
175 public:
176 
177 
180 
181 
182  void append(MenuItem& menu_item);
183 
184  void prepend(MenuItem& menu_item);
185 
186  void insert(MenuItem& menu_item, int position);
187 
188 
189  void select_item(MenuItem& menu_item);
190 
191  void deselect();
192 
193  //TODO: Is force_deactivate = false a good default?
194 
195  void activate_item(MenuItem& menu_item, bool force_deactivate = false);
196 
207  void select_first(bool search_sensitive = true);
208 
209  void deactivate();
210 
213  void cancel();
214 
215 
222  Glib::SignalProxy0< void > signal_deactivate();
223 
224 
231  Glib::SignalProxy0< void > signal_selection_done();
232 
233 
240  Glib::SignalProxy1< gboolean,int > signal_move_selected();
241 
242 
243  //Keybinding signals:
244 
245 
247  const MenuList& items() const;
248 
272  void accelerate(Window& window);
273 
284  void accelerate(Widget& parent);
285 
286 
291  bool get_take_focus() const;
292 
321  void set_take_focus(bool take_focus = true);
322 
328  Glib::PropertyProxy< bool > property_take_focus() ;
329 
335  Glib::PropertyProxy_ReadOnly< bool > property_take_focus() const;
336 
337 
338 protected:
340 
341 
342 private:
343 
344 
347 
348 
349 };
350 
351 } // namespace Gtk
352 
353 
354 namespace Glib
355 {
364  Gtk::MenuShell* wrap(GtkMenuShell* object, bool take_copy = false);
365 } //namespace Glib
366 
367 
368 #endif /* _GTKMM_MENUSHELL_H */
369 
Glib::SignalProxy0< void > signal_deactivate()
void append(MenuItem &menu_item)
Glib::SignalProxy1< gboolean, int > signal_move_selected()
Glib::PropertyProxy_ReadOnly< bool > property_take_focus() const
MenuList & items()
virtual void on_selection_done()
This is a default handler for the signal signal_selection_done().
Gtk::MenuShell * wrap(GtkMenuShell *object, bool take_copy=false)
void prepend(MenuItem &menu_item)
Glib::PropertyProxy< bool > property_take_focus()
void activate_item(MenuItem &menu_item, bool force_deactivate=false)
const MenuList & items() const
Gtk::Window * accel_window_
Definition: menushell.h:346
void select_first(bool search_sensitive=true)
Menu_Helpers::MenuList MenuList
Definition: menushell.h:178
void insert(MenuItem &menu_item, int position)
virtual ~MenuShell()
void accelerate(Widget &parent)
void accelerate(Window &window)
MenuList items_proxy_
Definition: menushell.h:345
GtkMenuShell * gobj()
Provides access to the underlying C GtkObject.
Definition: menushell.h:153
void set_take_focus(bool take_focus=true)
void select_item(MenuItem &menu_item)
bool get_take_focus() const
virtual void on_deactivate()
This is a default handler for the signal signal_deactivate().
const GtkMenuShell * gobj() const
Provides access to the underlying C GtkObject.
Definition: menushell.h:156
Glib::SignalProxy0< void > signal_selection_done()
iterator insert(iterator position, element_type &e)
Glib::HelperList< MenuItem, const Element, Glib::List_Cpp_Iterator< GtkMenuItem, MenuItem > > type_base
Definition: menushell.h:69
virtual iterator erase(iterator)
MenuList(const MenuList &src)
void insert(iterator position, InputIterator first, InputIterator last)
Definition: menushell.h:87
void push_front(element_type &e)
Definition: menushell.h:93
MenuList(GtkMenuShell *gparent)
virtual GList *& glist() const
MenuList & operator=(const MenuList &src)
void push_back(element_type &e)
Definition: menushell.h:95
virtual void remove(const_reference)
GtkMenuShell * gparent()
reference operator[](size_type l) const
This is order n. (use at own risk)
const GtkMenuShell * gparent() const
virtual void remove(Widget &widget)
virtual void erase(iterator start, iterator stop)
Definition: Window.h:41
PBD::PropertyDescriptor< timepos_t > start
Definition: ardour_ui.h:188