r898: Applied Bernard Jungen's latest patch:
[rox-filer.git] / ROX-Filer / src / filer.h
blob390156576b5f8980720788ab50602ea39cb97bd5
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 enum {
15 RESIZE_STYLE = 0,
16 RESIZE_ALWAYS = 1,
17 RESIZE_NEVER = 2,
20 typedef enum
22 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
23 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
24 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
25 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
26 } OpenFlags;
28 typedef enum
30 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
31 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
32 } FilerFlags;
34 #include "mount.h"
35 #include "minibuffer.h"
36 #include "display.h"
38 typedef void (*TargetFunc)(FilerWindow *filer_window, int item, gpointer data);
40 struct _FilerWindow
42 GtkWidget *window;
43 gboolean scanning; /* State of the 'scanning' indicator */
44 guchar *path; /* pathname */
45 Collection *collection;
46 gboolean temp_item_selected;
47 gboolean show_hidden;
48 FilerFlags flags;
49 int (*sort_fn)(const void *a, const void *b);
51 DetailsType details_type;
52 DisplayStyle display_style;
54 Directory *directory;
56 gboolean had_cursor; /* (before changing directory) */
57 char *auto_select; /* If it we find while scanning */
59 GtkWidget *minibuffer_area; /* The hbox to show/hide */
60 GtkWidget *minibuffer_label; /* The operation name */
61 GtkWidget *minibuffer; /* The text entry */
62 int mini_cursor_base;
63 MiniType mini_type;
65 /* TRUE if hidden files are shown because the minibuffer leafname
66 * starts with a dot.
68 gboolean temp_show_hidden;
70 TargetFunc target_cb;
71 gpointer target_data;
73 GtkWidget *toolbar_frame;
74 GtkWidget *toolbar_text;
75 GtkWidget *scrollbar;
77 gint open_timeout; /* Will resize and show window... */
80 extern FilerWindow *window_with_focus;
81 extern GList *all_filer_windows;
82 extern GHashTable *child_to_filer;
83 extern gboolean o_unique_filer_windows;
85 /* Prototypes */
86 void filer_init(void);
87 FilerWindow *filer_opendir(char *path, FilerWindow *src_win);
88 void filer_update_dir(FilerWindow *filer_window, gboolean warning);
89 void filer_update_all(void);
90 int selected_item_number(Collection *collection);
91 DirItem *selected_item(Collection *collection);
92 void change_to_parent(FilerWindow *filer_window);
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_close_recursive(char *path);
98 void filer_change_to(FilerWindow *filer_window, char *path, char *from);
99 gboolean filer_exists(FilerWindow *filer_window);
100 void filer_open_parent(FilerWindow *filer_window);
101 void filer_detach_rescan(FilerWindow *filer_window);
102 void filer_target_mode(FilerWindow *filer_window,
103 TargetFunc fn,
104 gpointer data,
105 char *reason);
106 void filer_window_autosize(FilerWindow *filer_window, gboolean allow_shrink);
107 GList *filer_selected_items(FilerWindow *filer_window);
109 #endif /* _FILER_H */