r301: Added a new display style, 'Small, Full Info'.
[rox-filer.git] / ROX-Filer / src / filer.h
blob0a3e1a48e26ba364ab1438ea6d2535ef689f0e65
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;
20 typedef enum {
21 UNKNOWN_STYLE,
22 LARGE_ICONS,
23 SMALL_ICONS,
24 LARGE_FULL_INFO,
25 SMALL_FULL_INFO,
26 } DisplayStyle;
28 typedef enum
30 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
31 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
32 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
33 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
34 } OpenFlags;
36 typedef enum
38 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
39 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
40 } FilerFlags;
42 #include "mount.h"
43 #include "minibuffer.h"
44 #include "dir.h"
45 #include "type.h"
47 struct _FilerWindow
49 GtkWidget *window;
50 gboolean scanning; /* State of the 'scanning' indicator */
51 char *path; /* pathname */
52 Collection *collection;
53 gboolean temp_item_selected;
54 gboolean show_hidden;
55 FilerFlags flags;
56 PanelType panel_type;
57 int (*sort_fn)(const void *a, const void *b);
59 DisplayStyle display_style;
61 Directory *directory;
63 gboolean had_cursor; /* (before changing directory) */
64 char *auto_select; /* If it we find while scanning */
66 GtkWidget *minibuffer_area; /* The hbox to show/hide */
67 GtkWidget *minibuffer_label; /* The operation name */
68 GtkWidget *minibuffer; /* The text entry */
69 int mini_cursor_base;
70 MiniType mini_type;
73 extern FilerWindow *window_with_focus;
74 extern GHashTable *child_to_filer;
75 extern gboolean o_unique_filer_windows;
77 /* Prototypes */
78 void filer_init();
79 FilerWindow *filer_opendir(char *path, PanelType panel_type);
80 void filer_update_dir(FilerWindow *filer_window, gboolean warning);
81 int selected_item_number(Collection *collection);
82 DirItem *selected_item(Collection *collection);
83 void change_to_parent(FilerWindow *filer_window);
84 void filer_style_set(FilerWindow *filer_window, DisplayStyle style);
85 char *details(DirItem *item);
86 void filer_set_hidden(FilerWindow *filer_window, gboolean hidden);
87 int sort_by_name(const void *item1, const void *item2);
88 int sort_by_type(const void *item1, const void *item2);
89 int sort_by_date(const void *item1, const void *item2);
90 int sort_by_size(const void *item1, const void *item2);
91 void filer_set_sort_fn(FilerWindow *filer_window,
92 int (*fn)(const void *a, const void *b));
93 void full_refresh(void);
94 void filer_openitem(FilerWindow *filer_window, int item_number,
95 OpenFlags flags);
96 void filer_check_mounted(char *path);
97 void filer_change_to(FilerWindow *filer_window, char *path, char *from);
98 void filer_set_autoselect(FilerWindow *filer_window, guchar *leaf);
99 gboolean filer_exists(FilerWindow *filer_window);
100 void filer_open_parent(FilerWindow *filer_window);
102 #endif /* _FILER_H */