r235: Added the Shell Command feature to the minibuffer.
[rox-filer.git] / ROX-Filer / src / filer.h
blob1eb4518f2adebe8af0196319434089fb0e9dea83
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@ecs.soton.ac.uk>.
6 */
8 #ifndef _FILER_H
9 #define _FILER_H
11 #include <gtk/gtk.h>
12 #include "collection.h"
13 #include "pixmaps.h"
14 #include <sys/types.h>
15 #include <dirent.h>
17 typedef struct _FilerWindow FilerWindow;
18 typedef enum {PANEL_NO, PANEL_TOP, PANEL_BOTTOM} PanelType;
19 typedef enum {UNKNOWN_STYLE, LARGE_ICONS, SMALL_ICONS, FULL_INFO} DisplayStyle;
21 typedef enum
23 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
24 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
25 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
26 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
27 } OpenFlags;
29 typedef enum
31 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
32 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
33 } FilerFlags;
35 #include "mount.h"
36 #include "minibuffer.h"
37 #include "dir.h"
38 #include "type.h"
40 struct _FilerWindow
42 GtkWidget *window;
43 gboolean scanning; /* State of the 'scanning' indicator */
44 char *path; /* pathname */
45 Collection *collection;
46 gboolean temp_item_selected;
47 gboolean show_hidden;
48 FilerFlags flags;
49 PanelType panel_type;
50 int (*sort_fn)(const void *a, const void *b);
51 DisplayStyle display_style;
53 Directory *directory;
55 gboolean had_cursor; /* (before changing directory) */
56 char *auto_select; /* If it we find while scanning */
58 GtkWidget *minibuffer;
59 int mini_cursor_base;
60 MiniType mini_type;
63 extern FilerWindow *window_with_focus;
64 extern GHashTable *child_to_filer;
65 extern gboolean o_unique_filer_windows;
67 /* Prototypes */
68 void filer_init();
69 FilerWindow *filer_opendir(char *path, PanelType panel_type);
70 void update_dir(FilerWindow *filer_window, gboolean warning);
71 int selected_item_number(Collection *collection);
72 DirItem *selected_item(Collection *collection);
73 void change_to_parent(FilerWindow *filer_window);
74 void filer_style_set(FilerWindow *filer_window, DisplayStyle style);
75 char *details(DirItem *item);
76 void filer_set_hidden(FilerWindow *filer_window, gboolean hidden);
77 int sort_by_name(const void *item1, const void *item2);
78 int sort_by_type(const void *item1, const void *item2);
79 int sort_by_date(const void *item1, const void *item2);
80 int sort_by_size(const void *item1, const void *item2);
81 void filer_set_sort_fn(FilerWindow *filer_window,
82 int (*fn)(const void *a, const void *b));
83 void full_refresh(void);
84 void filer_openitem(FilerWindow *filer_window, int item_number,
85 OpenFlags flags);
86 void filer_check_mounted(char *path);
87 void filer_change_to(FilerWindow *filer_window, char *path, char *from);
88 void filer_set_autoselect(FilerWindow *filer_window, guchar *leaf);
90 #endif /* _FILER_H */