1
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#include <gtkmm/frame.h>
4
#include <gtkmm/private/frame_p.h>
9
/* Copyright 1998-2002 The gtkmm Development Team
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.
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.
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.
26
#include <gtk/gtkframe.h>
31
void Frame::unset_label()
33
gtk_frame_set_label(gobj(), 0);
41
} // anonymous namespace
47
Gtk::Frame* wrap(GtkFrame* object, bool take_copy)
49
return dynamic_cast<Gtk::Frame *> (Glib::wrap_auto ((GObject*)(object), take_copy));
52
} /* namespace Glib */
58
/* The *_Class implementation: */
60
const Glib::Class& Frame_Class::init()
62
if(!gtype_) // create the GType if necessary
64
// Glib::Class has to know the class init function to clone custom types.
65
class_init_func_ = &Frame_Class::class_init_function;
67
// This is actually just optimized away, apparently with no harm.
68
// Make sure that the parent type has been created.
69
//CppClassParent::CppObjectType::get_type();
71
// Create the wrapper type, with the same class/instance size as the base type.
72
register_derived_type(gtk_frame_get_type());
74
// Add derived versions of interfaces, if the C type implements any interfaces:
80
void Frame_Class::class_init_function(void* g_class, void* class_data)
82
BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
83
CppClassParent::class_init_function(klass, class_data);
85
klass->compute_child_allocation = &compute_child_allocation_vfunc_callback;
88
void Frame_Class::compute_child_allocation_vfunc_callback(GtkFrame* self, GtkAllocation* allocation)
90
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
91
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
93
// Non-gtkmmproc-generated custom classes implicitly call the default
94
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
95
// generated classes can use this optimisation, which avoids the unnecessary
96
// parameter conversions if there is no possibility of the virtual function
98
if(obj && obj->is_derived_())
100
try // Trap C++ exceptions which would normally be lost because this is a C callback.
102
// Call the virtual member method, which derived classes might override.
103
obj->compute_child_allocation_vfunc((Allocation&)(Glib::wrap(allocation))
108
Glib::exception_handlers_invoke();
113
BaseClassType *const base = static_cast<BaseClassType*>(
114
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
117
// Call the original underlying C function:
118
if(base && base->compute_child_allocation)
119
(*base->compute_child_allocation)(self, allocation);
124
Glib::ObjectBase* Frame_Class::wrap_new(GObject* o)
126
return manage(new Frame((GtkFrame*)(o)));
131
/* The implementation: */
133
Frame::Frame(const Glib::ConstructParams& construct_params)
135
Gtk::Bin(construct_params)
139
Frame::Frame(GtkFrame* castitem)
141
Gtk::Bin((GtkBin*)(castitem))
150
Frame::CppClassType Frame::frame_class_; // initialize static member
152
GType Frame::get_type()
154
return frame_class_.init().get_type();
157
GType Frame::get_base_type()
159
return gtk_frame_get_type();
165
Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
166
Gtk::Bin(Glib::ConstructParams(frame_class_.init()))
170
Frame::Frame(const Glib::ustring& label)
172
Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
173
Gtk::Bin(Glib::ConstructParams(frame_class_.init(), "label", label.c_str(), (char*) 0))
177
void Frame::set_label(const Glib::ustring& label)
179
gtk_frame_set_label(gobj(), label.c_str());
182
Glib::ustring Frame::get_label() const
184
return Glib::convert_const_gchar_ptr_to_ustring(gtk_frame_get_label(const_cast<GtkFrame*>(gobj())));
187
void Frame::set_label_widget(Widget& label_widget)
189
gtk_frame_set_label_widget(gobj(), (label_widget).gobj());
192
Widget* Frame::get_label_widget()
194
return Glib::wrap(gtk_frame_get_label_widget(gobj()));
197
const Widget* Frame::get_label_widget() const
199
return Glib::wrap(gtk_frame_get_label_widget(const_cast<GtkFrame*>(gobj())));
202
void Frame::set_label_align(float xalign, float yalign)
204
gtk_frame_set_label_align(gobj(), xalign, yalign);
207
void Frame::set_label_align(AlignmentEnum xalign, AlignmentEnum yalign)
209
gtk_frame_set_label_align(gobj(), _gtkmm_align_float_from_enum(xalign), _gtkmm_align_float_from_enum(yalign));
212
void Frame::get_label_align(float& xalign, float& yalign) const
214
gtk_frame_get_label_align(const_cast<GtkFrame*>(gobj()), &(xalign), &(yalign));
217
void Frame::set_shadow_type(ShadowType type)
219
gtk_frame_set_shadow_type(gobj(), ((GtkShadowType)(type)));
222
ShadowType Frame::get_shadow_type() const
224
return ((ShadowType)(gtk_frame_get_shadow_type(const_cast<GtkFrame*>(gobj()))));
228
Glib::PropertyProxy<Glib::ustring> Frame::property_label()
230
return Glib::PropertyProxy<Glib::ustring>(this, "label");
233
Glib::PropertyProxy_ReadOnly<Glib::ustring> Frame::property_label() const
235
return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "label");
238
Glib::PropertyProxy<double> Frame::property_label_xalign()
240
return Glib::PropertyProxy<double>(this, "label-xalign");
243
Glib::PropertyProxy_ReadOnly<double> Frame::property_label_xalign() const
245
return Glib::PropertyProxy_ReadOnly<double>(this, "label-xalign");
248
Glib::PropertyProxy<double> Frame::property_label_yalign()
250
return Glib::PropertyProxy<double>(this, "label-yalign");
253
Glib::PropertyProxy_ReadOnly<double> Frame::property_label_yalign() const
255
return Glib::PropertyProxy_ReadOnly<double>(this, "label-yalign");
258
Glib::PropertyProxy<ShadowType> Frame::property_shadow_type()
260
return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
263
Glib::PropertyProxy_ReadOnly<ShadowType> Frame::property_shadow_type() const
265
return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
268
Glib::PropertyProxy<Widget*> Frame::property_label_widget()
270
return Glib::PropertyProxy<Widget*>(this, "label-widget");
273
Glib::PropertyProxy_ReadOnly<Widget*> Frame::property_label_widget() const
275
return Glib::PropertyProxy_ReadOnly<Widget*>(this, "label-widget");
279
void Gtk::Frame::compute_child_allocation_vfunc(Allocation& allocation)
281
BaseClassType *const base = static_cast<BaseClassType*>(
282
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
285
if(base && base->compute_child_allocation)
286
(*base->compute_child_allocation)(gobj(),(GtkAllocation*)(allocation.gobj()));