r173: Finished the minibuffer code. It's nice!
[rox-filer.git] / ROX-Filer / src / filer.h
blobede8dd969c0103f5ddd6edff343cdac85f11c912
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 extern GdkFont *fixed_font;
21 typedef struct _FilerWindow FilerWindow;
22 typedef enum {LEFT, RIGHT, TOP, BOTTOM} Side;
23 typedef enum {UNKNOWN_STYLE, LARGE_ICONS, SMALL_ICONS, FULL_INFO} DisplayStyle;
25 typedef enum
27 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
28 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
29 } FilerFlags;
31 #include "type.h"
33 struct _FilerWindow
35 GtkWidget *window;
36 char *path; /* pathname */
37 Collection *collection;
38 gboolean panel;
39 gboolean temp_item_selected;
40 gboolean show_hidden;
41 FilerFlags flags;
42 Side panel_side;
43 time_t m_time; /* m-time at last scan */
44 int (*sort_fn)(const void *a, const void *b);
45 DisplayStyle display_style;
47 Directory *directory;
49 gboolean had_cursor; /* (before changing directory) */
50 char *auto_select; /* If it we find while scanning */
52 GtkWidget *minibuffer;
53 int mini_cursor_base;
56 extern FilerWindow *window_with_focus;
57 extern GHashTable *child_to_filer;
59 /* Prototypes */
60 void filer_init();
61 void filer_opendir(char *path, gboolean panel, Side panel_side);
62 void update_dir(FilerWindow *filer_window, gboolean warning);
63 void scan_dir(FilerWindow *filer_window);
64 int selected_item_number(Collection *collection);
65 DirItem *selected_item(Collection *collection);
66 void change_to_parent(FilerWindow *filer_window);
67 void filer_style_set(FilerWindow *filer_window, DisplayStyle style);
68 char *details(DirItem *item);
69 void filer_set_hidden(FilerWindow *filer_window, gboolean hidden);
70 int sort_by_name(const void *item1, const void *item2);
71 int sort_by_type(const void *item1, const void *item2);
72 int sort_by_date(const void *item1, const void *item2);
73 int sort_by_size(const void *item1, const void *item2);
74 void filer_set_sort_fn(FilerWindow *filer_window,
75 int (*fn)(const void *a, const void *b));
76 void full_refresh(void);
77 void filer_openitem(FilerWindow *filer_window, int item_number,
78 gboolean shift, gboolean adjust);
79 void filer_check_mounted(char *path);
80 void filer_change_to(FilerWindow *filer_window, char *path, char *from);
82 #endif /* _FILER_H */