1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2
3 #undef GTK_DISABLE_DEPRECATED
4
5 #ifndef GTKMM_DISABLE_DEPRECATED
6
7
8 #include <glibmm.h>
9
10 #include <gtkmm/comboboxentry.h>
11 #include <gtkmm/private/comboboxentry_p.h>
12
13
14 // -*- c++ -*-
15 /* $Id: comboboxentry.ccg,v 1.2 2004/10/10 20:41:20 murrayc Exp $ */
16
17 /*
18 *
19 * Copyright 2003 The gtkmm Development Team
20 *
21 * This library is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU Lesser General Public
23 * License as published by the Free Software Foundation; either
24 * version 2.1 of the License, or (at your option) any later version.
25 *
26 * This library is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 * Lesser General Public License for more details.
30 *
31 * You should have received a copy of the GNU Lesser General Public
32 * License along with this library; if not, write to the Free
33 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34 */
35
36 #include <gtk/gtk.h>
37
38 namespace Gtk
39 {
40
41
get_entry()42 Entry* ComboBoxEntry::get_entry()
43 {
44 return Glib::wrap((GtkEntry*)(gtk_bin_get_child((GtkBin*)gobj())));
45 }
46
get_entry() const47 const Entry* ComboBoxEntry::get_entry() const
48 {
49 GtkBin* base = (GtkBin*)const_cast<GtkComboBoxEntry*>(gobj());
50 return Glib::wrap((GtkEntry*)(gtk_bin_get_child(base)));
51 }
52
get_active_text() const53 Glib::ustring ComboBoxEntry::get_active_text() const
54 {
55 //gtk_combo_box_get_active_text() can be used with text-comboboxes,
56 //or GtkComboBoxEntry, which is quite stupid. murrayc:
57 //See also: https://bugzilla.gnome.org/show_bug.cgi?id=612396#c44
58 return Glib::convert_return_gchar_ptr_to_ustring (gtk_combo_box_get_active_text(GTK_COMBO_BOX(gobj())));
59 }
60
61
62 } // namespace Gtk
63
64
65 namespace
66 {
67 } // anonymous namespace
68
69
70 namespace Glib
71 {
72
wrap(GtkComboBoxEntry * object,bool take_copy)73 Gtk::ComboBoxEntry* wrap(GtkComboBoxEntry* object, bool take_copy)
74 {
75 return dynamic_cast<Gtk::ComboBoxEntry *> (Glib::wrap_auto ((GObject*)(object), take_copy));
76 }
77
78 } /* namespace Glib */
79
80 namespace Gtk
81 {
82
83
84 /* The *_Class implementation: */
85
init()86 const Glib::Class& ComboBoxEntry_Class::init()
87 {
88 if(!gtype_) // create the GType if necessary
89 {
90 // Glib::Class has to know the class init function to clone custom types.
91 class_init_func_ = &ComboBoxEntry_Class::class_init_function;
92
93 // This is actually just optimized away, apparently with no harm.
94 // Make sure that the parent type has been created.
95 //CppClassParent::CppObjectType::get_type();
96
97 // Create the wrapper type, with the same class/instance size as the base type.
98 register_derived_type(gtk_combo_box_entry_get_type());
99
100 // Add derived versions of interfaces, if the C type implements any interfaces:
101
102 }
103
104 return *this;
105 }
106
107
class_init_function(void * g_class,void * class_data)108 void ComboBoxEntry_Class::class_init_function(void* g_class, void* class_data)
109 {
110 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
111 CppClassParent::class_init_function(klass, class_data);
112
113
114 }
115
116
wrap_new(GObject * o)117 Glib::ObjectBase* ComboBoxEntry_Class::wrap_new(GObject* o)
118 {
119 return manage(new ComboBoxEntry((GtkComboBoxEntry*)(o)));
120
121 }
122
123
124 /* The implementation: */
125
ComboBoxEntry(const Glib::ConstructParams & construct_params)126 ComboBoxEntry::ComboBoxEntry(const Glib::ConstructParams& construct_params)
127 :
128 Gtk::ComboBox(construct_params)
129 {
130 }
131
ComboBoxEntry(GtkComboBoxEntry * castitem)132 ComboBoxEntry::ComboBoxEntry(GtkComboBoxEntry* castitem)
133 :
134 Gtk::ComboBox((GtkComboBox*)(castitem))
135 {
136 }
137
~ComboBoxEntry()138 ComboBoxEntry::~ComboBoxEntry()
139 {
140 destroy_();
141 }
142
143 ComboBoxEntry::CppClassType ComboBoxEntry::comboboxentry_class_; // initialize static member
144
get_type()145 GType ComboBoxEntry::get_type()
146 {
147 return comboboxentry_class_.init().get_type();
148 }
149
150
get_base_type()151 GType ComboBoxEntry::get_base_type()
152 {
153 return gtk_combo_box_entry_get_type();
154 }
155
156
ComboBoxEntry()157 ComboBoxEntry::ComboBoxEntry()
158 :
159 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
160 Glib::ObjectBase(0),
161 Gtk::ComboBox(Glib::ConstructParams(comboboxentry_class_.init()))
162 {
163
164
165 }
166
ComboBoxEntry(const Glib::RefPtr<TreeModel> & model,const TreeModelColumnBase & text_column)167 ComboBoxEntry::ComboBoxEntry(const Glib::RefPtr<TreeModel>& model, const TreeModelColumnBase& text_column)
168 :
169 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
170 Glib::ObjectBase(0),
171 Gtk::ComboBox(Glib::ConstructParams(comboboxentry_class_.init(), "model", Glib::unwrap(model), "text_column", (text_column).index(), static_cast<char*>(0)))
172 {
173
174
175 }
176
ComboBoxEntry(const Glib::RefPtr<TreeModel> & model,int text_column)177 ComboBoxEntry::ComboBoxEntry(const Glib::RefPtr<TreeModel>& model, int text_column)
178 :
179 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
180 Glib::ObjectBase(0),
181 Gtk::ComboBox(Glib::ConstructParams(comboboxentry_class_.init(), "model", Glib::unwrap(model), "text_column", text_column, static_cast<char*>(0)))
182 {
183
184
185 }
186
set_text_column(const TreeModelColumnBase & text_column) const187 void ComboBoxEntry::set_text_column(const TreeModelColumnBase& text_column) const
188 {
189 gtk_combo_box_entry_set_text_column(const_cast<GtkComboBoxEntry*>(gobj()), (text_column).index());
190 }
191
set_text_column(int text_column) const192 void ComboBoxEntry::set_text_column(int text_column) const
193 {
194 gtk_combo_box_entry_set_text_column(const_cast<GtkComboBoxEntry*>(gobj()), text_column);
195 }
196
get_text_column() const197 int ComboBoxEntry::get_text_column() const
198 {
199 return gtk_combo_box_entry_get_text_column(const_cast<GtkComboBoxEntry*>(gobj()));
200 }
201
202
property_text_column()203 Glib::PropertyProxy< int > ComboBoxEntry::property_text_column()
204 {
205 return Glib::PropertyProxy< int >(this, "text-column");
206 }
207
property_text_column() const208 Glib::PropertyProxy_ReadOnly< int > ComboBoxEntry::property_text_column() const
209 {
210 return Glib::PropertyProxy_ReadOnly< int >(this, "text-column");
211 }
212
213
214 } // namespace Gtk
215
216 #endif // GTKMM_DISABLE_DEPRECATED
217
218
219