123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207(**************************************************************************)(* Lablgtk *)(* *)(* This program is free software; you can redistribute it *)(* and/or modify it under the terms of the GNU Library General *)(* Public License as published by the Free Software Foundation *)(* version 2, with the exception described in file COPYING which *)(* comes with the library. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Library General Public License for more details. *)(* *)(* You should have received a copy of the GNU Library General *)(* Public License along with this program; if not, write to the *)(* Free Software Foundation, Inc., 59 Temple Place, Suite 330, *)(* Boston, MA 02111-1307 USA *)(* *)(* *)(**************************************************************************)openGtkFileclassfilterobj=objectinheritGObj.gtkobjobjmethodas_file_filter=(obj:>Gtk.file_filterGtk.obj)methodset_name=FileFilter.set_nameobjmethodname=FileFilter.get_nameobjmethodadd_mime_type=FileFilter.add_mime_typeobjmethodadd_pattern=FileFilter.add_patternobjmethodadd_custom=FileFilter.add_customobjendletfilter?name?(patterns=[])?(mime_types=[])()=letw=FileFilter.create()inGaux.may(FileFilter.set_namew)name;List.iter(FileFilter.add_patternw)patterns;List.iter(FileFilter.add_mime_typew)mime_types;newfilterwclasstypechooser_signals=objectmethodcurrent_folder_changed:callback:(unit->unit)->GtkSignal.idmethodfile_activated:callback:(unit->unit)->GtkSignal.idmethodselection_changed:callback:(unit->unit)->GtkSignal.idmethodupdate_preview:callback:(unit->unit)->GtkSignal.idmethodconfirm_overwrite:callback:(unit->GtkEnums.file_chooser_confirmation)->GtkSignal.idmethodnotify_action:callback:(GtkEnums.file_chooser_action->unit)->GtkSignal.idmethodnotify_create_folders:callback:(bool->unit)->GtkSignal.idmethodnotify_do_overwrite_confirmation:callback:(bool->unit)->GtkSignal.idmethodnotify_extra_widget:callback:(GObj.widget->unit)->GtkSignal.idmethodnotify_local_only:callback:(bool->unit)->GtkSignal.idmethodnotify_preview_widget:callback:(GObj.widget->unit)->GtkSignal.idmethodnotify_preview_widget_active:callback:(bool->unit)->GtkSignal.idmethodnotify_select_multiple:callback:(bool->unit)->GtkSignal.idmethodnotify_show_hidden:callback:(bool->unit)->GtkSignal.idmethodnotify_use_preview_label:callback:(bool->unit)->GtkSignal.idendclasstypechooser=objectmethodset_action:GtkEnums.file_chooser_action->unitmethodaction:GtkEnums.file_chooser_actionmethodset_create_folders:bool->unitmethodcreate_folders:boolmethodset_local_only:bool->unitmethodlocal_only:boolmethodset_select_multiple:bool->unitmethodselect_multiple:boolmethodset_current_name:string->unitmethodshow_hidden:boolmethodset_show_hidden:bool->unitmethodset_filename:string->boolmethodfilename:stringoptionmethodselect_filename:string->boolmethodunselect_filename:string->unitmethodget_filenames:stringlistmethodset_current_folder:string->boolmethodcurrent_folder:stringoptionmethodset_uri:string->boolmethoduri:stringoptionmethodselect_uri:string->boolmethodunselect_uri:string->unitmethodget_uris:stringlistmethodset_current_folder_uri:string->boolmethodcurrent_folder_uri:stringmethodselect_all:unitmethodunselect_all:unitmethodset_preview_widget:GObj.widget->unitmethodpreview_widget:GObj.widgetmethodset_preview_widget_active:bool->unitmethodpreview_widget_active:boolmethodpreview_filename:stringoptionmethodpreview_uri:stringoptionmethodset_use_preview_label:bool->unitmethoduse_preview_label:boolmethodset_extra_widget:GObj.widget->unitmethodextra_widget:GObj.widgetmethodadd_filter:filter->unitmethodremove_filter:filter->unitmethodlist_filters:filterlistmethodset_filter:filter->unitmethodfilter:filtermethodadd_shortcut_folder:string->unitmethodremove_shortcut_folder:string->unitmethodlist_shortcut_folders:stringlistmethodadd_shortcut_folder_uri:string->unitmethodremove_shortcut_folder_uri:string->unitmethodlist_shortcut_folder_uris:stringlistmethoddo_overwrite_confirmation:boolmethodset_do_overwrite_confirmation:bool->unitendclassvirtualchooser_impl=object(self)valvirtualobj:'aGtk.objinheritOgtkFileProps.file_chooser_propsmethodset_current_name=FileChooser.set_current_nameobjmethodset_filename=FileChooser.set_filenameobjmethodfilename=FileChooser.get_filenameobjmethodselect_filename=FileChooser.select_filenameobjmethodunselect_filename=FileChooser.unselect_filenameobjmethodselect_all=FileChooser.select_allobjmethodunselect_all=FileChooser.unselect_allobjmethodget_filenames=FileChooser.get_filenamesobjmethodset_current_folder=FileChooser.set_current_folderobjmethodcurrent_folder=FileChooser.get_current_folderobjmethodset_uri=FileChooser.set_uriobjmethoduri=FileChooser.get_uriobjmethodselect_uri=FileChooser.select_uriobjmethodunselect_uri=FileChooser.unselect_uriobjmethodget_uris=FileChooser.get_urisobjmethodset_current_folder_uri=FileChooser.set_current_folder_uriobjmethodcurrent_folder_uri=FileChooser.get_current_folder_uriobjmethodpreview_filename=FileChooser.get_preview_filenameobjmethodpreview_uri=FileChooser.get_preview_uriobjmethodadd_filter(f:filter)=FileChooser.add_filterobjf#as_file_filtermethodremove_filter(f:filter)=FileChooser.remove_filterobjf#as_file_filtermethodlist_filters=List.map(newfilter)(FileChooser.list_filtersobj)methodset_filter(f:filter)=Gobject.setFileChooser.P.filterobjf#as_file_filtermethodfilter=newfilter(Gobject.getFileChooser.P.filterobj)methodadd_shortcut_folder=FileChooser.add_shortcut_folderobjmethodremove_shortcut_folder=FileChooser.remove_shortcut_folderobjmethodlist_shortcut_folders=FileChooser.list_shortcut_foldersobjmethodadd_shortcut_folder_uri=FileChooser.add_shortcut_folder_uriobjmethodremove_shortcut_folder_uri=FileChooser.remove_shortcut_folder_uriobjmethodlist_shortcut_folder_uris=FileChooser.list_shortcut_folder_urisobjendclasschooser_widget_signalsobj=objectinheritGObj.widget_signals_implobjinheritOgtkFileProps.file_chooser_sigsendclasschooser_widgetobj=objectinherit[_]GObj.widget_implobjinheritchooser_implmethodevent=newGObj.event_opsobjmethodconnect=newchooser_widget_signalsobjendletmay_cons=Gobject.Property.may_consletchooser_widget~action?filename?packing?show()=letw=FileChooser.widget_create[Gobject.paramFileChooser.P.actionaction]inleto=newchooser_widgetwinGaux.may~f:o#set_filenamefilename;GObj.pack_returno~packing~showclasschooser_button_signalsobj=objectinheritGContainer.container_signals_implobjinheritOgtkFileProps.file_chooser_sigsendclasschooser_buttonobj=objectmethodprivateobj=objinheritGPack.box_skelobjinheritchooser_implinheritOgtkFileProps.file_chooser_button_propsmethodconnect=newchooser_button_signalsobjendletchooser_button~action?title?width_chars?filename=GContainer.pack_container(Gobject.paramFileChooser.P.actionaction::(may_consFileChooserButton.P.titletitle(may_consFileChooserButton.P.width_charswidth_chars[])))~create:(funpl->leto=newchooser_button(FileChooserButton.createpl)inGaux.may~f:o#set_filenamefilename;o)