Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / menubar.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/menubar.h>
4 #include <gtkmm/private/menubar_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* Copyright 1998-2002 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 <gtk/gtkmenubar.h>
27
28 namespace Gtk
29 {
30
31 MenuBar::MenuBar()
32 :
33   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
34   Gtk::MenuShell(Glib::ConstructParams(menubar_class_.init(), (char*) 0))
35 {
36   // Connect to the signal instead of overriding the on_hierarchy_changed()
37   // method because invocation of C++ default signal handlers is skipped
38   // for gtkmmproc-generated classes (a gtkmm-wide optimization).
39
40   signal_realize().connect(sigc::mem_fun(*this, &MenuBar::init_accels_handler_));
41 }
42
43 void MenuBar::init_accels_handler_()
44 {
45   if(gobj())
46   {
47     if(Window *const toplevel = dynamic_cast<Window*>(get_toplevel()))
48     {
49       accelerate(*toplevel);
50     }
51   }
52 }
53
54 } // namespace Gtk
55
56
57 namespace
58 {
59 } // anonymous namespace
60
61
62 namespace Glib
63 {
64
65 Gtk::MenuBar* wrap(GtkMenuBar* object, bool take_copy)
66 {
67   return dynamic_cast<Gtk::MenuBar *> (Glib::wrap_auto ((GObject*)(object), take_copy));
68 }
69
70 } /* namespace Glib */
71
72 namespace Gtk
73 {
74
75
76 /* The *_Class implementation: */
77
78 const Glib::Class& MenuBar_Class::init()
79 {
80   if(!gtype_) // create the GType if necessary
81   {
82     // Glib::Class has to know the class init function to clone custom types.
83     class_init_func_ = &MenuBar_Class::class_init_function;
84
85     // This is actually just optimized away, apparently with no harm.
86     // Make sure that the parent type has been created.
87     //CppClassParent::CppObjectType::get_type();
88
89     // Create the wrapper type, with the same class/instance size as the base type.
90     register_derived_type(gtk_menu_bar_get_type());
91
92     // Add derived versions of interfaces, if the C type implements any interfaces:
93   }
94
95   return *this;
96 }
97
98 void MenuBar_Class::class_init_function(void* g_class, void* class_data)
99 {
100   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
101   CppClassParent::class_init_function(klass, class_data);
102
103 }
104
105
106 Glib::ObjectBase* MenuBar_Class::wrap_new(GObject* o)
107 {
108   return manage(new MenuBar((GtkMenuBar*)(o)));
109
110 }
111
112
113 /* The implementation: */
114
115 MenuBar::MenuBar(const Glib::ConstructParams& construct_params)
116 :
117   Gtk::MenuShell(construct_params)
118 {
119   }
120
121 MenuBar::MenuBar(GtkMenuBar* castitem)
122 :
123   Gtk::MenuShell((GtkMenuShell*)(castitem))
124 {
125   }
126
127 MenuBar::~MenuBar()
128 {
129   destroy_();
130 }
131
132 MenuBar::CppClassType MenuBar::menubar_class_; // initialize static member
133
134 GType MenuBar::get_type()
135 {
136   return menubar_class_.init().get_type();
137 }
138
139 GType MenuBar::get_base_type()
140 {
141   return gtk_menu_bar_get_type();
142 }
143
144
145 } // namespace Gtk
146
147