Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / menubar.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/menubar.h>
5 #include <gtkmm/private/menubar_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* Copyright 1998-2002 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 Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 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  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <gtk/gtkmenubar.h>
28
29 namespace Gtk
30 {
31
32 MenuBar::MenuBar()
33 :
34   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
35   Glib::ObjectBase(0),
36   Gtk::MenuShell(Glib::ConstructParams(menubar_class_.init()))
37 {
38   // Connect to the signal instead of overriding the on_hierarchy_changed()
39   // method because invocation of C++ default signal handlers is skipped
40   // for gtkmmproc-generated classes (a gtkmm-wide optimization).
41
42   signal_realize().connect(sigc::mem_fun(*this, &MenuBar::init_accels_handler_));
43 }
44
45 void MenuBar::init_accels_handler_()
46 {
47   if(gobj())
48   {
49     if(Window *const toplevel = dynamic_cast<Window*>(get_toplevel()))
50     {
51       accelerate(*toplevel);
52     }
53   }
54 }
55
56 } // namespace Gtk
57
58
59 namespace
60 {
61 } // anonymous namespace
62
63
64 namespace Glib
65 {
66
67 Gtk::MenuBar* wrap(GtkMenuBar* object, bool take_copy)
68 {
69   return dynamic_cast<Gtk::MenuBar *> (Glib::wrap_auto ((GObject*)(object), take_copy));
70 }
71
72 } /* namespace Glib */
73
74 namespace Gtk
75 {
76
77
78 /* The *_Class implementation: */
79
80 const Glib::Class& MenuBar_Class::init()
81 {
82   if(!gtype_) // create the GType if necessary
83   {
84     // Glib::Class has to know the class init function to clone custom types.
85     class_init_func_ = &MenuBar_Class::class_init_function;
86
87     // This is actually just optimized away, apparently with no harm.
88     // Make sure that the parent type has been created.
89     //CppClassParent::CppObjectType::get_type();
90
91     // Create the wrapper type, with the same class/instance size as the base type.
92     register_derived_type(gtk_menu_bar_get_type());
93
94     // Add derived versions of interfaces, if the C type implements any interfaces:
95   }
96
97   return *this;
98 }
99
100 void MenuBar_Class::class_init_function(void* g_class, void* class_data)
101 {
102   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
103   CppClassParent::class_init_function(klass, class_data);
104
105 #ifdef GLIBMM_VFUNCS_ENABLED
106 #endif //GLIBMM_VFUNCS_ENABLED
107
108 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
109 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
110 }
111
112 #ifdef GLIBMM_VFUNCS_ENABLED
113 #endif //GLIBMM_VFUNCS_ENABLED
114
115 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
116 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
117
118
119 Glib::ObjectBase* MenuBar_Class::wrap_new(GObject* o)
120 {
121   return manage(new MenuBar((GtkMenuBar*)(o)));
122
123 }
124
125
126 /* The implementation: */
127
128 MenuBar::MenuBar(const Glib::ConstructParams& construct_params)
129 :
130   Gtk::MenuShell(construct_params)
131 {
132   }
133
134 MenuBar::MenuBar(GtkMenuBar* castitem)
135 :
136   Gtk::MenuShell((GtkMenuShell*)(castitem))
137 {
138   }
139
140 MenuBar::~MenuBar()
141 {
142   destroy_();
143 }
144
145 MenuBar::CppClassType MenuBar::menubar_class_; // initialize static member
146
147 GType MenuBar::get_type()
148 {
149   return menubar_class_.init().get_type();
150 }
151
152 GType MenuBar::get_base_type()
153 {
154   return gtk_menu_bar_get_type();
155 }
156
157
158 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
159 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
160
161 #ifdef GLIBMM_VFUNCS_ENABLED
162 #endif //GLIBMM_VFUNCS_ENABLED
163
164
165 } // namespace Gtk
166
167