~ubuntu-branches/ubuntu/vivid/ardour/vivid-proposed

« back to all changes in this revision

Viewing changes to libs/gtkmm2/gtk/gtkmm/frame.cc

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler, Jaromír Mikeš, Felipe Sateler
  • Date: 2014-05-22 14:39:25 UTC
  • mfrom: (29 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: package-import@ubuntu.com-20140522143925-vwqfo9287pmkrroe
Tags: 1:2.8.16+git20131003-3
* Team upload

[ Jaromír Mikeš ]
* Add -dbg package

[ Felipe Sateler ]
* Upload to experimental

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Generated by gtkmmproc -- DO NOT MODIFY!
 
2
 
 
3
#include <gtkmm/frame.h>
 
4
#include <gtkmm/private/frame_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/gtkframe.h>
 
27
 
 
28
namespace Gtk
 
29
{
 
30
 
 
31
void Frame::unset_label()
 
32
{
 
33
  gtk_frame_set_label(gobj(), 0);
 
34
}
 
35
 
 
36
} // namespace Gtk
 
37
 
 
38
 
 
39
namespace
 
40
{
 
41
} // anonymous namespace
 
42
 
 
43
 
 
44
namespace Glib
 
45
{
 
46
 
 
47
Gtk::Frame* wrap(GtkFrame* object, bool take_copy)
 
48
{
 
49
  return dynamic_cast<Gtk::Frame *> (Glib::wrap_auto ((GObject*)(object), take_copy));
 
50
}
 
51
 
 
52
} /* namespace Glib */
 
53
 
 
54
namespace Gtk
 
55
{
 
56
 
 
57
 
 
58
/* The *_Class implementation: */
 
59
 
 
60
const Glib::Class& Frame_Class::init()
 
61
{
 
62
  if(!gtype_) // create the GType if necessary
 
63
  {
 
64
    // Glib::Class has to know the class init function to clone custom types.
 
65
    class_init_func_ = &Frame_Class::class_init_function;
 
66
 
 
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();
 
70
 
 
71
    // Create the wrapper type, with the same class/instance size as the base type.
 
72
    register_derived_type(gtk_frame_get_type());
 
73
 
 
74
    // Add derived versions of interfaces, if the C type implements any interfaces:
 
75
  }
 
76
 
 
77
  return *this;
 
78
}
 
79
 
 
80
void Frame_Class::class_init_function(void* g_class, void* class_data)
 
81
{
 
82
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
 
83
  CppClassParent::class_init_function(klass, class_data);
 
84
 
 
85
  klass->compute_child_allocation = &compute_child_allocation_vfunc_callback;
 
86
}
 
87
 
 
88
void Frame_Class::compute_child_allocation_vfunc_callback(GtkFrame* self, GtkAllocation* allocation)
 
89
{
 
90
  CppObjectType *const obj = dynamic_cast<CppObjectType*>(
 
91
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
92
 
 
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
 
97
  // being overridden:
 
98
  if(obj && obj->is_derived_())
 
99
  {
 
100
    try // Trap C++ exceptions which would normally be lost because this is a C callback.
 
101
    {
 
102
      // Call the virtual member method, which derived classes might override.
 
103
      obj->compute_child_allocation_vfunc((Allocation&)(Glib::wrap(allocation))
 
104
);
 
105
    }
 
106
    catch(...)
 
107
    {
 
108
      Glib::exception_handlers_invoke();
 
109
    }
 
110
  }
 
111
  else
 
112
  {
 
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).
 
115
    );
 
116
 
 
117
    // Call the original underlying C function:
 
118
    if(base && base->compute_child_allocation)
 
119
      (*base->compute_child_allocation)(self, allocation);
 
120
  }
 
121
}
 
122
 
 
123
 
 
124
Glib::ObjectBase* Frame_Class::wrap_new(GObject* o)
 
125
{
 
126
  return manage(new Frame((GtkFrame*)(o)));
 
127
 
 
128
}
 
129
 
 
130
 
 
131
/* The implementation: */
 
132
 
 
133
Frame::Frame(const Glib::ConstructParams& construct_params)
 
134
:
 
135
  Gtk::Bin(construct_params)
 
136
{
 
137
  }
 
138
 
 
139
Frame::Frame(GtkFrame* castitem)
 
140
:
 
141
  Gtk::Bin((GtkBin*)(castitem))
 
142
{
 
143
  }
 
144
 
 
145
Frame::~Frame()
 
146
{
 
147
  destroy_();
 
148
}
 
149
 
 
150
Frame::CppClassType Frame::frame_class_; // initialize static member
 
151
 
 
152
GType Frame::get_type()
 
153
{
 
154
  return frame_class_.init().get_type();
 
155
}
 
156
 
 
157
GType Frame::get_base_type()
 
158
{
 
159
  return gtk_frame_get_type();
 
160
}
 
161
 
 
162
 
 
163
Frame::Frame()
 
164
:
 
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()))
 
167
{
 
168
  }
 
