📄 gemfilechooser.h.svn-base
字号:
/* libgemwidget - Gtk+ Embedded Widget library * * Authors: YE Nan <nan.ye@orange-ftgourp.com> * * This software and associated documentation files (the "Software") * are copyright (C) 2005 LiPS Linux Phone Standards Forum [FranceTelecom] * All Rights Reserved. * * A copyright license is hereby granted for redistribution and use of * the Software in source and binary forms, with or without modification, * provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this copyright license and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this copyright license and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - Neither the name of LiPS nor the names of its Members may be used * to endorse or promote products derived from the Software without * specific prior written permission. * * A patent license for any Necessary Claims owned by Members of LiPS Forum * to make, have made, use, import, offer to sell, lease and sell or otherwise * distribute any implementation compliant with the any specification adopted * by the LiPS Forumcan be obtained from the respective Members on reasonable * and non-discriminatory terms and conditions and under reciprocity, as * regulated in more detail in the Internal Policy of the LiPS Forum. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER, ITS MEMBERS AND CONTRIBUTORS * "AS IS", AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, * ITS MEMBERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */#ifndef __GEM_FILE_CHOOSER_H#define __GEM_FILE_CHOOSER_H#include <gtk/gtk.h>#include <libgnomevfs/gnome-vfs.h>#include <libgnomevfs/gnome-vfs-mime.h>#include <libgnomevfs/gnome-vfs-mime-handlers.h>#include <libgnomevfs/gnome-vfs-mime-utils.h>#include <libgnomevfs/gnome-vfs-mime-info.h>#include <libgnomevfs/gnome-vfs-module-callback.h>#include <libgnomevfs/gnome-vfs-standard-callbacks.h>#include <libgnomevfs/gnome-vfs-xfer.h>#include <libgnomevfs/gnome-vfs-types.h>#include <libgnomevfs/gnome-vfs-application-registry.h>#define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED#include <gtk/gtkfilesystem.h>#include <gemtreeview.h>#ifdef __cplusplusextern "C" {#endif#define GEM_TYPE_FILE_CHOOSER (gem_file_chooser_get_type ())#define GEM_FILE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEM_TYPE_FILE_CHOOSER, GemFileChooser))#define GEM_FILE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEM_TYPE_FILE_CHOOSER, GemFileChooserClass))#define GEM_IS_FILE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEM_TYPE_FILE_CHOOSER))#define GEM_IS_FILE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEM_TYPE_FILE_CHOOSER))#define GEM_FILE_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEM_TYPE_FILE_CHOOSER, GemFileChooserClass))#define VIRTUAL_ROOT "/opt/vr" typedef struct _GemFileChooser GemFileChooser;typedef struct _GemFileChooserClass GemFileChooserClass;struct _GemFileChooser{ GemTreeView view; gchar *current_path; GtkTreeViewColumn * check_box; /*GtkFileSystem *file_system;*/ gboolean selectable;};struct _GemFileChooserClass{ GemTreeViewClass parent_class; void (*file_selected) (GemFileChooser *filechooser); /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void);};static const struct{ gchar *alias; gchar *path;}virtual_topdirs[] ={ { ("My Music"), "music"}, { ("My Image"),"photo"}, { ("My RingTone"), "ringtone"}, { ("My Video"),"video"}, { ("SD"), "sd"},};#define VIRTUAL_TOPDIR_COUNT (sizeof(virtual_topdirs)/sizeof(virtual_topdirs[0]))typedef enum{ MUSIC, PHOTO, RINGTONE, VIDEO, SD, PARENT, COLLECTION, NORMAL, GEM_FC_NUMS_ICONS}vitual_root_file_type;//#define SD_PATH="/media/sd"GType gem_file_chooser_get_type (void) G_GNUC_CONST;GtkWidget* gem_file_chooser_new (void);void gem_file_chooser_set_selectable (GemFileChooser *filechooser, gboolean selectable);gboolean gem_file_chooser_get_selectable (GemFileChooser *filechooser);GList * gem_file_chooser_get_current_selections (GemFileChooser *filechooser);GList * gem_file_chooser_get_current_selections_vfs_file_info (GemFileChooser *filechooser);void gem_file_chooser_set_current_path (GemFileChooser *filechooser, const gchar *path);G_CONST_RETURN gchar * gem_file_chooser_get_current_path (GemFileChooser *filechooser);void gem_file_chooser_select_all (GemFileChooser *filechooser);void gem_file_chooser_unselect_all (GemFileChooser *filechooser);#ifdef __cplusplus}#endif#endif /*__GEM_FILE_CHOOSER_H*//*vi:ts=2:nowrap:ai:expandtab */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -