1 // fm-dir-tree-view.h 2 // 3 // Copyright 2011 Hong Jen Yee (PCMan) <pcman.tw@gmail.com> 4 // Copyright 2012-2013 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua> 5 // 6 // This program is free software; you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation; either version 2 of the License, or 9 // (at your option) any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with this program; if not, write to the Free Software 18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 // MA 02110-1301, USA. 20 21 22 #ifndef __FM_DIR_TREE_VIEW_H__ 23 #define __FM_DIR_TREE_VIEW_H__ 24 25 #include <gtk/gtk.h> 26 #include "fm-path.h" 27 #include "fm-dnd-dest.h" 28 29 #include "fm-seal.h" 30 31 G_BEGIN_DECLS 32 33 34 #define FM_TYPE_DIR_TREE_VIEW (fm_dir_tree_view_get_type()) 35 #define FM_DIR_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ 36 FM_TYPE_DIR_TREE_VIEW, FmDirTreeView)) 37 #define FM_DIR_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\ 38 FM_TYPE_DIR_TREE_VIEW, FmDirTreeViewClass)) 39 #define FM_IS_DIR_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\ 40 FM_TYPE_DIR_TREE_VIEW)) 41 #define FM_IS_DIR_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),\ 42 FM_TYPE_DIR_TREE_VIEW)) 43 #define FM_DIR_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\ 44 FM_TYPE_DIR_TREE_VIEW, FmDirTreeViewClass)) 45 46 typedef struct _FmDirTreeView FmDirTreeView; 47 typedef struct _FmDirTreeViewClass FmDirTreeViewClass; 48 49 struct _FmDirTreeView 50 { 51 GtkTreeView parent; 52 FmPath* FM_SEAL(cwd); 53 54 /* <private> */ 55 FmDndDest* FM_SEAL(dd); 56 gpointer _reserved1; 57 58 /* used for chdir */ 59 GSList* FM_SEAL(paths_to_expand); 60 GtkTreeRowReference* FM_SEAL(current_row); 61 }; 62 63 /** 64 * FmDirTreeViewClass: 65 * @parent_class: the parent class 66 * @chdir: the class closure for the #FmDirTreeView::chdir signal. 67 * @item_popup: the class closure for the #FmDirTreeView::item-popup signal. 68 */ 69 struct _FmDirTreeViewClass 70 { 71 GtkTreeViewClass parent_class; 72 void (*chdir)(FmDirTreeView* view, guint button, FmPath* path); 73 void (*item_popup)(FmDirTreeView* view, GtkUIManager* ui, GtkActionGroup* act_grp, FmFileInfo* file); 74 /*< private >*/ 75 gpointer _reserved1; 76 }; 77 78 79 GType fm_dir_tree_view_get_type (void); 80 FmDirTreeView* fm_dir_tree_view_new (void); 81 82 FmPath* fm_dir_tree_view_get_cwd(FmDirTreeView* view); 83 void fm_dir_tree_view_chdir(FmDirTreeView* view, FmPath* path); 84 85 G_END_DECLS 86 87 #endif /* __FM_DIR_TREE_VIEW_H__ */ 88