169
 
 
170
Frame::Frame(const Glib::ustring& label)
 
171
:
 
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))
 
174
{
 
175
  }
 
176
 
 
177
void Frame::set_label(const Glib::ustring& label)
 
178
{
 
179
  gtk_frame_set_label(gobj(), label.c_str());
 
180
}
 
181
 
 
182
Glib::ustring Frame::get_label() const
 
183
{
 
184
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_frame_get_label(const_cast<GtkFrame*>(gobj())));
 
185
}
 
186
 
 
187
void Frame::set_label_widget(Widget& label_widget)
 
188
{
 
189
  gtk_frame_set_label_widget(gobj(), (label_widget).gobj());
 
190
}
 
191
 
 
192
Widget* Frame::get_label_widget()
 
193
{
 
194
  return Glib::wrap(gtk_frame_get_label_widget(gobj()));
 
195
}
 
196
 
 
197
const Widget* Frame::get_label_widget() const
 
198
{
 
199
  return Glib::wrap(gtk_frame_get_label_widget(const_cast<GtkFrame*>(gobj())));
 
200
}
 
201
 
 
202
void Frame::set_label_align(float xalign, float yalign)
 
203
{
 
204
  gtk_frame_set_label_align(gobj(), xalign, yalign);
 
205
}
 
206
 
 
207
void Frame::set_label_align(AlignmentEnum xalign, AlignmentEnum yalign)
 
208
{
 
209
  gtk_frame_set_label_align(gobj(), _gtkmm_align_float_from_enum(xalign), _gtkmm_align_float_from_enum(yalign));
 
210
}
 
211
 
 
212
void Frame::get_label_align(float& xalign, float& yalign) const
 
213
{
 
214
  gtk_frame_get_label_align(const_cast<GtkFrame*>(gobj()), &(xalign), &(yalign));
 
215
}
 
216
 
 
217
void Frame::set_shadow_type(ShadowType type)
 
218
{
 
219
  gtk_frame_set_shadow_type(gobj(), ((GtkShadowType)(type)));
 
220
}
 
221
 
 
222
ShadowType Frame::get_shadow_type() const
 
223
{
 
224
  return ((ShadowType)(gtk_frame_get_shadow_type(const_cast<GtkFrame*>(gobj()))));
 
225
}
 
226
 
 
227
 
 
228
Glib::PropertyProxy<Glib::ustring> Frame::property_label() 
 
229
{
 
230
  return Glib::PropertyProxy<Glib::ustring>(this, "label");
 
231
}
 
232
 
 
233
Glib::PropertyProxy_ReadOnly<Glib::ustring> Frame::property_label() const
 
234
{
 
235
  return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "label");
 
236
}
 
237
 
 
238
Glib::PropertyProxy<double> Frame::property_label_xalign() 
 
239
{
 
240
  return Glib::PropertyProxy<double>(this, "label-xalign");
 
241
}
 
242
 
 
243
Glib::PropertyProxy_ReadOnly<double> Frame::property_label_xalign() const
 
244
{
 
245
  return Glib::PropertyProxy_ReadOnly<double>(this, "label-xalign");
 
246
}
 
247
 
 
248
Glib::PropertyProxy<double> Frame::property_label_yalign() 
 
249
{
 
250
  return Glib::PropertyProxy<double>(this, "label-yalign");
 
251
}
 
252
 
 
253
Glib::PropertyProxy_ReadOnly<double> Frame::property_label_yalign() const
 
254
{
 
255
  return Glib::PropertyProxy_ReadOnly<double>(this, "label-yalign");
 
256
}
 
257
 
 
258
Glib::PropertyProxy<ShadowType> Frame::property_shadow_type() 
 
259
{
 
260
  return Glib::PropertyProxy<ShadowType>(this, "shadow-type");
 
261
}
 
262
 
 
263
Glib::PropertyProxy_ReadOnly<ShadowType> Frame::property_shadow_type() const
 
264
{
 
265
  return Glib::PropertyProxy_ReadOnly<ShadowType>(this, "shadow-type");
 
266
}
 
267
 
 
268
Glib::PropertyProxy<Widget*> Frame::property_label_widget() 
 
269
{
 
270
  return Glib::PropertyProxy<Widget*>(this, "label-widget");
 
271
}
 
272
 
 
273
Glib::PropertyProxy_ReadOnly<Widget*> Frame::property_label_widget() const
 
274
{
 
275
  return Glib::PropertyProxy_ReadOnly<Widget*>(this, "label-widget");
 
276
}
 
277
 
 
278
 
 
279
void Gtk::Frame::compute_child_allocation_vfunc(Allocation& allocation) 
 
280
{
 
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).
 
283
  );
 
284
 
 
285
  if(base && base->compute_child_allocation)
 
286
    (*base->compute_child_allocation)(gobj(),(GtkAllocation*)(allocation.gobj()));
 
287
}
 
288
 
 
289
 
 
290
} // namespace Gtk
 
291
 
 
292