r1447: Middle button clicks on the pinboard are passed to the window manager.
[rox-filer.git] / ROX-Filer / src / filer.h
blob0755b3d76855bae9c724d78a7ed4f102913b107a
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 *sym_path; /* Path the user sees */
41 gchar *real_path; /* realpath(sym_path) */
42 Collection *collection;
43 gboolean temp_item_selected;
44 gboolean show_hidden;
45 FilerFlags flags;
46 int (*sort_fn)(const void *a, const void *b);
48 DetailsType details_type;
49 DisplayStyle display_style;
51 Directory *directory;
53 gboolean had_cursor; /* (before changing directory) */
54 char *auto_select; /* If it we find while scanning */
56 GtkWidget *message; /* The 'Running as ...' message */
58 GtkWidget *minibuffer_area; /* The hbox to show/hide */
59 GtkWidget *minibuffer_label; /* The operation name */
60 GtkWidget *minibuffer; /* The text entry */
61 int mini_cursor_base;
62 MiniType mini_type;
64 /* TRUE if hidden files are shown because the minibuffer leafname
65 * starts with a dot.
67 gboolean temp_show_hidden;
69 TargetFunc target_cb;
70 gpointer target_data;
72 GtkWidget *toolbar_frame;
73 GtkWidget *toolbar_text;
74 GtkWidget *scrollbar;
76 gint open_timeout; /* Will resize and show window... */
78 GtkStateType selection_state; /* for drawing selection */
80 gboolean show_thumbs;
81 GList *thumb_queue; /* paths to thumbnail */
82 GtkWidget *thumb_bar, *thumb_progress;
83 int max_thumbs; /* total for this batch */
86 extern FilerWindow *window_with_focus;
87 extern GList *all_filer_windows;
88 extern GHashTable *child_to_filer;
89 extern Option o_filer_auto_resize, o_unique_filer_windows;
91 /* Prototypes */
92 void filer_init(void);
93 FilerWindow *filer_opendir(const char *path, FilerWindow *src_win);
94 void filer_update_dir(FilerWindow *filer_window, gboolean warning);
95 void filer_update_all(void);
96 int selected_item_number(Collection *collection);
97 DirItem *selected_item(Collection *collection);
98 void change_to_parent(FilerWindow *filer_window);
99 void full_refresh(void);
100 void filer_openitem(FilerWindow *filer_window, int item_number,
101 OpenFlags flags);
102 void filer_check_mounted(const char *real_path);
103 void filer_close_recursive(const char *path);
104 void filer_change_to(FilerWindow *filer_window,
105 const char *path, const char *from);
106 gboolean filer_exists(FilerWindow *filer_window);
107 void filer_open_parent(FilerWindow *filer_window);
108 void filer_detach_rescan(FilerWindow *filer_window);
109 void filer_target_mode(FilerWindow *filer_window,
110 TargetFunc fn,
111 gpointer data,
112 const char *reason);
113 void filer_window_autosize(FilerWindow *filer_window, gboolean allow_shrink);
114 GList *filer_selected_items(FilerWindow *filer_window);
115 void filer_create_thumb(FilerWindow *filer_window, const gchar *pathname);
116 void filer_cancel_thumbnails(FilerWindow *filer_window);
117 void filer_set_title(FilerWindow *filer_window);
118 void filer_create_thumbs(FilerWindow *filer_window);
120 #endif /* _FILER_H */