r1283: Added a whole load of 'const' modifiers so we can do extra checking...
[rox-filer.git] / ROX-Filer / src / filer.h
blob5543e7b60970535794882d93231efb91d002175f
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>
13 enum {
14 RESIZE_STYLE = 0,
15 RESIZE_ALWAYS = 1,
16 RESIZE_NEVER = 2,
19 typedef enum
21 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
22 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
23 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
24 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
25 } OpenFlags;
27 typedef enum
29 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
30 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
31 FILER_CREATE_THUMBS = 0x04, /* Create thumbs when scan ends */
32 } FilerFlags;
34 typedef void (*TargetFunc)(FilerWindow *filer_window, int item, gpointer data);
36 struct _FilerWindow
38 GtkWidget *window;
39 gboolean scanning; /* State of the 'scanning' indicator */
40 gchar *path; /* pathname */
41 Collection *collection;
42 gboolean temp_item_selected;
43 gboolean show_hidden;
44 FilerFlags flags;
45 int (*sort_fn)(const void *a, const void *b);
47 DetailsType details_type;
48 DisplayStyle display_style;
50 Directory *directory;
52 gboolean had_cursor; /* (before changing directory) */
53 char *auto_select; /* If it we find while scanning */
55 GtkWidget *message; /* The 'Running as ...' message */
57 GtkWidget *minibuffer_area; /* The hbox to show/hide */
58 GtkWidget *minibuffer_label; /* The operation name */
59 GtkWidget *minibuffer; /* The text entry */
60 int mini_cursor_base;
61 MiniType mini_type;
63 /* TRUE if hidden files are shown because the minibuffer leafname
64 * starts with a dot.
66 gboolean temp_show_hidden;
68 TargetFunc target_cb;
69 gpointer target_data;
71 GtkWidget *toolbar_frame;
72 GtkWidget *toolbar_text;
73 GtkWidget *scrollbar;
75 gint open_timeout; /* Will resize and show window... */
77 GtkStateType selection_state; /* for drawing selection */
79 gboolean show_thumbs;
80 GList *thumb_queue; /* paths to thumbnail */
81 GtkWidget *thumb_bar, *thumb_progress;
82 int max_thumbs; /* total for this batch */
85 extern FilerWindow *window_with_focus;
86 extern GList *all_filer_windows;
87 extern GHashTable *child_to_filer;
88 extern Option o_filer_auto_resize, o_unique_filer_windows;
90 /* Prototypes */
91 void filer_init(void);
92 FilerWindow *filer_opendir(const char *path, FilerWindow *src_win);
93 void filer_update_dir(FilerWindow *filer_window, gboolean warning);
94 void filer_update_all(void);
95 int selected_item_number(Collection *collection);
96 DirItem *selected_item(Collection *collection);
97 void change_to_parent(FilerWindow *filer_window);
98 void full_refresh(void);
99 void filer_openitem(FilerWindow *filer_window, int item_number,
100 OpenFlags flags);
101 void filer_check_mounted(const char *path);
102 void filer_close_recursive(const char *path);
103 void filer_change_to(FilerWindow *filer_window,
104 const char *path, const char *from);
105 gboolean filer_exists(FilerWindow *filer_window);
106 void filer_open_parent(FilerWindow *filer_window);
107 void filer_detach_rescan(FilerWindow *filer_window);
108 void filer_target_mode(FilerWindow *filer_window,
109 TargetFunc fn,
110 gpointer data,
111 const char *reason);
112 void filer_window_autosize(FilerWindow *filer_window, gboolean allow_shrink);
113 GList *filer_selected_items(FilerWindow *filer_window);
114 void filer_create_thumb(FilerWindow *filer_window, const gchar *pathname);
115 void filer_cancel_thumbnails(FilerWindow *filer_window);
116 void filer_set_title(FilerWindow *filer_window);
117 void filer_create_thumbs(FilerWindow *filer_window);
119 #endif /* _FILER_H */