1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gtkmm/applicationwindow.h>
7 #include <gtkmm/private/applicationwindow_p.h>
8
9
10 /* Copyright 2012 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 Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 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 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser 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 <gtkmm/applicationwindow.h>
28 #include <gtkmm/shortcutswindow.h>
29
30 namespace Gtk
31 {
ApplicationWindow(const Glib::RefPtr<Application> & application)32 ApplicationWindow::ApplicationWindow(const Glib::RefPtr<Application>& application)
33 :
34 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
35 Glib::ObjectBase(nullptr),
36 Gtk::Window(Glib::ConstructParams(applicationwindow_class_.init()))
37 {
38 // Don't set the "application" property in ConstructParams. It would result in
39 // an attempt to set two C++ wrappers on the GApplicationWindow C object,
40 // if "application" is not a plain Gtk::Application, but derived from it.
41 // Like so:
42 // - Glib::Object::Object(const Glib::ConstructParams& construct_params) calls
43 // g_object_newv() to create a new GApplicationWindow.
44 // - In gtk+, gtk_application_add_window() is called. It emits the window_added
45 // signal with the new GApplicationWindow as a parameter.
46 // - Application_signal_window_added_callback() calls Glib::wrap(GWindow*)
47 // before *this has been set as the wrapper. Glib::wrap() then creates a
48 // wrapper (not *this).
49 // - Glib::Object::Object() calls Glib::ObjectBase::initialize(), which calls
50 // Glib::ObjectBase::_set_current_wrapper() to set *this as the C++ wrapper,
51 // but by then another wrapper has already been set.
52 // https://bugzilla.gnome.org/show_bug.cgi?id=758813
53
54 if (application)
55 application->add_window(*this);
56 }
57
unset_help_overlay()58 void ApplicationWindow::unset_help_overlay()
59 {
60 gtk_application_window_set_help_overlay(gobj(), nullptr);
61 }
62
63 #ifndef GTKMM_DISABLE_DEPRECATED
64
gobj_copy()65 GtkApplicationWindow* ApplicationWindow::gobj_copy()
66 {
67 reference();
68 return gobj();
69 }
70 #endif // GTKMM_DISABLE_DEPRECATED
71
72
73 } // namespace Gtk
74
75 #ifndef GTKMM_DISABLE_DEPRECATED
76
77 namespace Glib
78 {
79 //TODO: This wrap() function is broken. Remove it at the next ABI-break.
wrap(GtkApplicationWindow * object,bool take_copy)80 Glib::RefPtr<Gtk::ApplicationWindow> wrap(GtkApplicationWindow* object, bool take_copy)
81 {
82 g_warning("Glib::wrap(GtkApplicationWindow*, bool) is broken. See the reference documentation.\n");
83 return Glib::RefPtr<Gtk::ApplicationWindow>(dynamic_cast<Gtk::ApplicationWindow*>(Glib::wrap_auto((GObject*)(object), take_copy)));
84 //We use dynamic_cast<> in case of multiple inheritance.
85 }
86
87 } /* namespace Glib */
88 #endif // GTKMM_DISABLE_DEPRECATED
89
90
91 namespace
92 {
93 } // anonymous namespace
94
95
96 namespace Gtk
97 {
98
99
100 /* The *_Class implementation: */
101
init()102 const Glib::Class& ApplicationWindow_Class::init()
103 {
104 if(!gtype_) // create the GType if necessary
105 {
106 // Glib::Class has to know the class init function to clone custom types.
107 class_init_func_ = &ApplicationWindow_Class::class_init_function;
108
109 // This is actually just optimized away, apparently with no harm.
110 // Make sure that the parent type has been created.
111 //CppClassParent::CppObjectType::get_type();
112
113 // Create the wrapper type, with the same class/instance size as the base type.
114 register_derived_type(gtk_application_window_get_type());
115
116 // Add derived versions of interfaces, if the C type implements any interfaces:
117 Gio::ActionGroup::add_interface(get_type());
118 Gio::ActionMap::add_interface(get_type());
119
120 }
121
122 return *this;
123 }
124
125
class_init_function(void * g_class,void * class_data)126 void ApplicationWindow_Class::class_init_function(void* g_class, void* class_data)
127 {
128 const auto klass = static_cast<BaseClassType*>(g_class);
129 CppClassParent::class_init_function(klass, class_data);
130
131
132 }
133
134
wrap_new(GObject * o)135 Glib::ObjectBase* ApplicationWindow_Class::wrap_new(GObject* o)
136 {
137 return new ApplicationWindow((GtkApplicationWindow*)(o)); //top-level windows can not be manage()ed.
138
139 }
140
141
142 /* The implementation: */
143
ApplicationWindow(const Glib::ConstructParams & construct_params)144 ApplicationWindow::ApplicationWindow(const Glib::ConstructParams& construct_params)
145 :
146 Gtk::Window(construct_params)
147 {
148 }
149
ApplicationWindow(GtkApplicationWindow * castitem)150 ApplicationWindow::ApplicationWindow(GtkApplicationWindow* castitem)
151 :
152 Gtk::Window((GtkWindow*)(castitem))
153 {
154 }
155
156
ApplicationWindow(ApplicationWindow && src)157 ApplicationWindow::ApplicationWindow(ApplicationWindow&& src) noexcept
158 : Gtk::Window(std::move(src))
159 , Gio::ActionGroup(std::move(src))
160 , Gio::ActionMap(std::move(src))
161 {}
162
operator =(ApplicationWindow && src)163 ApplicationWindow& ApplicationWindow::operator=(ApplicationWindow&& src) noexcept
164 {
165 Gtk::Window::operator=(std::move(src));
166 Gio::ActionGroup::operator=(std::move(src));
167 Gio::ActionMap::operator=(std::move(src));
168 return *this;
169 }
170
~ApplicationWindow()171 ApplicationWindow::~ApplicationWindow() noexcept
172 {
173 destroy_();
174 }
175
176 ApplicationWindow::CppClassType ApplicationWindow::applicationwindow_class_; // initialize static member
177
get_type()178 GType ApplicationWindow::get_type()
179 {
180 return applicationwindow_class_.init().get_type();
181 }
182
183
get_base_type()184 GType ApplicationWindow::get_base_type()
185 {
186 return gtk_application_window_get_type();
187 }
188
189
ApplicationWindow()190 ApplicationWindow::ApplicationWindow()
191 :
192 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
193 Glib::ObjectBase(nullptr),
194 Gtk::Window(Glib::ConstructParams(applicationwindow_class_.init()))
195 {
196
197
198 }
199
set_show_menubar(bool show_menubar)200 void ApplicationWindow::set_show_menubar(bool show_menubar)
201 {
202 gtk_application_window_set_show_menubar(gobj(), static_cast<int>(show_menubar));
203 }
204
get_show_menubar() const205 bool ApplicationWindow::get_show_menubar() const
206 {
207 return gtk_application_window_get_show_menubar(const_cast<GtkApplicationWindow*>(gobj()));
208 }
209
get_id() const210 guint ApplicationWindow::get_id() const
211 {
212 return gtk_application_window_get_id(const_cast<GtkApplicationWindow*>(gobj()));
213 }
214
set_help_overlay(ShortcutsWindow & help_overlay)215 void ApplicationWindow::set_help_overlay(ShortcutsWindow& help_overlay)
216 {
217 gtk_application_window_set_help_overlay(gobj(), (help_overlay).gobj());
218 }
219
get_help_overlay()220 ShortcutsWindow* ApplicationWindow::get_help_overlay()
221 {
222 return Glib::wrap(gtk_application_window_get_help_overlay(gobj()));
223 }
224
get_help_overlay() const225 const ShortcutsWindow* ApplicationWindow::get_help_overlay() const
226 {
227 return const_cast<ApplicationWindow*>(this)->get_help_overlay();
228 }
229
230
property_show_menubar()231 Glib::PropertyProxy< bool > ApplicationWindow::property_show_menubar()
232 {
233 return Glib::PropertyProxy< bool >(this, "show-menubar");
234 }
235
property_show_menubar() const236 Glib::PropertyProxy_ReadOnly< bool > ApplicationWindow::property_show_menubar() const
237 {
238 return Glib::PropertyProxy_ReadOnly< bool >(this, "show-menubar");
239 }
240
241
242 } // namespace Gtk
243
244
245