Mercurial > geeqie
comparison src/gqview.h @ 9:d907d608745f
Sync to GQview 1.5.9 release.
########
DO NOT BASE ENHANCEMENTS OR TRANSLATION UPDATES ON CODE IN THIS CVS!
This CVS is never up to date with current development and is provided
solely for reference purposes, please use the latest official release
package when making any changes or translation updates.
########
author | gqview |
---|---|
date | Sat, 26 Feb 2005 00:13:35 +0000 |
parents | e149abcda4eb |
children | 25335c62cd9b |
comparison
equal
deleted
inserted
replaced
8:e0d0593d519e | 9:d907d608745f |
---|---|
1 /* | 1 /* |
2 * GQview image viewer | 2 * GQview |
3 * (C)2000 John Ellis | 3 * (C) 2004 John Ellis |
4 * | 4 * |
5 * Author: John Ellis | 5 * Author: John Ellis |
6 * | 6 * |
7 */ | 7 * This software is released under the GNU General Public License (GNU GPL). |
8 * Please read the included file COPYING for more information. | |
9 * This software comes with no warranty of any kind, use at your own risk! | |
10 */ | |
11 | |
12 | |
13 #ifndef GQVIEW_H | |
14 #define GQVIEW_H | |
8 | 15 |
9 #ifdef HAVE_CONFIG_H | 16 #ifdef HAVE_CONFIG_H |
10 # include "config.h" | 17 # include "config.h" |
18 #endif | |
19 | |
20 #ifdef HAVE_STRVERSCMP | |
21 # define _GNU_SOURCE | |
11 #endif | 22 #endif |
12 | 23 |
13 #include "intl.h" | 24 #include "intl.h" |
14 | 25 |
15 /* | 26 /* |
23 #include <stdlib.h> | 34 #include <stdlib.h> |
24 #include <string.h> | 35 #include <string.h> |
25 #include <time.h> | 36 #include <time.h> |
26 #include <unistd.h> | 37 #include <unistd.h> |
27 #include <sys/stat.h> | 38 #include <sys/stat.h> |
39 #include <sys/time.h> | |
40 #include <sys/types.h> | |
28 #include <dirent.h> | 41 #include <dirent.h> |
29 | 42 #include <fcntl.h> |
30 /* | 43 |
31 *------------------------------------- | 44 /* |
32 * includes for glib / gtk / imlib | 45 *------------------------------------- |
46 * includes for glib / gtk / gdk-pixbuf | |
33 *------------------------------------- | 47 *------------------------------------- |
34 */ | 48 */ |
35 | 49 |
36 #include <gdk/gdk.h> | 50 #include <gdk/gdk.h> |
37 #include <gtk/gtk.h> | 51 #include <gtk/gtk.h> |
38 #include <gdk_imlib.h> | 52 |
53 #include <gdk-pixbuf/gdk-pixbuf.h> | |
54 #include <gdk-pixbuf/gdk-pixbuf-loader.h> | |
55 | |
56 #include "typedefs.h" | |
39 | 57 |
40 /* | 58 /* |
41 *---------------------------------------------------------------------------- | 59 *---------------------------------------------------------------------------- |
42 * defines | 60 * defines |
43 *---------------------------------------------------------------------------- | 61 *---------------------------------------------------------------------------- |
44 */ | 62 */ |
45 | 63 |
46 #define RC_FILE_NAME ".gqviewrc" | 64 #define GQVIEW_RC_DIR ".gqview" |
47 #define RC_THUMB_DIR ".gqview_thmb" | 65 #define GQVIEW_RC_DIR_COLLECTIONS GQVIEW_RC_DIR"/collections" |
66 #define GQVIEW_RC_DIR_TRASH GQVIEW_RC_DIR"/trash" | |
67 | |
68 #define RC_FILE_NAME "gqviewrc" | |
48 | 69 |
49 #define ZOOM_RESET_ORIGINAL 0 | 70 #define ZOOM_RESET_ORIGINAL 0 |
50 #define ZOOM_RESET_FIT_WINDOW 1 | 71 #define ZOOM_RESET_FIT_WINDOW 1 |
51 #define ZOOM_RESET_NONE 2 | 72 #define ZOOM_RESET_NONE 2 |
52 | 73 |
74 #define SCROLL_RESET_TOPLEFT 0 | |
75 #define SCROLL_RESET_CENTER 1 | |
76 #define SCROLL_RESET_NOCHANGE 2 | |
77 | |
53 #define MOUSEWHEEL_SCROLL_SIZE 20 | 78 #define MOUSEWHEEL_SCROLL_SIZE 20 |
54 | 79 |
55 typedef struct _ImageWindow ImageWindow; | 80 #define GQVIEW_EDITOR_SLOTS 10 |
56 struct _ImageWindow | 81 |
57 { | 82 /* |
58 GtkWidget *eventbox; | 83 *---------------------------------------------------------------------------- |
59 GtkWidget *table; | 84 * globals |
60 GtkWidget *viewport; | 85 *---------------------------------------------------------------------------- |
61 GtkWidget *image; | 86 */ |
62 | 87 |
63 gchar *image_path; | 88 /* |
64 gchar *image_name; | 89 * Since globals are used everywhere, |
65 | 90 * it is easier to define them here. |
66 gint width; | 91 */ |
67 gint height; | |
68 gint size; | |
69 | |
70 gint old_width; | |
71 gint old_height; | |
72 | |
73 gint unknown; | |
74 gint zoom; | |
75 | |
76 GdkPixmap *image_pixmap; | |
77 GdkImlibImage *image_data; | |
78 | |
79 gint in_drag; | |
80 gint drag_last_x; | |
81 gint drag_last_y; | |
82 gint drag_moved; | |
83 | |
84 gint artificial_size; | |
85 gint new_img; | |
86 | |
87 /* info, zoom labels & windows */ | |
88 | |
89 GtkWidget *top_window; /* window that gets title set to image filename */ | |
90 GtkWidget *info_label; /* label set to show image h x w , size */ | |
91 GtkWidget *zoom_label; /* label to display zoom */ | |
92 gchar *title; /* window title to display left of file name */ | |
93 gint show_title_zoom; /* option to include zoom in window title */ | |
94 | |
95 /* button functions */ | |
96 void (*func_btn1)(ImageWindow *, GdkEventButton *, gpointer); | |
97 void (*func_btn2)(ImageWindow *, GdkEventButton *, gpointer); | |
98 void (*func_btn3)(ImageWindow *, GdkEventButton *, gpointer); | |
99 void (*func_btn4)(ImageWindow *, GdkEventButton *, gpointer); | |
100 void (*func_btn5)(ImageWindow *, GdkEventButton *, gpointer); | |
101 | |
102 gpointer data_btn1; | |
103 gpointer data_btn2; | |
104 gpointer data_btn3; | |
105 gpointer data_btn4; | |
106 gpointer data_btn5; | |
107 }; | |
108 | |
109 /* image */ | |
110 extern ImageWindow *main_image; | |
111 | |
112 /* main window */ | |
113 extern GtkWidget *mainwindow; | |
114 extern GtkWidget *mainwindow_hbox; | |
115 extern GtkWidget *mainwindow_vbox; | |
116 extern GtkAccelGroup *mainwindow_accel_grp; | |
117 | |
118 extern GtkWidget *info_box; | |
119 extern GtkWidget *info_progress_bar; | |
120 extern GtkWidget *info_status; | |
121 extern GtkWidget *info_details; | |
122 extern GtkWidget *info_zoom; | |
123 | |
124 /* full screen */ | |
125 extern ImageWindow *normal_image; | |
126 extern ImageWindow *full_screen_image; | |
127 extern GtkWidget *full_screen_window; | |
128 | |
129 /* tools floating window */ | |
130 extern GtkWidget *toolwindow; | |
131 | |
132 /* tools */ | |
133 extern GtkWidget *tool_vbox; | |
134 | |
135 extern GtkWidget *path_entry; | |
136 extern GtkWidget *history_menu; | |
137 | |
138 extern GtkWidget *dir_clist; | |
139 extern GtkWidget *file_clist; | |
140 | |
141 extern GtkWidget *menu_file; | |
142 extern GtkWidget *menu_edit; | |
143 extern GtkWidget *menu_view; | |
144 extern GtkWidget *menu_help; | |
145 extern GtkWidget *menu_file_popup; | |
146 extern GtkWidget *menu_filelist_edit; | |
147 extern GtkWidget *menu_image_popup; | |
148 extern GtkWidget *menu_image_edit; | |
149 extern GtkWidget *menu_window_full; | |
150 extern GtkWidget *menu_window_full_edit; | |
151 extern GtkWidget *menu_window_view; | |
152 extern GtkWidget *menu_window_view_edit; | |
153 | |
154 extern GtkWidget *thumb_button; | |
155 extern GtkWidget *thumb_menu_item; | |
156 | |
157 /* lists */ | |
158 extern GList *dir_list; | |
159 extern GList *file_list; | |
160 extern gchar *current_path; | |
161 | 92 |
162 extern GList *filename_filter; | 93 extern GList *filename_filter; |
163 | 94 |
164 /* -- options -- */ | 95 /* -- options -- */ |
165 extern gint main_window_w; | 96 extern gint main_window_w; |
166 extern gint main_window_h; | 97 extern gint main_window_h; |
167 extern gint main_window_x; | 98 extern gint main_window_x; |
168 extern gint main_window_y; | 99 extern gint main_window_y; |
100 extern gint main_window_maximized; | |
169 | 101 |
170 extern gint float_window_w; | 102 extern gint float_window_w; |
171 extern gint float_window_h; | 103 extern gint float_window_h; |
172 extern gint float_window_x; | 104 extern gint float_window_x; |
173 extern gint float_window_y; | 105 extern gint float_window_y; |
106 extern gint float_window_divider; | |
107 | |
108 extern gint window_hdivider_pos; | |
109 extern gint window_vdivider_pos; | |
174 | 110 |
175 extern gint save_window_positions; | 111 extern gint save_window_positions; |
176 extern gint tools_float; | 112 extern gint tools_float; |
177 extern gint tools_hidden; | 113 extern gint tools_hidden; |
114 extern gint toolbar_hidden; | |
178 extern gint progressive_key_scrolling; | 115 extern gint progressive_key_scrolling; |
179 | 116 |
180 extern gint startup_path_enable; | 117 extern gint startup_path_enable; |
181 extern gchar *startup_path; | 118 extern gchar *startup_path; |
182 extern gint confirm_delete; | 119 extern gint confirm_delete; |
120 extern gint enable_delete_key; | |
121 extern gint safe_delete_enable; | |
122 extern gchar *safe_delete_path; | |
123 extern gint safe_delete_size; | |
183 extern gint restore_tool; | 124 extern gint restore_tool; |
184 extern gint zoom_mode; | 125 extern gint zoom_mode; |
126 extern gint two_pass_zoom; | |
127 extern gint scroll_reset_method; | |
185 extern gint fit_window; | 128 extern gint fit_window; |
186 extern gint limit_window_size; | 129 extern gint limit_window_size; |
130 extern gint zoom_to_fit_expands; | |
187 extern gint max_window_size; | 131 extern gint max_window_size; |
188 extern gint thumb_max_width; | 132 extern gint thumb_max_width; |
189 extern gint thumb_max_height; | 133 extern gint thumb_max_height; |
190 extern gint enable_thumb_caching; | 134 extern gint enable_thumb_caching; |
135 extern gint enable_thumb_dirs; | |
191 extern gint use_xvpics_thumbnails; | 136 extern gint use_xvpics_thumbnails; |
137 extern gint thumbnail_spec_standard; | |
138 extern gint enable_metadata_dirs; | |
192 extern gint show_dot_files; | 139 extern gint show_dot_files; |
193 extern gint file_filter_disable; | 140 extern gint file_filter_disable; |
194 extern gint filter_include_jpg; | |
195 extern gint filter_include_xpm; | |
196 extern gint filter_include_tif; | |
197 extern gint filter_include_gif; | |
198 extern gint filter_include_png; | |
199 extern gint filter_include_ppm; | |
200 extern gint filter_include_pgm; | |
201 extern gint filter_include_pcx; | |
202 extern gint filter_include_bmp; | |
203 extern gchar *custom_filter; | |
204 extern gchar *editor_name[]; | 141 extern gchar *editor_name[]; |
205 extern gchar *editor_command[]; | 142 extern gchar *editor_command[]; |
206 | 143 |
207 extern gint thumbnails_enabled; | 144 extern gint thumbnails_enabled; |
208 | 145 extern SortType file_sort_method; |
209 extern gint slideshow_delay; /* in seconds */ | 146 extern gint file_sort_ascending; |
147 | |
148 extern gint slideshow_delay; /* in tenths of a second */ | |
210 extern gint slideshow_random; | 149 extern gint slideshow_random; |
211 extern gint slideshow_repeat; | 150 extern gint slideshow_repeat; |
212 | 151 |
213 extern gint mousewheel_scrolls; | 152 extern gint mousewheel_scrolls; |
153 extern gint enable_in_place_rename; | |
154 | |
155 extern gint black_window_background; | |
156 | |
157 extern gint fullscreen_screen; | |
158 extern gint fullscreen_clean_flip; | |
159 extern gint fullscreen_disable_saver; | |
160 extern gint fullscreen_above; | |
161 | |
162 extern gint dupe_custom_threshold; | |
214 | 163 |
215 extern gint debug; | 164 extern gint debug; |
216 | 165 |
217 /* logo & misc images */ | 166 extern gint recent_list_max; |
218 extern const int logo_width; | 167 |
219 extern const int logo_height; | 168 extern gint collection_rectangular_selection; |
220 extern const unsigned char logo[]; | 169 |
221 | 170 extern gint tile_cache_max; /* in megabytes */ |
222 /* -- functions -- */ | 171 extern gint thumbnail_quality; |
223 | 172 extern gint zoom_quality; |
224 /* main.c */ | 173 extern gint dither_quality; |
225 gchar *filename_from_path(char *t); | 174 |
226 gchar *remove_level_from_path(gchar *path); | 175 extern gint zoom_increment; /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */ |
227 void parse_out_relatives(gchar *path); | 176 |
228 void start_editor_from_file(gint n, gchar *path); | 177 extern gint enable_read_ahead; |
229 void start_editor_from_image(gint n); | 178 |
230 void start_editor_from_list(gint n); | 179 extern gint place_dialogs_under_mouse; |
180 | |
181 /* layout */ | |
182 extern gchar *layout_order; | |
183 extern gint layout_style; | |
184 | |
185 extern gint layout_view_icons; | |
186 extern gint layout_view_tree; | |
187 | |
188 extern gint show_icon_names; | |
189 | |
190 extern gint tree_descend_subdirs; | |
191 | |
192 extern gint lazy_image_sync; | |
193 extern gint update_on_time_change; | |
194 extern gint exif_rotate_enable; | |
195 | |
196 /* | |
197 *---------------------------------------------------------------------------- | |
198 * main.c | |
199 *---------------------------------------------------------------------------- | |
200 */ | |
201 | |
202 /* | |
203 * This also doubles as the main.c header. | |
204 */ | |
205 | |
206 void window_set_icon(GtkWidget *window, const char **icon, const gchar *file); | |
207 gint window_maximized(GtkWidget *window); | |
208 | |
209 gdouble get_zoom_increment(void); | |
210 | |
211 void help_window_show(const gchar *key); | |
212 | |
231 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event); | 213 void keyboard_scroll_calc(gint *x, gint *y, GdkEventKey *event); |
232 gint key_press_cb(GtkWidget *widget, GdkEventKey *event); | 214 gint key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data); |
233 void exit_gqview(); | 215 void exit_gqview(void); |
234 | 216 |
235 /* window.c */ | 217 |
236 void toolwindow_float(); | 218 #endif |
237 void toolwindow_hide(); | 219 |
238 void create_main_window(); | 220 |
239 | 221 |
240 /* menu.c */ | |
241 void add_menu_popup_item(GtkWidget *menu, gchar *label, | |
242 GtkSignalFunc func, gpointer data); | |
243 void add_menu_divider(GtkWidget *menu); | |
244 void update_edit_menus(GtkAccelGroup *accel_grp); | |
245 GtkWidget *create_menu_bar(GtkAccelGroup *accel_grp); | |
246 void create_menu_popups(); | |
247 GtkWidget *create_button_bar(GtkTooltips *tooltips); | |
248 | |
249 /* img-main.c */ | |
250 void full_screen_start(); | |
251 void full_screen_stop(); | |
252 void full_screen_toggle(); | |
253 void image_scroll(gint x, gint y); | |
254 void image_adjust_zoom(gint increment); | |
255 void image_set_zoom(gint zoom); | |
256 void image_set_path(gchar *path); | |
257 gchar *image_get_path(); | |
258 gchar *image_get_name(); | |
259 void image_change_to(gchar *path); | |
260 void image_set_labels(GtkWidget *info, GtkWidget *zoom); | |
261 GtkWidget *image_create(); | |
262 void image_to_root(); | |
263 | |
264 /* filelist.c */ | |
265 void update_status_label(gchar *text); | |
266 void rebuild_file_filter(); | |
267 gint find_file_in_list(gchar *path); | |
268 GList *file_get_selected_list(); | |
269 void free_selected_list(GList *list); | |
270 gint file_clicked_is_selected(); | |
271 gchar *file_clicked_get_path(); | |
272 gint file_count(); | |
273 gint file_selection_count(); | |
274 gchar *file_get_path(gint row); | |
275 gint file_is_selected(gint row); | |
276 void file_image_change_to(gint row); | |
277 void file_next_image(); | |
278 void file_prev_image(); | |
279 void file_first_image(); | |
280 void file_last_image(); | |
281 void file_is_gone(gchar *path, GList *ignore_list); | |
282 void file_is_renamed(gchar *source, gchar *dest); | |
283 void dir_select_cb(GtkWidget *widget, gint row, gint col, | |
284 GdkEvent *event, gpointer data); | |
285 void dir_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data); | |
286 void file_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data); | |
287 void file_select_cb(GtkWidget *widget, gint row, gint col, | |
288 GdkEvent *event, gpointer data); | |
289 void file_unselect_cb(GtkWidget *widget, gint row, gint col, | |
290 GdkEvent *event, gpointer data); | |
291 void file_clist_highlight_set(); | |
292 void file_clist_highlight_unset(); | |
293 void path_entry_tab_cb(gchar *newpath, gpointer data); | |
294 void path_entry_cb(gchar *newdir, gpointer data); | |
295 void interrupt_thumbs(); | |
296 void filelist_populate_clist(); | |
297 void filelist_refresh(); | |
298 void filelist_change_to(gchar *path); | |
299 | |
300 /* config.c */ | |
301 void show_config_window(); | |
302 void show_about_window(); | |
303 | |
304 /* rcfile.c */ | |
305 void save_options(); | |
306 void load_options(); | |
307 | |
308 /* tabcomp.c */ | |
309 GtkWidget *tab_completion_new_with_history(GtkWidget **entry, GtkWidget *window, gchar *text, | |
310 const gchar *history_key, gint max_levels, | |
311 void (*enter_func)(gchar *, gpointer), gpointer data); | |
312 gchar *tab_completion_set_to_last_history(GtkWidget *entry); | |
313 void tab_completion_append_to_history(GtkWidget *entry, gchar *path); | |
314 | |
315 GtkWidget *tab_completion_new(GtkWidget **entry, GtkWidget *window, gchar *text, | |
316 void (*enter_func)(gchar *, gpointer), gpointer data); | |
317 void tab_completion_add_to_entry(GtkWidget *entry, void (*enter_func)(gchar *, gpointer), gpointer data); | |
318 void tab_completion_add_tab_func(GtkWidget *entry, void (*tab_func)(gchar *, gpointer), gpointer data); | |
319 gchar *remove_trailing_slash(gchar *path); | |
320 | |
321 /* fileops.c */ | |
322 gchar *homedir(); | |
323 int isfile(char *s); | |
324 int isdir(char *s); | |
325 int filesize(char *s); | |
326 time_t filetime(gchar *s); | |
327 int copy_file(char *s, char *t); | |
328 int move_file(char *s, char *t); | |
329 gchar *get_current_dir(); | |
330 | |
331 /* dnd.c */ | |
332 void image_dnd_init(ImageWindow *imd); | |
333 void init_dnd(); | |
334 | |
335 /* pathsel.c */ | |
336 GtkWidget *destination_widget_new(gchar *path, GtkWidget *entry); | |
337 void destination_widget_sync_to_entry(GtkWidget *entry); | |
338 | |
339 #include "utildlg.h" | |
340 | |
341 /* utilops.c */ | |
342 void file_util_delete(gchar *source_path, GList *source_list); | |
343 void file_util_move(gchar *source_path, GList *source_list, gchar *dest_path); | |
344 void file_util_copy(gchar *source_path, GList *source_list, gchar *dest_path); | |
345 void file_util_rename(gchar *source_path, GList *source_list); | |
346 void file_util_create_dir(gchar *path); | |
347 | |
348 /* thumb.c */ | |
349 gint create_thumbnail(gchar *path, GdkPixmap **thumb_pixmap, GdkBitmap **thumb_mask); | |
350 gint maintain_thumbnail_dir(gchar *dir, gint recursive); | |
351 | |
352 /* slideshow.c */ | |
353 void slideshow_start(); | |
354 void slideshow_stop(); | |
355 void slideshow_next(); | |
356 void slideshow_prev(); | |
357 void slideshow_toggle(); | |
358 gint slideshow_is_running(); | |
359 | |
360 /* img-view.c */ | |
361 void view_window_new(gchar *path); | |
362 void view_window_active_edit(gint n); | |
363 void view_window_active_to_root(gint n); | |
364 void create_menu_view_popup(); | |
365 | |
366 | |
367 |