r2219: Removed warning message from --new. It can be useful for a session manager...
[rox-filer.git] / ROX-Filer / src / filer.h
blob119ab55920b2555e4b39052ec279d83364576530
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 enum
36 VIEW_TYPE_COLLECTION, /* Icons view */
37 VIEW_TYPE_DETAILS /* TreeView details list */
38 } ViewType;
40 /* iter's next method has just returned the clicked item... */
41 typedef void (*TargetFunc)(FilerWindow *filer_window,
42 ViewIter *iter,
43 gpointer data);
45 struct _FilerWindow
47 GtkWidget *window;
48 GtkBox *toplevel_vbox;
49 gboolean scanning; /* State of the 'scanning' indicator */
50 gchar *sym_path; /* Path the user sees */
51 gchar *real_path; /* realpath(sym_path) */
52 ViewIface *view;
53 ViewType view_type;
54 gboolean temp_item_selected;
55 gboolean show_hidden;
56 FilerFlags flags;
57 int (*sort_fn)(const void *a, const void *b);
59 DetailsType details_type;
60 DisplayStyle display_style;
62 Directory *directory;
64 gboolean had_cursor; /* (before changing directory) */
65 char *auto_select; /* If it we find while scanning */
67 GtkWidget *message; /* The 'Running as ...' message */
69 GtkWidget *minibuffer_area; /* The hbox to show/hide */
70 GtkWidget *minibuffer_label; /* The operation name */
71 GtkWidget *minibuffer; /* The text entry */
72 int mini_cursor_base; /* XXX */
73 MiniType mini_type;
75 /* TRUE if hidden files are shown because the minibuffer leafname
76 * starts with a dot.
78 gboolean temp_show_hidden;
80 TargetFunc target_cb;
81 gpointer target_data;
83 GtkWidget *toolbar;
84 GtkWidget *toolbar_text;
85 GtkWidget *scrollbar;
87 gint open_timeout; /* Will resize and show window... */
89 GtkStateType selection_state; /* for drawing selection */
91 gboolean show_thumbs;
92 GList *thumb_queue; /* paths to thumbnail */
93 GtkWidget *thumb_bar, *thumb_progress;
94 int max_thumbs; /* total for this batch */
97 extern FilerWindow *window_with_focus;
98 extern GList *all_filer_windows;
99 extern GHashTable *child_to_filer;
100 extern Option o_filer_auto_resize, o_unique_filer_windows;
101 extern Option o_filer_size_limit;
103 /* Prototypes */
104 void filer_init(void);
105 FilerWindow *filer_opendir(const char *path, FilerWindow *src_win, const gchar *wm_class);
106 void filer_update_dir(FilerWindow *filer_window, gboolean warning);
107 void filer_update_all(void);
108 DirItem *filer_selected_item(FilerWindow *filer_window);
109 void change_to_parent(FilerWindow *filer_window);
110 void full_refresh(void);
111 void filer_openitem(FilerWindow *filer_window, ViewIter *iter, OpenFlags flags);
112 void filer_check_mounted(const char *real_path);
113 void filer_close_recursive(const char *path);
114 void filer_change_to(FilerWindow *filer_window,
115 const char *path, const char *from);
116 gboolean filer_exists(FilerWindow *filer_window);
117 void filer_open_parent(FilerWindow *filer_window);
118 void filer_detach_rescan(FilerWindow *filer_window);
119 void filer_target_mode(FilerWindow *filer_window,
120 TargetFunc fn,
121 gpointer data,
122 const char *reason);
123 void filer_window_autosize(FilerWindow *filer_window);
124 GList *filer_selected_items(FilerWindow *filer_window);
125 void filer_create_thumb(FilerWindow *filer_window, const gchar *pathname);
126 void filer_cancel_thumbnails(FilerWindow *filer_window);
127 void filer_set_title(FilerWindow *filer_window);
128 void filer_create_thumbs(FilerWindow *filer_window);
129 void filer_add_tip_details(FilerWindow *filer_window,
130 GString *tip, DirItem *item);
131 void filer_selection_changed(FilerWindow *filer_window, gint time);
132 void filer_lost_selection(FilerWindow *filer_window, guint time);
133 void filer_window_set_size(FilerWindow *filer_window, int w, int h);
134 gboolean filer_window_delete(GtkWidget *window,
135 GdkEvent *unused,
136 FilerWindow *filer_window);
137 void filer_set_view_type(FilerWindow *filer_window, ViewType type);
138 void filer_window_toggle_cursor_item_selected(FilerWindow *filer_window);
140 #endif /* _FILER_H */