r496: Many internal changes to the Options system.
[rox-filer.git] / ROX-Filer / src / filer.h
blob7e0df984b3b27d94cda1d72d97eb7341a107d619
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@users.sourceforge.net>.
6 */
8 #ifndef _FILER_H
9 #define _FILER_H
11 #include <gtk/gtk.h>
12 #include "collection.h"
14 typedef enum
16 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
17 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
18 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
19 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
20 } OpenFlags;
22 typedef enum
24 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
25 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
26 } FilerFlags;
28 #include "mount.h"
29 #include "minibuffer.h"
30 #include "display.h"
32 typedef void (*TargetFunc)(FilerWindow *filer_window, int item, gpointer data);
34 struct _FilerWindow
36 GtkWidget *window;
37 gboolean scanning; /* State of the 'scanning' indicator */
38 guchar *path; /* pathname */
39 Collection *collection;
40 gboolean temp_item_selected;
41 gboolean show_hidden;
42 FilerFlags flags;
43 int (*sort_fn)(const void *a, const void *b);
45 DetailsType details_type;
46 DisplayStyle display_style;
48 Directory *directory;
50 gboolean had_cursor; /* (before changing directory) */
51 char *auto_select; /* If it we find while scanning */
53 GtkWidget *minibuffer_area; /* The hbox to show/hide */
54 GtkWidget *minibuffer_label; /* The operation name */
55 GtkWidget *minibuffer; /* The text entry */
56 int mini_cursor_base;
57 MiniType mini_type;
59 /* TRUE if hidden files are shown because the minibuffer leafname
60 * starts with a dot.
62 gboolean temp_show_hidden;
64 TargetFunc target_cb;
65 gpointer target_data;
67 GtkWidget *toolbar_frame;
68 GtkWidget *toolbar_text;
69 GtkWidget *scrollbar;
71 gint open_timeout; /* Will resize and show window... */
74 extern FilerWindow *window_with_focus;
75 extern GList *all_filer_windows;
76 extern GHashTable *child_to_filer;
77 extern gboolean o_unique_filer_windows;
79 /* Prototypes */
80 void filer_init(void);
81 FilerWindow *filer_opendir(char *path);
82 void filer_update_dir(FilerWindow *filer_window, gboolean warning);
83 void filer_update_all(void);
84 int selected_item_number(Collection *collection);
85 DirItem *selected_item(Collection *collection);
86 void change_to_parent(FilerWindow *filer_window);
87 void full_refresh(void);
88 void filer_openitem(FilerWindow *filer_window, int item_number,
89 OpenFlags flags);
90 void filer_check_mounted(char *path);
91 void filer_change_to(FilerWindow *filer_window, char *path, char *from);
92 gboolean filer_exists(FilerWindow *filer_window);
93 void filer_open_parent(FilerWindow *filer_window);
94 void filer_detach_rescan(FilerWindow *filer_window);
95 void filer_target_mode(FilerWindow *filer_window,
96 TargetFunc fn,
97 gpointer data,
98 char *reason);
99 void filer_window_autosize(FilerWindow *filer_window);
101 #endif /* _FILER_H */