1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <gtkmm/frame.h>
7 #include <gtkmm/private/frame_p.h>
8 
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 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 Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
25  */
26 
27 #include <gtk/gtk.h>
28 
29 namespace Gtk
30 {
31 
unset_label()32 void Frame::unset_label()
33 {
34   gtk_frame_set_label(gobj(), nullptr);
35 }
36 
37 } // namespace Gtk
38 
39 
40 namespace
41 {
42 } // anonymous namespace
43 
44 
45 namespace Glib
46 {
47 
wrap(GtkFrame * object,bool take_copy)48 Gtk::Frame* wrap(GtkFrame* object, bool take_copy)
49 {
50   return dynamic_cast<Gtk::Frame *> (Glib::wrap_auto ((GObject*)(object), take_copy));
51 }
52 
53 } /* namespace Glib */
54 
55 namespace Gtk
56 {
57 
58 
59 /* The *_Class implementation: */
60 
init()61 const Glib::Class& Frame_Class::init()
62 {
63   if(!gtype_) // create the GType if necessary
64   {
65     // Glib::Class has to know the class init function to clone custom types.
66     class_init_func_ = &Frame_Class::class_init_function;
67 
68     // This is actually just optimized away, apparently with no harm.
69     // Make sure that the parent type has been created.
70     //CppClassParent::CppObjectType::get_type();
71 
72     // Create the wrapper type, with the same class/instance size as the base type.
73     register_derived_type(gtk_frame_get_type());
74 
75     // Add derived versions of interfaces, if the C type implements any interfaces:
76 
77   }
78 
79   return *this;
80 }
81 
82 
class_init_function(void * g_class,void * class_data)83 void Frame_Class::class_init_function(void* g_class, void* class_data)
84 {
85   const auto klass = static_cast<BaseClassType*>(g_class);
86   CppClassParent::class_init_function(klass, class_data);
87 
88   klass->compute_child_allocation = &compute_child_allocation_vfunc_callback;
89 
90 }
91 
compute_child_allocation_vfunc_callback(GtkFrame * self,GtkAllocation * allocation)92 void Frame_Class::compute_child_allocation_vfunc_callback(GtkFrame* self, GtkAllocation* allocation)
93 {
94   const auto obj_base = static_cast<Glib::ObjectBase*>(
95       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
96 
97   // Non-gtkmmproc-generated custom classes implicitly call the default
98   // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
99   // generated classes can use this optimisation, which avoids the unnecessary
100   // parameter conversions if there is no possibility of the virtual function
101   // being overridden:
102   if(obj_base && obj_base->is_derived_())
103   {
104     const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
105     if(obj) // This can be NULL during destruction.
106     {
107       try // Trap C++ exceptions which would normally be lost because this is a C callback.
108       {
109         // Call the virtual member method, which derived classes might override.
110         obj->compute_child_allocation_vfunc((Allocation&)(Glib::wrap(allocation))
111 );
112         return;
113       }
114       catch(...)
115       {
116         Glib::exception_handlers_invoke();
117       }
118     }
119   }
120 
121   BaseClassType *const base = static_cast<BaseClassType*>(
122       g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
123   );
124 
125   // Call the original underlying C function:
126   if(base && base->compute_child_allocation)
127     (*base->compute_child_allocation)(self, allocation);
128 }
129 
130 
wrap_new(GObject * o)131 Glib::ObjectBase* Frame_Class::wrap_new(GObject* o)
132 {
133   return manage(new Frame((GtkFrame*)(o)));
134 
135 }
136 
137 
138 /* The implementation: */
139 
Frame(const Glib::ConstructParams & construct_params)140 Frame::Frame(const Glib::ConstructParams& construct_params)
141 :
142   Gtk::Bin(construct_params)
143 {
144   }
145 
Frame(GtkFrame * castitem)146 Frame::Frame(GtkFrame* castitem)
147 :
148   Gtk::Bin((GtkBin*)(castitem))
149 {
150   }
151 
152 
Frame(Frame && src)153 Frame::Frame(Frame&& src) noexcept
154 : Gtk::Bin(std::move(src))
155 {}
156 
operator =(Frame && src)157 Frame& Frame::operator=(Frame&& src) noexcept
158 {
159   Gtk::Bin::operator=(std::move(src));
160   return *this;
161 }
162 
~Frame()163 Frame::~Frame() noexcept
164 {
165   destroy_();
166 }
167 
168 Frame::CppClassType Frame::frame_class_; // initialize static member
169 
get_type()170 GType Frame::get_type()
171 {
172   return frame_class_.init().get_type();
173 }
174 
175 
get_base_type()176 GType Frame::get_base_type()
177 {
178   return gtk_frame_get_type();
179 }
180 
181 
Frame()182 Frame::Frame()
183 :
184   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
185   Glib::ObjectBase(nullptr),
186   Gtk::Bin(Glib::ConstructParams(frame_class_.init()))
187 {
188 
189 
190 }
191 
Frame(const Glib::ustring & label)192 Frame::Frame(const Glib::ustring& label)
193 :
194   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
195   Glib::ObjectBase(nullptr),
196   Gtk::Bin(Glib::ConstructParams(frame_class_.init(), "label", label.c_str(), nullptr))
197 {
198 
199 
200 }
201 
set_label(const Glib::ustring & label)202 void Frame::set_label(const Glib::ustring& label)
203 {
204   gtk_frame_set_label(gobj(), label.c_str());
205 }
206 
get_label() const207 Glib::ustring Frame::get_label() const
208 {
209   return Glib::convert_const_gchar_ptr_to_ustring(gtk_frame_get_label(const_cast<GtkFrame*>(gobj())));
210 }
211 
set_label_widget(Widget & label_widget)212 void Frame::set_label_widget(Widget& label_widget)
213 {
214   gtk_frame_set_label_widget(gobj(), (label_widget).gobj());
215 }
216 
get_label_widget()217 Widget* Frame::get_label_widget()
218 {
219   return Glib::wrap(gtk_frame_get_label_widget(gobj()));
220 }
221 
get_label_widget() const222 const Widget* Frame::get_label_widget() const
223 {
224   return const_cast<Frame*>(this)->get_label_widget();
225 }
226 
set_label_align(float xalign,float yalign)227 void Frame::set_label_align(float xalign, float yalign)
228 {
229   gtk_frame_set_label_align(gobj(), xalign, yalign);
230 }
231 
set_label_align(Align xalign,Align yalign)232 void Frame::set_label_align(Align xalign, Align yalign)
233 {
234   gtk_frame_set_label_align(gobj(), _gtkmm_align_float_from_enum(xalign), _gtkmm_align_float_from_enum(yalign));
235 }
236 
get_label_align(float & xalign,float & yalign) const237 void Frame::get_label_align(float& xalign, float& yalign) const
238 {
239   gtk_frame_get_label_align(const_cast<GtkFrame*>(gobj()), &(xalign), &(yalign));
240 }
241 
set_shadow_type(ShadowType type)242 void Frame::set_shadow_type(ShadowType type)
243 {
244   gtk_frame_set_shadow_type(gobj(), ((GtkShadowType)(type)));
245 }
246 
get_shadow_type() const247 ShadowType Frame::get_shadow_type() const
248 {
249   return ((ShadowType)(gtk_frame_get_shadow_type(const_cast<GtkFrame*>(gobj()))));
250 }
251 
252 
property_label()253 Glib::PropertyProxy< Glib::ustring > Frame::property_label()
254 {
255   return Glib::PropertyProxy< Glib::ustring >(this, "label");
256 }
257 
property_label() const258 Glib::PropertyProxy_ReadOnly< Glib::ustring > Frame::property_label() const
259 {
260   return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "label");
261 }
262 
property_label_xalign()263 Glib::PropertyProxy< double > Frame::property_label_xalign()
264 {
265   return Glib::PropertyProxy< double >(this, "label-xalign");
266 }
267 
property_label_xalign() const268 Glib::PropertyProxy_ReadOnly< double > Frame::property_label_xalign() const
269 {
270   return Glib::PropertyProxy_ReadOnly< double >(this, "label-xalign");
271 }
272 
property_label_yalign()273 Glib::PropertyProxy< double > Frame::property_label_yalign()
274 {
275   return Glib::PropertyProxy< double >(this, "label-yalign");
276 }
277 
property_label_yalign() const278 Glib::PropertyProxy_ReadOnly< double > Frame::property_label_yalign() const
279 {
280   return Glib::PropertyProxy_ReadOnly< double >(this, "label-yalign");
281 }
282 
property_shadow_type()283 Glib::PropertyProxy< ShadowType > Frame::property_shadow_type()
284 {
285   return Glib::PropertyProxy< ShadowType >(this, "shadow-type");
286 }
287 
property_shadow_type() const288 Glib::PropertyProxy_ReadOnly< ShadowType > Frame::property_shadow_type() const
289 {
290   return Glib::PropertyProxy_ReadOnly< ShadowType >(this, "shadow-type");
291 }
292 
property_label_widget()293 Glib::PropertyProxy< Widget* > Frame::property_label_widget()
294 {
295   return Glib::PropertyProxy< Widget* >(this, "label-widget");
296 }
297 
property_label_widget() const298 Glib::PropertyProxy_ReadOnly< Widget* > Frame::property_label_widget() const
299 {
300   return Glib::PropertyProxy_ReadOnly< Widget* >(this, "label-widget");
301 }
302 
303 
compute_child_allocation_vfunc(Allocation & allocation)304 void Gtk::Frame::compute_child_allocation_vfunc(Allocation& allocation)
305 {
306   const auto base = static_cast<BaseClassType*>(
307       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
308   );
309 
310   if(base && base->compute_child_allocation)
311   {
312     (*base->compute_child_allocation)(gobj(),(GtkAllocation*)(allocation.gobj()));
313   }
314 }
315 
316 
317 } // namespace Gtk
318 
319 
320