r228: Added a nice list displaying the found files. Clicking opens a preview window
[rox-filer.git] / ROX-Filer / src / filer.h
blobe0e17f7e94807e0933a6127827af56bf325c6947
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>
16 #include "mount.h"
17 #include "dir.h"
19 typedef struct _FilerWindow FilerWindow;
20 typedef enum {PANEL_NO, PANEL_TOP, PANEL_BOTTOM} PanelType;
21 typedef enum {UNKNOWN_STYLE, LARGE_ICONS, SMALL_ICONS, FULL_INFO} DisplayStyle;
23 typedef enum
25 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
26 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
27 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
28 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
29 } OpenFlags;
31 typedef enum
33 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
34 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
35 } FilerFlags;
37 #include "type.h"
39 struct _FilerWindow
41 GtkWidget *window;
42 gboolean scanning; /* State of the 'scanning' indicator */
43 char *path; /* pathname */
44 Collection *collection;
45 gboolean temp_item_selected;
46 gboolean show_hidden;
47 FilerFlags flags;
48 PanelType panel_type;
49 int (*sort_fn)(const void *a, const void *b);
50 DisplayStyle display_style;
52 Directory *directory;
54 gboolean had_cursor; /* (before changing directory) */
55 char *auto_select; /* If it we find while scanning */
57 GtkWidget *minibuffer;
58 int mini_cursor_base;
61 extern FilerWindow *window_with_focus;
62 extern GHashTable *child_to_filer;
63 extern gboolean o_unique_filer_windows;
65 /* Prototypes */
66 void filer_init();
67 FilerWindow *filer_opendir(char *path, PanelType panel_type);
68 void update_dir(FilerWindow *filer_window, gboolean warning);
69 void scan_dir(FilerWindow *filer_window);
70 int selected_item_number(Collection *collection);
71 DirItem *selected_item(Collection *collection);
72 void change_to_parent(FilerWindow *filer_window);
73 void filer_style_set(FilerWindow *filer_window, DisplayStyle style);
74 char *details(DirItem *item);
75 void filer_set_hidden(FilerWindow *filer_window, gboolean hidden);
76 int sort_by_name(const void *item1, const void *item2);
77 int sort_by_type(const void *item1, const void *item2);
78 int sort_by_date(const void *item1, const void *item2);
79 int sort_by_size(const void *item1, const void *item2);
80 void filer_set_sort_fn(FilerWindow *filer_window,
81 int (*fn)(const void *a, const void *b));
82 void full_refresh(void);
83 void filer_openitem(FilerWindow *filer_window, int item_number,
84 OpenFlags flags);
85 void filer_check_mounted(char *path);
86 void filer_change_to(FilerWindow *filer_window, char *path, char *from);
87 void filer_set_autoselect(FilerWindow *filer_window, guchar *leaf);
89 #endif /* _FILER_H */