Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / filechooser.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/filechooser.h>
4 #include <gtkmm/private/filechooser_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* Copyright 2003 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/gtkfilechooser.h>
27 //#include <gtk/gtkfilesystem.h> //We include this semi-private header just to get GTK_FILE_SYSTEM_ERROR.
28
29
30 namespace
31 {
32
33 const Glib::SignalProxyInfo FileChooser_signal_current_folder_changed_info =
34 {
35   "current_folder_changed",
36   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
37   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
38 };
39
40
41 const Glib::SignalProxyInfo FileChooser_signal_selection_changed_info =
42 {
43   "selection_changed",
44   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
45   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
46 };
47
48
49 const Glib::SignalProxyInfo FileChooser_signal_update_preview_info =
50 {
51   "update_preview",
52   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
53   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
54 };
55
56
57 const Glib::SignalProxyInfo FileChooser_signal_file_activated_info =
58 {
59   "file_activated",
60   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
61   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
62 };
63
64 } // anonymous namespace
65
66 // static
67 GType Glib::Value<Gtk::FileChooserAction>::value_type()
68 {
69   return gtk_file_chooser_action_get_type();
70 }
71
72
73 Gtk::FileChooserError::FileChooserError(Gtk::FileChooserError::Code error_code, const Glib::ustring& error_message)
74 :
75   Glib::Error (GTK_FILE_CHOOSER_ERROR, error_code, error_message)
76 {}
77
78 Gtk::FileChooserError::FileChooserError(GError* gobject)
79 :
80   Glib::Error (gobject)
81 {}
82
83 Gtk::FileChooserError::Code Gtk::FileChooserError::code() const
84 {
85   return static_cast<Code>(Glib::Error::code());
86 }
87
88 void Gtk::FileChooserError::throw_func(GError* gobject)
89 {
90   throw Gtk::FileChooserError(gobject);
91 }
92
93 // static
94 GType Glib::Value<Gtk::FileChooserError::Code>::value_type()
95 {
96   return gtk_file_chooser_error_get_type();
97 }
98
99
100 namespace Glib
101 {
102
103 Glib::RefPtr<Gtk::FileChooser> wrap(GtkFileChooser* object, bool take_copy)
104 {
105   return Glib::RefPtr<Gtk::FileChooser>( dynamic_cast<Gtk::FileChooser*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
106   //We use dynamic_cast<> in case of multiple inheritance.
107 }
108
109 } // namespace Glib
110
111
112 namespace Gtk
113 {
114
115
116 /* The *_Class implementation: */
117
118 const Glib::Interface_Class& FileChooser_Class::init()
119 {
120   if(!gtype_) // create the GType if necessary
121   {
122     // Glib::Interface_Class has to know the interface init function
123     // in order to add interfaces to implementing types.
124     class_init_func_ = &FileChooser_Class::iface_init_function;
125
126     // We can not derive from another interface, and it is not necessary anyway.
127     gtype_ = gtk_file_chooser_get_type();
128   }
129
130   return *this;
131 }
132
133 void FileChooser_Class::iface_init_function(void* g_iface, void*)
134 {
135   BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
136
137   //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
138   //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
139   g_assert(klass != 0); 
140
141 }
142
143
144 Glib::ObjectBase* FileChooser_Class::wrap_new(GObject* object)
145 {
146   return new FileChooser((GtkFileChooser*)(object));
147 }
148
149
150 /* The implementation: */
151
152 FileChooser::FileChooser()
153 :
154   Glib::Interface(filechooser_class_.init())
155 {}
156
157 FileChooser::FileChooser(GtkFileChooser* castitem)
158 :
159   Glib::Interface((GObject*)(castitem))
160 {}
161
162 FileChooser::~FileChooser()
163 {}
164
165 // static
166 void FileChooser::add_interface(GType gtype_implementer)
167 {
168   filechooser_class_.init().add_interface(gtype_implementer);
169 }
170
171 FileChooser::CppClassType FileChooser::filechooser_class_; // initialize static member
172
173 GType FileChooser::get_type()
174 {
175   return filechooser_class_.init().get_type();
176 }
177
178 GType FileChooser::get_base_type()
179 {
180   return gtk_file_chooser_get_type();
181 }
182
183
184 void FileChooser::set_action(FileChooserAction action)
185 {
186   gtk_file_chooser_set_action(gobj(), ((GtkFileChooserAction)(action)));
187 }
188
189 FileChooserAction FileChooser::get_action() const
190 {
191   return ((FileChooserAction)(gtk_file_chooser_get_action(const_cast<GtkFileChooser*>(gobj()))));
192 }
193
194 void FileChooser::set_local_only(bool local_only)
195 {
196   gtk_file_chooser_set_local_only(gobj(), static_cast<int>(local_only));
197 }
198
199 bool FileChooser::get_local_only() const
200 {
201   return gtk_file_chooser_get_local_only(const_cast<GtkFileChooser*>(gobj()));
202 }
203
204 void FileChooser::set_select_multiple(bool select_multiple)
205 {
206   gtk_file_chooser_set_select_multiple(gobj(), static_cast<int>(select_multiple));
207 }
208
209 bool FileChooser::get_select_multiple() const
210 {
211   return gtk_file_chooser_get_select_multiple(const_cast<GtkFileChooser*>(gobj()));
212 }
213
214 void FileChooser::set_show_hidden(bool show_hidden)
215 {
216   gtk_file_chooser_set_show_hidden(gobj(), static_cast<int>(show_hidden));
217 }
218
219 bool FileChooser::get_show_hidden() const
220 {
221   return gtk_file_chooser_get_show_hidden(const_cast<GtkFileChooser*>(gobj()));
222 }
223
224 void FileChooser::set_current_name(const Glib::ustring& name)
225 {
226   gtk_file_chooser_set_current_name(gobj(), name.c_str());
227 }
228
229 Glib::ustring FileChooser::get_filename() const
230 {
231   return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_filename(const_cast<GtkFileChooser*>(gobj())));
232 }
233
234 bool FileChooser::set_filename(const Glib::ustring& filename)
235 {
236   return gtk_file_chooser_set_filename(gobj(), filename.c_str());
237 }
238
239 bool FileChooser::select_filename(const Glib::ustring& filename)
240 {
241   return gtk_file_chooser_select_filename(gobj(), filename.c_str());
242 }
243
244 void FileChooser::unselect_filename(const Glib::ustring& filename)
245 {
246   gtk_file_chooser_unselect_filename(gobj(), filename.c_str());
247 }
248
249 void FileChooser::select_all()
250 {
251   gtk_file_chooser_select_all(gobj());
252 }
253
254 void FileChooser::unselect_all()
255 {
256   gtk_file_chooser_unselect_all(gobj());
257 }
258
259 Glib::SListHandle<Glib::ustring> FileChooser::get_filenames() const
260 {
261   return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_get_filenames(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
262 }
263
264 bool FileChooser::set_current_folder(const Glib::ustring& filename)
265 {
266   return gtk_file_chooser_set_current_folder(gobj(), filename.c_str());
267 }
268
269 Glib::ustring FileChooser::get_current_folder() const
270 {
271   return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_current_folder(const_cast<GtkFileChooser*>(gobj())));
272 }
273
274 Glib::ustring FileChooser::get_uri() const
275 {
276   return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_uri(const_cast<GtkFileChooser*>(gobj())));
277 }
278
279 bool FileChooser::set_uri(const Glib::ustring& uri)
280 {
281   return gtk_file_chooser_set_uri(gobj(), uri.c_str());
282 }
283
284 bool FileChooser::select_uri(const Glib::ustring& uri)
285 {
286   return gtk_file_chooser_select_uri(gobj(), uri.c_str());
287 }
288
289 void FileChooser::unselect_uri(const Glib::ustring& uri)
290 {
291   gtk_file_chooser_unselect_uri(gobj(), uri.c_str());
292 }
293
294 Glib::SListHandle<Glib::ustring> FileChooser::get_uris() const
295 {
296   return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_get_uris(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
297 }
298
299 bool FileChooser::set_current_folder_uri(const Glib::ustring& uri)
300 {
301   return gtk_file_chooser_set_current_folder_uri(gobj(), uri.c_str());
302 }
303
304 Glib::ustring FileChooser::get_current_folder_uri() const
305 {
306   return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_current_folder_uri(const_cast<GtkFileChooser*>(gobj())));
307 }
308
309 void FileChooser::set_preview_widget(Gtk::Widget& preview_widget)
310 {
311   gtk_file_chooser_set_preview_widget(gobj(), (preview_widget).gobj());
312 }
313
314 const Gtk::Widget* FileChooser::get_preview_widget() const
315 {
316   return Glib::wrap(gtk_file_chooser_get_preview_widget(const_cast<GtkFileChooser*>(gobj())));
317 }
318
319 Gtk::Widget* FileChooser::get_preview_widget()
320 {
321   return Glib::wrap(gtk_file_chooser_get_preview_widget(gobj()));
322 }
323
324 void FileChooser::set_preview_widget_active(bool active)
325 {
326   gtk_file_chooser_set_preview_widget_active(gobj(), static_cast<int>(active));
327 }
328
329 bool FileChooser::get_preview_widget_active() const
330 {
331   return gtk_file_chooser_get_preview_widget_active(const_cast<GtkFileChooser*>(gobj()));
332 }
333
334 void FileChooser::set_use_preview_label(bool use_label)
335 {
336   gtk_file_chooser_set_use_preview_label(gobj(), static_cast<int>(use_label));
337 }
338
339 bool FileChooser::get_use_preview_label() const
340 {
341   return gtk_file_chooser_get_use_preview_label(const_cast<GtkFileChooser*>(gobj()));
342 }
343
344 Glib::ustring FileChooser::get_preview_filename() const
345 {
346   return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_preview_filename(const_cast<GtkFileChooser*>(gobj())));
347 }
348
349 Glib::ustring FileChooser::get_preview_uri() const
350 {
351   return Glib::convert_return_gchar_ptr_to_ustring(gtk_file_chooser_get_preview_uri(const_cast<GtkFileChooser*>(gobj())));
352 }
353
354 void FileChooser::set_extra_widget(Gtk::Widget& extra_widget)
355 {
356   gtk_file_chooser_set_extra_widget(gobj(), (extra_widget).gobj());
357 }
358
359 Gtk::Widget* FileChooser::get_extra_widget()
360 {
361   return Glib::wrap(gtk_file_chooser_get_extra_widget(gobj()));
362 }
363
364 const Gtk::Widget* FileChooser::get_extra_widget() const
365 {
366   return Glib::wrap(gtk_file_chooser_get_extra_widget(const_cast<GtkFileChooser*>(gobj())));
367 }
368
369 void FileChooser::add_filter(const FileFilter& filter)
370 {
371   gtk_file_chooser_add_filter(gobj(), const_cast<GtkFileFilter*>((filter).gobj()));
372 }
373
374 void FileChooser::remove_filter(const FileFilter& filter)
375 {
376   gtk_file_chooser_remove_filter(gobj(), const_cast<GtkFileFilter*>((filter).gobj()));
377 }
378
379 Glib::SListHandle< FileFilter* > FileChooser::list_filters()
380 {
381   return Glib::SListHandle< FileFilter* >(gtk_file_chooser_list_filters(gobj()), Glib::OWNERSHIP_SHALLOW);
382 }
383
384 Glib::SListHandle< const FileFilter* > FileChooser::list_filters() const
385 {
386   return Glib::SListHandle< const FileFilter* >(gtk_file_chooser_list_filters(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_SHALLOW);
387 }
388
389 void FileChooser::set_filter(const FileFilter& filter)
390 {
391   gtk_file_chooser_set_filter(gobj(), const_cast<GtkFileFilter*>((filter).gobj()));
392 }
393
394 FileFilter* FileChooser::get_filter()
395 {
396
397   FileFilter* retvalue = Glib::wrap(gtk_file_chooser_get_filter(gobj()));
398
399   if(retvalue)
400     retvalue->reference(); //The function does not do a ref for us.
401   return retvalue;
402 }
403
404 const FileFilter* FileChooser::get_filter() const
405 {
406
407   const FileFilter* retvalue = Glib::wrap(gtk_file_chooser_get_filter(const_cast<GtkFileChooser*>(gobj())));
408
409   if(retvalue)
410     retvalue->reference(); //The function does not do a ref for us.
411   return retvalue;
412 }
413
414 bool FileChooser::add_shortcut_folder(const Glib::ustring& folder)
415 {
416   GError *error = 0;
417   bool retvalue = gtk_file_chooser_add_shortcut_folder(gobj(), folder.c_str(), &(error));
418   if(error) ::Glib::Error::throw_exception(error);
419   return retvalue;
420 }
421
422 bool FileChooser::remove_shortcut_folder(const Glib::ustring& folder)
423 {
424   GError *error = 0;
425   bool retvalue = gtk_file_chooser_remove_shortcut_folder(gobj(), folder.c_str(), &(error));
426   if(error) ::Glib::Error::throw_exception(error);
427   return retvalue;
428 }
429
430 Glib::SListHandle<Glib::ustring> FileChooser::list_shortcut_folders() const
431 {
432   return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_list_shortcut_folders(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
433 }
434
435 bool FileChooser::add_shortcut_folder_uri(const Glib::ustring& uri)
436 {
437   GError *error = 0;
438   bool retvalue = gtk_file_chooser_add_shortcut_folder_uri(gobj(), uri.c_str(), &(error));
439   if(error) ::Glib::Error::throw_exception(error);
440   return retvalue;
441 }
442
443 bool FileChooser::remove_shortcut_folder_uri(const Glib::ustring& uri)
444 {
445   GError *error = 0;
446   bool retvalue = gtk_file_chooser_remove_shortcut_folder_uri(gobj(), uri.c_str(), &(error));
447   if(error) ::Glib::Error::throw_exception(error);
448   return retvalue;
449 }
450
451 Glib::SListHandle<Glib::ustring> FileChooser::list_shortcut_folder_uris() const
452 {
453   return Glib::SListHandle<Glib::ustring>(gtk_file_chooser_list_shortcut_folder_uris(const_cast<GtkFileChooser*>(gobj())), Glib::OWNERSHIP_DEEP);
454 }
455
456
457 Glib::SignalProxy0< void > FileChooser::signal_current_folder_changed()
458 {
459   return Glib::SignalProxy0< void >(this, &FileChooser_signal_current_folder_changed_info);
460 }
461
462 Glib::SignalProxy0< void > FileChooser::signal_selection_changed()
463 {
464   return Glib::SignalProxy0< void >(this, &FileChooser_signal_selection_changed_info);
465 }
466
467 Glib::SignalProxy0< void > FileChooser::signal_update_preview()
468 {
469   return Glib::SignalProxy0< void >(this, &FileChooser_signal_update_preview_info);
470 }
471
472 Glib::SignalProxy0< void > FileChooser::signal_file_activated()
473 {
474   return Glib::SignalProxy0< void >(this, &FileChooser_signal_file_activated_info);
475 }
476
477
478 Glib::PropertyProxy<FileChooserAction> FileChooser::property_action() 
479 {
480   return Glib::PropertyProxy<FileChooserAction>(this, "action");
481 }
482
483 Glib::PropertyProxy_ReadOnly<FileChooserAction> FileChooser::property_action() const
484 {
485   return Glib::PropertyProxy_ReadOnly<FileChooserAction>(this, "action");
486 }
487
488 Glib::PropertyProxy<FileFilter*> FileChooser::property_filter() 
489 {
490   return Glib::PropertyProxy<FileFilter*>(this, "filter");
491 }
492
493 Glib::PropertyProxy_ReadOnly<FileFilter*> FileChooser::property_filter() const
494 {
495   return Glib::PropertyProxy_ReadOnly<FileFilter*>(this, "filter");
496 }
497
498 Glib::PropertyProxy<bool> FileChooser::property_folder_mode() 
499 {
500   return Glib::PropertyProxy<bool>(this, "folder-mode");
501 }
502
503 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_folder_mode() const
504 {
505   return Glib::PropertyProxy_ReadOnly<bool>(this, "folder-mode");
506 }
507
508 Glib::PropertyProxy<bool> FileChooser::property_local_only() 
509 {
510   return Glib::PropertyProxy<bool>(this, "local-only");
511 }
512
513 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_local_only() const
514 {
515   return Glib::PropertyProxy_ReadOnly<bool>(this, "local-only");
516 }
517
518 Glib::PropertyProxy<Widget*> FileChooser::property_preview_widget() 
519 {
520   return Glib::PropertyProxy<Widget*>(this, "preview-widget");
521 }
522
523 Glib::PropertyProxy_ReadOnly<Widget*> FileChooser::property_preview_widget() const
524 {
525   return Glib::PropertyProxy_ReadOnly<Widget*>(this, "preview-widget");
526 }
527
528 Glib::PropertyProxy<bool> FileChooser::property_preview_widget_active() 
529 {
530   return Glib::PropertyProxy<bool>(this, "preview-widget-active");
531 }
532
533 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_preview_widget_active() const
534 {
535   return Glib::PropertyProxy_ReadOnly<bool>(this, "preview-widget-active");
536 }
537
538 Glib::PropertyProxy<bool> FileChooser::property_use_preview_label() 
539 {
540   return Glib::PropertyProxy<bool>(this, "use-preview-label");
541 }
542
543 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_use_preview_label() const
544 {
545   return Glib::PropertyProxy_ReadOnly<bool>(this, "use-preview-label");
546 }
547
548 Glib::PropertyProxy<Widget*> FileChooser::property_extra_widget() 
549 {
550   return Glib::PropertyProxy<Widget*>(this, "extra-widget");
551 }
552
553 Glib::PropertyProxy_ReadOnly<Widget*> FileChooser::property_extra_widget() const
554 {
555   return Glib::PropertyProxy_ReadOnly<Widget*>(this, "extra-widget");
556 }
557
558 Glib::PropertyProxy<bool> FileChooser::property_select_multiple() 
559 {
560   return Glib::PropertyProxy<bool>(this, "select-multiple");
561 }
562
563 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_select_multiple() const
564 {
565   return Glib::PropertyProxy_ReadOnly<bool>(this, "select-multiple");
566 }
567
568 Glib::PropertyProxy<bool> FileChooser::property_show_hidden() 
569 {
570   return Glib::PropertyProxy<bool>(this, "show-hidden");
571 }
572
573 Glib::PropertyProxy_ReadOnly<bool> FileChooser::property_show_hidden() const
574 {
575   return Glib::PropertyProxy_ReadOnly<bool>(this, "show-hidden");
576 }
577
578
579 } // namespace Gtk
580
581