r2918: Doing a Refresh in a directory under /uri/0install triggers a remote refresh.
[rox-filer.git] / ROX-Filer / src / filer.h
blob940f286fc79f20f710acaa91fc2763fc866071a1
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 #ifndef _FILER_H
7 #define _FILER_H
9 #include <gtk/gtk.h>
11 enum {
12 RESIZE_STYLE = 0,
13 RESIZE_ALWAYS = 1,
14 RESIZE_NEVER = 2,
17 typedef enum
19 OPEN_SHIFT = 0x01, /* Do ShiftOpen */
20 OPEN_SAME_WINDOW = 0x02, /* Directories open in same window */
21 OPEN_CLOSE_WINDOW = 0x04, /* Opening files closes the window */
22 OPEN_FROM_MINI = 0x08, /* Non-dir => close minibuffer */
23 } OpenFlags;
25 typedef enum
27 FILER_NEEDS_RESCAN = 0x01, /* Call may_rescan after scanning */
28 FILER_UPDATING = 0x02, /* (scanning) items may already exist */
29 FILER_CREATE_THUMBS = 0x04, /* Create thumbs when scan ends */
30 } FilerFlags;
32 /* Numbers used in options */
33 typedef enum
35 VIEW_TYPE_COLLECTION = 0, /* Icons view */
36 VIEW_TYPE_DETAILS = 1 /* TreeView details list */
37 } ViewType;
39 /* iter's next method has just returned the clicked item... */
40 typedef void (*TargetFunc)(FilerWindow *filer_window,
41 ViewIter *iter,
42 gpointer data);
44 struct _FilerWindow
46 GtkWidget *window;
47 GtkBox *toplevel_vbox, *view_hbox;
48 gboolean scanning; /* State of the 'scanning' indicator */
49 gchar *sym_path; /* Path the user sees */
50 gchar *real_path; /* realpath(sym_path) */
51 ViewIface *view;
52 ViewType view_type;
53 gboolean temp_item_selected;
54 gboolean show_hidden;
55 FilerFlags flags;
56 SortType sort_type;
57 GtkSortType sort_order;
59 DetailsType details_type;
60 DisplayStyle display_style;
61 DisplayStyle display_style_wanted;
63 Directory *directory;
65 gboolean had_cursor; /* (before changing directory) */
66 char *auto_select; /* If it we find while scanning */
68 GtkWidget *message; /* The 'Running as ...' message */
70 GtkWidget *minibuffer_area; /* The hbox to show/hide */
71 GtkWidget *minibuffer_label; /* The operation name */
72 GtkWidget *minibuffer; /* The text entry */
73 int mini_cursor_base; /* XXX */
74 MiniType mini_type;
76 /* TRUE if hidden files are shown because the minibuffer leafname
77 * starts with a dot.
79 gboolean temp_show_hidden;
81 TargetFunc target_cb;
82 gpointer target_data;
84 GtkWidget *toolbar;
85 GtkWidget *toolbar_text;
86 GtkWidget *scrollbar;
88 gint open_timeout; /* Will resize and show window... */
90 GtkStateType selection_state; /* for drawing selection */
92 gboolean show_thumbs;
93 GList *thumb_queue; /* paths to thumbnail */
94 GtkWidget *thumb_bar, *thumb_progress;
95 int max_thumbs; /* total for this batch */
97 gint auto_scroll; /* Timer */
100 extern FilerWindow *window_with_focus;
101 extern GList *all_filer_windows;
102 extern GHashTable *child_to_filer;
103 extern Option o_filer_auto_resize, o_unique_filer_windows;
104 extern Option o_filer_size_limit;
106 /* Prototypes */
107 void filer_init(void);
108 FilerWindow *filer_opendir(const char *path, FilerWindow *src_win, const gchar *wm_class);
109 gboolean filer_update_dir(FilerWindow *filer_window, gboolean warning);
110 void filer_update_all(void);
111 DirItem *filer_selected_item(FilerWindow *filer_window);
112 void change_to_parent(FilerWindow *filer_window);
113 void full_refresh(void);
114 void filer_openitem(FilerWindow *filer_window, ViewIter *iter, OpenFlags flags);
115 void filer_check_mounted(const char *real_path);
116 void filer_close_recursive(const char *path);
117 void filer_change_to(FilerWindow *filer_window,
118 const char *path, const char *from);
119 gboolean filer_exists(FilerWindow *filer_window);
120 void filer_open_parent(FilerWindow *filer_window);
121 void filer_detach_rescan(FilerWindow *filer_window);
122 void filer_target_mode(FilerWindow *filer_window,
123 TargetFunc fn,
124 gpointer data,
125 const char *reason);
126 void filer_window_autosize(FilerWindow *filer_window);
127 GList *filer_selected_items(FilerWindow *filer_window);
128 void filer_create_thumb(FilerWindow *filer_window, const gchar *pathname);
129 void filer_cancel_thumbnails(FilerWindow *filer_window);
130 void filer_set_title(FilerWindow *filer_window);
131 void filer_create_thumbs(FilerWindow *filer_window);
132 void filer_add_tip_details(FilerWindow *filer_window,
133 GString *tip, DirItem *item);
134 void filer_selection_changed(FilerWindow *filer_window, gint time);
135 void filer_lost_selection(FilerWindow *filer_window, guint time);
136 void filer_window_set_size(FilerWindow *filer_window, int w, int h);
137 gboolean filer_window_delete(GtkWidget *window,
138 GdkEvent *unused,
139 FilerWindow *filer_window);
140 void filer_set_view_type(FilerWindow *filer_window, ViewType type);
141 void filer_window_toggle_cursor_item_selected(FilerWindow *filer_window);
142 void filer_perform_action(FilerWindow *filer_window, GdkEventButton *event);
143 gint filer_motion_notify(FilerWindow *filer_window, GdkEventMotion *event);
144 gint filer_key_press_event(GtkWidget *widget, GdkEventKey *event,
145 FilerWindow *filer_window);
146 void filer_set_autoscroll(FilerWindow *filer_window, gboolean auto_scroll);
147 void filer_refresh(FilerWindow *filer_window);
149 #endif /* _FILER_H */