1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gtkmm/filechooserbutton.h>
7 #include <gtkmm/private/filechooserbutton_p.h>
8
9
10 /*
11 * Copyright 2003 The gtkmm Development Team
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27
28 #include <gtk/gtk.h>
29
30 namespace Gtk
31 {
32
FileChooserButton(FileChooserAction action)33 FileChooserButton::FileChooserButton(FileChooserAction action)
34 :
35 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
36 Glib::ObjectBase(nullptr),
37 Gtk::HBox(Glib::ConstructParams(filechooserbutton_class_.init(), "action",action, nullptr))
38 {
39 }
40
41 // GtkFileChooserButton:focus-on-click has been removed from gtk+.
42 // TODO: At ABI-break, remove it from gtkmm.
43 #ifndef GTKMM_DISABLE_DEPRECATED
property_focus_on_click()44 Glib::PropertyProxy< bool > FileChooserButton::property_focus_on_click()
45 {
46 return Glib::PropertyProxy< bool >(this, "focus-on-click");
47 }
48
property_focus_on_click() const49 Glib::PropertyProxy_ReadOnly< bool > FileChooserButton::property_focus_on_click() const
50 {
51 return Glib::PropertyProxy_ReadOnly< bool >(this, "focus-on-click");
52 }
53 #endif // GTKMM_DISABLE_DEPRECATED
54
55 } // namespace Gtk
56
57
58 namespace
59 {
60
61
62 static const Glib::SignalProxyInfo FileChooserButton_signal_file_set_info =
63 {
64 "file-set",
65 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
66 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
67 };
68
69
70 } // anonymous namespace
71
72
73 namespace Glib
74 {
75
wrap(GtkFileChooserButton * object,bool take_copy)76 Gtk::FileChooserButton* wrap(GtkFileChooserButton* object, bool take_copy)
77 {
78 return dynamic_cast<Gtk::FileChooserButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
79 }
80
81 } /* namespace Glib */
82
83 namespace Gtk
84 {
85
86
87 /* The *_Class implementation: */
88
init()89 const Glib::Class& FileChooserButton_Class::init()
90 {
91 if(!gtype_) // create the GType if necessary
92 {
93 // Glib::Class has to know the class init function to clone custom types.
94 class_init_func_ = &FileChooserButton_Class::class_init_function;
95
96 // This is actually just optimized away, apparently with no harm.
97 // Make sure that the parent type has been created.
98 //CppClassParent::CppObjectType::get_type();
99
100 // Create the wrapper type, with the same class/instance size as the base type.
101 register_derived_type(gtk_file_chooser_button_get_type());
102
103 // Add derived versions of interfaces, if the C type implements any interfaces:
104 FileChooser::add_interface(get_type());
105
106 }
107
108 return *this;
109 }
110
111
class_init_function(void * g_class,void * class_data)112 void FileChooserButton_Class::class_init_function(void* g_class, void* class_data)
113 {
114 const auto klass = static_cast<BaseClassType*>(g_class);
115 CppClassParent::class_init_function(klass, class_data);
116
117
118 klass->file_set = &file_set_callback;
119 }
120
121
file_set_callback(GtkFileChooserButton * self)122 void FileChooserButton_Class::file_set_callback(GtkFileChooserButton* self)
123 {
124 const auto obj_base = static_cast<Glib::ObjectBase*>(
125 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
126
127 // Non-gtkmmproc-generated custom classes implicitly call the default
128 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
129 // generated classes can use this optimisation, which avoids the unnecessary
130 // parameter conversions if there is no possibility of the virtual function
131 // being overridden:
132 if(obj_base && obj_base->is_derived_())
133 {
134 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
135 if(obj) // This can be NULL during destruction.
136 {
137 try // Trap C++ exceptions which would normally be lost because this is a C callback.
138 {
139 // Call the virtual member method, which derived classes might override.
140 obj->on_file_set();
141 return;
142 }
143 catch(...)
144 {
145 Glib::exception_handlers_invoke();
146 }
147 }
148 }
149
150 const auto base = static_cast<BaseClassType*>(
151 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
152 );
153
154 // Call the original underlying C function:
155 if(base && base->file_set)
156 (*base->file_set)(self);
157 }
158
159
wrap_new(GObject * o)160 Glib::ObjectBase* FileChooserButton_Class::wrap_new(GObject* o)
161 {
162 return manage(new FileChooserButton((GtkFileChooserButton*)(o)));
163
164 }
165
166
167 /* The implementation: */
168
FileChooserButton(const Glib::ConstructParams & construct_params)169 FileChooserButton::FileChooserButton(const Glib::ConstructParams& construct_params)
170 :
171 Gtk::HBox(construct_params)
172 {
173 }
174
FileChooserButton(GtkFileChooserButton * castitem)175 FileChooserButton::FileChooserButton(GtkFileChooserButton* castitem)
176 :
177 Gtk::HBox((GtkHBox*)(castitem))
178 {
179 }
180
181
FileChooserButton(FileChooserButton && src)182 FileChooserButton::FileChooserButton(FileChooserButton&& src) noexcept
183 : Gtk::HBox(std::move(src))
184 , FileChooser(std::move(src))
185 {}
186
operator =(FileChooserButton && src)187 FileChooserButton& FileChooserButton::operator=(FileChooserButton&& src) noexcept
188 {
189 Gtk::HBox::operator=(std::move(src));
190 FileChooser::operator=(std::move(src));
191 return *this;
192 }
193
~FileChooserButton()194 FileChooserButton::~FileChooserButton() noexcept
195 {
196 destroy_();
197 }
198
199 FileChooserButton::CppClassType FileChooserButton::filechooserbutton_class_; // initialize static member
200
get_type()201 GType FileChooserButton::get_type()
202 {
203 return filechooserbutton_class_.init().get_type();
204 }
205
206
get_base_type()207 GType FileChooserButton::get_base_type()
208 {
209 return gtk_file_chooser_button_get_type();
210 }
211
212
FileChooserButton(const Glib::ustring & title,FileChooserAction action)213 FileChooserButton::FileChooserButton(const Glib::ustring& title, FileChooserAction action)
214 :
215 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
216 Glib::ObjectBase(nullptr),
217 Gtk::HBox(Glib::ConstructParams(filechooserbutton_class_.init(), "title", title.c_str(), "action", ((GtkFileChooserAction)(action)), nullptr))
218 {
219
220
221 }
222
FileChooserButton(FileChooserDialog & dialog)223 FileChooserButton::FileChooserButton(FileChooserDialog& dialog)
224 :
225 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
226 Glib::ObjectBase(nullptr),
227 Gtk::HBox(Glib::ConstructParams(filechooserbutton_class_.init(), "dialog", (dialog).Gtk::Widget::gobj(), nullptr))
228 {
229
230
231 }
232
get_title() const233 Glib::ustring FileChooserButton::get_title() const
234 {
235 return Glib::convert_const_gchar_ptr_to_ustring(gtk_file_chooser_button_get_title(const_cast<GtkFileChooserButton*>(gobj())));
236 }
237
set_title(const Glib::ustring & title)238 void FileChooserButton::set_title(const Glib::ustring& title)
239 {
240 gtk_file_chooser_button_set_title(gobj(), title.c_str());
241 }
242
get_width_chars() const243 int FileChooserButton::get_width_chars() const
244 {
245 return gtk_file_chooser_button_get_width_chars(const_cast<GtkFileChooserButton*>(gobj()));
246 }
247
set_width_chars(int n_chars)248 void FileChooserButton::set_width_chars(int n_chars)
249 {
250 gtk_file_chooser_button_set_width_chars(gobj(), n_chars);
251 }
252
253 #ifndef GTKMM_DISABLE_DEPRECATED
254 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_focus_on_click() const255 bool FileChooserButton::get_focus_on_click() const
256 {
257 return gtk_file_chooser_button_get_focus_on_click(const_cast<GtkFileChooserButton*>(gobj()));
258 }
259 G_GNUC_END_IGNORE_DEPRECATIONS
260 #endif // GTKMM_DISABLE_DEPRECATED
261
262 #ifndef GTKMM_DISABLE_DEPRECATED
263 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
set_focus_on_click(gboolean focus_on_click)264 void FileChooserButton::set_focus_on_click(gboolean focus_on_click)
265 {
266 gtk_file_chooser_button_set_focus_on_click(gobj(), focus_on_click);
267 }
268 G_GNUC_END_IGNORE_DEPRECATIONS
269 #endif // GTKMM_DISABLE_DEPRECATED
270
271
signal_file_set()272 Glib::SignalProxy< void > FileChooserButton::signal_file_set()
273 {
274 return Glib::SignalProxy< void >(this, &FileChooserButton_signal_file_set_info);
275 }
276
277
property_title()278 Glib::PropertyProxy< Glib::ustring > FileChooserButton::property_title()
279 {
280 return Glib::PropertyProxy< Glib::ustring >(this, "title");
281 }
282
property_title() const283 Glib::PropertyProxy_ReadOnly< Glib::ustring > FileChooserButton::property_title() const
284 {
285 return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "title");
286 }
287
property_width_chars()288 Glib::PropertyProxy< int > FileChooserButton::property_width_chars()
289 {
290 return Glib::PropertyProxy< int >(this, "width-chars");
291 }
292
property_width_chars() const293 Glib::PropertyProxy_ReadOnly< int > FileChooserButton::property_width_chars() const
294 {
295 return Glib::PropertyProxy_ReadOnly< int >(this, "width-chars");
296 }
297
298
on_file_set()299 void Gtk::FileChooserButton::on_file_set()
300 {
301 const auto base = static_cast<BaseClassType*>(
302 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
303 );
304
305 if(base && base->file_set)
306 (*base->file_set)(gobj());
307 }
308
309
310 } // namespace Gtk
311
312
313