annotate src/img-view.c @ 1419:c520cfd40aef

Code cleanup.
author zas_
date Wed, 11 Mar 2009 23:36:01 +0000
parents a0bd58a6535f
children cf4029d10d38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 138
diff changeset
2 * Geeqie
94
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
3 * (C) 2006 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1272
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
5 *
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
6 * Author: John Ellis
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
7 *
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
11 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
12
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
13
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 254
diff changeset
14 #include "main.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
15 #include "img-view.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
16
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
17 #include "collect.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
18 #include "collect-io.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
19 #include "dnd.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
20 #include "editors.h"
586
905688aa2317 split filelist.c to filefilter.c and filedata.c
nadvornik
parents: 531
diff changeset
21 #include "filedata.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
22 #include "fullscreen.h"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
23 #include "image.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
24 #include "image-overlay.h"
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
25 #include "layout.h"
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
26 #include "layout_image.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
27 #include "menu.h"
1022
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 995
diff changeset
28 #include "misc.h"
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 995
diff changeset
29 #include "pixbuf_util.h"
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
30 #include "pixbuf-renderer.h"
94
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
31 #include "print.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
32 #include "slideshow.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
33 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
34 #include "ui_menu.h"
904
1698baa37871 Move uri_*() functions to separate files: uri_utils.[ch]
zas_
parents: 888
diff changeset
35 #include "uri_utils.h"
1022
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 995
diff changeset
36 #include "utilops.h"
648
e34c1002e553 Move some functions from main.[ch] to new window.[ch].
zas_
parents: 621
diff changeset
37 #include "window.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
38
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
39 #include <gdk/gdkkeysyms.h> /* for keyboard values */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
40
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
41
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
42 typedef struct _ViewWindow ViewWindow;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
43 struct _ViewWindow
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
44 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
45 GtkWidget *window;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
46 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
47 FullScreenData *fs;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
48 SlideShowData *ss;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
49
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
50 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
51 GList *list_pointer;
1397
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
52
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
53 /* file list for edit menu */
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
54 GList *editmenu_fd_list;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
55 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
56
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
57
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
58 static GList *view_window_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
59
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
60
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
61 static GtkWidget *view_popup_menu(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
62 static void view_fullscreen_toggle(ViewWindow *vw, gint force_off);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
63 static void view_overlay_toggle(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
64
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
65 static void view_slideshow_next(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
66 static void view_slideshow_prev(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
67 static void view_slideshow_start(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
68 static void view_slideshow_stop(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
69
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
70 static void view_window_close(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
71
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
72 static void view_window_dnd_init(ViewWindow *vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
73
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
74 static void view_window_notify_cb(FileData *fd, NotifyType type, gpointer data);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
75
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
76 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
77 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
78 * misc
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
79 *-----------------------------------------------------------------------------
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
80 */
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
81
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
82 static ImageWindow *view_window_active_image(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
83 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
84 if (vw->fs) return vw->fs->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
85
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
86 return vw->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
87 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
88
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
89 static void view_window_set_list(ViewWindow *vw, GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
90 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
91
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
92 filelist_free(vw->list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
93 vw->list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
94 vw->list_pointer = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
95
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
96 vw->list = filelist_copy(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
97 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
98
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
99 static gint view_window_contains_collection(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
100 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
101 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
102 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
103
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
104 cd = image_get_collection(view_window_active_image(vw), &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
105
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
106 return (cd && info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
107 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
108
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
109 static void view_collection_step(ViewWindow *vw, gint next)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
110 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
111 ImageWindow *imd = view_window_active_image(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
112 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
113 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
114 CollectInfo *read_ahead_info = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
115
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
116 cd = image_get_collection(imd, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
117
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
118 if (!cd || !info) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
119
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
120 if (next)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
121 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
122 info = collection_next_by_info(cd, info);
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
123 if (options->image.enable_read_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
124 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
125 read_ahead_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
126 if (!read_ahead_info) read_ahead_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
127 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
128 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
129 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
130 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
131 info = collection_prev_by_info(cd, info);
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
132 if (options->image.enable_read_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
133 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
134 read_ahead_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
135 if (!read_ahead_info) read_ahead_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
136 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
137 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
138
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
139 if (info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
140 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
141 image_change_from_collection(imd, cd, info, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
142
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
143 if (read_ahead_info) image_prebuffer_set(imd, read_ahead_info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
144 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
145
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
146 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
147
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
148 static void view_collection_step_to_end(ViewWindow *vw, gint last)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
149 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
150 ImageWindow *imd = view_window_active_image(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
151 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
152 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
153 CollectInfo *read_ahead_info = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
154
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
155 cd = image_get_collection(imd, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
156
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
157 if (!cd || !info) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
158
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
159 if (last)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
160 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
161 info = collection_get_last(cd);
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
162 if (options->image.enable_read_ahead) read_ahead_info = collection_prev_by_info(cd, info);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
163 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
164 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
165 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
166 info = collection_get_first(cd);
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
167 if (options->image.enable_read_ahead) read_ahead_info = collection_next_by_info(cd, info);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
168 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
169
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
170 if (info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
171 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
172 image_change_from_collection(imd, cd, info, image_zoom_get_default(imd));
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
173 if (read_ahead_info) image_prebuffer_set(imd, read_ahead_info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
174 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
175 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
176
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
177 static void view_list_step(ViewWindow *vw, gint next)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
178 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
179 ImageWindow *imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
180 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
181 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
182 GList *work_ahead;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
183
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
184 if (!vw->list) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
185
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
186 fd = image_get_fd(imd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
187 if (!fd) return;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
188
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
189 if (g_list_position(vw->list, vw->list_pointer) >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
190 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
191 work = vw->list_pointer;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
192 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
193 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
194 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
195 gint found = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
196
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
197 work = vw->list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
198 while (work && !found)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
199 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
200 FileData *temp;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
201
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
202 temp = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
203
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
204 if (fd == temp)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
205 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
206 found = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
207 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
208 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
209 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
210 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
211 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
212 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
213 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
214 if (!work) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
215
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
216 work_ahead = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
217 if (next)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
218 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
219 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
220 if (work) work_ahead = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
221 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
222 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
223 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
224 work = work->prev;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
225 if (work) work_ahead = work->prev;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
226 }
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
227
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
228 if (!work) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
229
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
230 vw->list_pointer = work;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
231 fd = work->data;
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
232 image_change_fd(imd, fd, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
233
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
234 if (options->image.enable_read_ahead && work_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
235 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
236 FileData *next_fd = work_ahead->data;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
237 image_prebuffer_set(imd, next_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
238 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
239 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
240
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
241 static void view_list_step_to_end(ViewWindow *vw, gint last)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
242 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
243 ImageWindow *imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
244 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
245 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
246 GList *work_ahead;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
247
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
248 if (!vw->list) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
249
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
250 if (last)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
251 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
252 work = g_list_last(vw->list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
253 work_ahead = work->prev;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
254 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
255 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
256 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
257 work = vw->list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
258 work_ahead = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
259 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
260
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
261 vw->list_pointer = work;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
262 fd = work->data;
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
263 image_change_fd(imd, fd, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
264
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
265 if (options->image.enable_read_ahead && work_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
266 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
267 FileData *next_fd = work_ahead->data;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
268 image_prebuffer_set(imd, next_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
269 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
270 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
271
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
272 static void view_step_next(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
273 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
274 if (vw->ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
275 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
276 view_slideshow_next(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
277 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
278 else if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
279 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
280 view_list_step(vw, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
281 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
282 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
283 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
284 view_collection_step(vw, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
285 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
286 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
287
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
288 static void view_step_prev(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
289 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
290 if (vw->ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
291 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
292 view_slideshow_prev(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
293 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
294 else if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
295 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
296 view_list_step(vw, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
297 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
298 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
299 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
300 view_collection_step(vw, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
301 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
302 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
303
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
304 static void view_step_to_end(ViewWindow *vw, gint last)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
305 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
306 if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
307 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
308 view_list_step_to_end(vw, last);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
309 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
310 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
311 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
312 view_collection_step_to_end(vw, last);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
313 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
314 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
315
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
316 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
317 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
318 * view window keyboard
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
319 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
320 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
321
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
322 static void view_window_menu_pos_cb(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
323 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
324 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
325 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
326
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
327 imd = view_window_active_image(vw);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
328 gdk_window_get_origin(imd->pr->window, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
329 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
330 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
331
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
332 static gint view_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
333 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
334 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
335 ImageWindow *imd;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
336 gint stop_signal;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
337 GtkWidget *menu;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
338 gint x = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
339 gint y = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
340
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
341 imd = view_window_active_image(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
342
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
343 stop_signal = TRUE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
344 switch (event->keyval)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
345 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
346 case GDK_Left: case GDK_KP_Left:
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
347 x -= 1;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
348 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
349 case GDK_Right: case GDK_KP_Right:
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
350 x += 1;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
351 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
352 case GDK_Up: case GDK_KP_Up:
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
353 y -= 1;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
354 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
355 case GDK_Down: case GDK_KP_Down:
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
356 y += 1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
357 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
358 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
359 stop_signal = FALSE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
360 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
361 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
362
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
363 if (x != 0 || y!= 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
364 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
365 if (event->state & GDK_SHIFT_MASK)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
366 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
367 x *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
368 y *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
369 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
370
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
371 keyboard_scroll_calc(&x, &y, event);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
372 image_scroll(imd, x, y);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
373 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
374
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
375 if (stop_signal) return stop_signal;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
376
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
377 if (event->state & GDK_CONTROL_MASK)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
378 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
379 gint n = -1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
380
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
381 stop_signal = TRUE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
382 switch (event->keyval)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
383 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
384 case '1':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
385 n = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
386 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
387 case '2':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
388 n = 1;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
389 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
390 case '3':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
391 n = 2;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
392 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
393 case '4':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
394 n = 3;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
395 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
396 case '5':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
397 n = 4;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
398 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
399 case '6':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
400 n = 5;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
401 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
402 case '7':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
403 n = 6;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
404 break;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
405 case '8':
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
406 n = 7;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
407 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
408 case '9':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
409 n = 8;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
410 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
411 case '0':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
412 n = 9;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
413 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
414 case 'C': case 'c':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
415 file_util_copy(image_get_fd(imd), NULL, NULL, imd->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
416 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
417 case 'M': case 'm':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
418 file_util_move(image_get_fd(imd), NULL, NULL, imd->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
419 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
420 case 'R': case 'r':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
421 file_util_rename(image_get_fd(imd), NULL, imd->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
422 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
423 case 'D': case 'd':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
424 file_util_delete(image_get_fd(imd), NULL, imd->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
425 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
426 case 'W': case 'w':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
427 view_window_close(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
428 break;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
429 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
430 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
431 break;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
432 }
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1211
diff changeset
433 #if 0
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
434 if (n != -1)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
435 {
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
436 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
437 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
438 view_fullscreen_toggle(vw, TRUE);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
439 }
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
440 imd = view_window_active_image(vw);
753
477f48ba28d8 rewritten utilops.h:
nadvornik
parents: 736
diff changeset
441 file_util_start_editor_from_file(n, image_get_fd(imd), imd->widget);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
442 }
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1211
diff changeset
443 #endif
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
444 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
445 else if (event->state & GDK_SHIFT_MASK)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
446 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
447 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
448 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
449 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
450 case 'R': case 'r':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
451 image_alter(imd, ALTER_ROTATE_180);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
452 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
453 case 'M': case 'm':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
454 image_alter(imd, ALTER_MIRROR);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
455 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
456 case 'F': case 'f':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
457 image_alter(imd, ALTER_FLIP);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
458 break;
82
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
459 case 'G': case 'g':
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
460 image_alter(imd, ALTER_DESATURATE);
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
461 break;
94
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
462 case 'P': case 'p':
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
463 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
464 FileData *fd;
94
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
465
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
466 view_fullscreen_toggle(vw, TRUE);
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
467 imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
468 fd = image_get_fd(imd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
469 print_window_new(fd,
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
470 fd ? g_list_append(NULL, file_data_ref(fd)) : NULL,
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
471 filelist_copy(vw->list), vw->window);
94
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
472 }
50dc5a14d37b Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net>
gqview
parents: 91
diff changeset
473 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
474 default:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
475 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
476 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
477 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
478 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
479 else
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
480 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
481 stop_signal = TRUE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
482 switch (event->keyval)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
483 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
484 case GDK_Page_Up: case GDK_KP_Page_Up:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
485 case GDK_BackSpace:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
486 case 'B': case 'b':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
487 view_step_prev(vw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
488 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
489 case GDK_Page_Down: case GDK_KP_Page_Down:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
490 case GDK_space:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
491 case 'N': case 'n':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
492 view_step_next(vw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
493 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
494 case GDK_Home: case GDK_KP_Home:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
495 view_step_to_end(vw, FALSE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
496 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
497 case GDK_End: case GDK_KP_End:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
498 view_step_to_end(vw, TRUE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
499 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
500 case '+': case '=': case GDK_KP_Add:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
501 image_zoom_adjust(imd, get_zoom_increment());
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
502 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
503 case '-': case GDK_KP_Subtract:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
504 image_zoom_adjust(imd, -get_zoom_increment());
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
505 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
506 case 'X': case 'x': case GDK_KP_Multiply:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
507 image_zoom_set(imd, 0.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
508 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
509 case 'Z': case 'z': case GDK_KP_Divide: case '1':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
510 image_zoom_set(imd, 1.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
511 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
512 case '2':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
513 image_zoom_set(imd, 2.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
514 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
515 case '3':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
516 image_zoom_set(imd, 3.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
517 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
518 case '4':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
519 image_zoom_set(imd, 4.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
520 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
521 case '7':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
522 image_zoom_set(imd, -4.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
523 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
524 case '8':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
525 image_zoom_set(imd, -3.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
526 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
527 case '9':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
528 image_zoom_set(imd, -2.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
529 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
530 case 'W': case 'w':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
531 image_zoom_set_fill_geometry(imd, FALSE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
532 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
533 case 'H': case 'h':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
534 image_zoom_set_fill_geometry(imd, TRUE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
535 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
536 case 'R': case 'r':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
537 image_reload(imd);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
538 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
539 case 'S': case 's':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
540 if (vw->ss)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
541 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
542 view_slideshow_stop(vw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
543 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
544 else
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
545 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
546 view_slideshow_start(vw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
547 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
548 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
549 case 'P': case 'p':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
550 slideshow_pause_toggle(vw->ss);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
551 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
552 case 'F': case 'f':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
553 case 'V': case 'v':
86
cade6a52a165 Mon Oct 23 05:34:29 2006 John Ellis <johne@verizon.net>
gqview
parents: 84
diff changeset
554 case GDK_F11:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
555 view_fullscreen_toggle(vw, FALSE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
556 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
557 case 'I': case 'i':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
558 view_overlay_toggle(vw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
559 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
560 case ']':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
561 image_alter(imd, ALTER_ROTATE_90);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
562 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
563 case '[':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
564 image_alter(imd, ALTER_ROTATE_90_CC);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
565 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
566 case GDK_Delete: case GDK_KP_Delete:
341
15c6b94545a2 Move safe_delete* and in place rename options to file_ops
zas_
parents: 339
diff changeset
567 if (options->file_ops.enable_delete_key)
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
568 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
569 file_util_delete(image_get_fd(imd), NULL, imd->widget);
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
570 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
571 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
572 case GDK_Escape:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
573 if (vw->fs)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
574 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
575 view_fullscreen_toggle(vw, TRUE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
576 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
577 else
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
578 {
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
579 view_window_close(vw);
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
580 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
581 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
582 case GDK_Menu:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
583 case GDK_F10:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
584 menu = view_popup_menu(vw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
585 gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
586 view_window_menu_pos_cb, vw, 0, GDK_CURRENT_TIME);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
587 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
588 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
589 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
590 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
591 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
592 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
593
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
594 return stop_signal;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
595 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
596
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
597 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
598 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
599 * view window main routines
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
600 *-----------------------------------------------------------------------------
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
601 */
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
602 static void button_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
603 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
604 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
605 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
606
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
607 switch (event->button)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
608 {
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
609 case MOUSE_BUTTON_LEFT:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
610 view_step_next(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
611 break;
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
612 case MOUSE_BUTTON_MIDDLE:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
613 view_step_prev(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
614 break;
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
615 case MOUSE_BUTTON_RIGHT:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
616 menu = view_popup_menu(vw);
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
617 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, event->time);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
618 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
619 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
620 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
621 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
622 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
623
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
624 static void scroll_cb(ImageWindow *imd, GdkEventScroll *event, gpointer data)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
625 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
626 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
627
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
628 if (event->state & GDK_CONTROL_MASK)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
629 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
630 switch (event->direction)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
631 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
632 case GDK_SCROLL_UP:
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
633 image_zoom_adjust_at_point(imd, get_zoom_increment(), event->x, event->y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
634 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
635 case GDK_SCROLL_DOWN:
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
636 image_zoom_adjust_at_point(imd, -get_zoom_increment(), event->x, event->y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
637 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
638 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
639 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
640 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
641 }
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
642 else if ( (event->state & GDK_SHIFT_MASK) != (guint) (options->mousewheel_scrolls))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
643 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
644 switch (event->direction)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
645 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
646 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
647 image_scroll(imd, 0, -MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
648 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
649 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
650 image_scroll(imd, 0, MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
651 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
652 case GDK_SCROLL_LEFT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
653 image_scroll(imd, -MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
654 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
655 case GDK_SCROLL_RIGHT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
656 image_scroll(imd, MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
657 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
658 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
659 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
660 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
661 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
662 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
663 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 803
diff changeset
664 switch (event->direction)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
665 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
666 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
667 view_step_prev(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
668 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
669 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
670 view_step_next(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
671 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
672 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
673 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
674 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
675 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
676 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
677
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
678 static void view_image_set_buttons(ViewWindow *vw, ImageWindow *imd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
679 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
680 image_set_button_func(imd, button_cb, vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
681 image_set_scroll_func(imd, scroll_cb, vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
682 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
683
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
684 static void view_fullscreen_stop_func(FullScreenData *fs, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
685 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
686 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
687
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
688 vw->fs = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
689
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
690 if (vw->ss) vw->ss->imd = vw->imd;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
691 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
692
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
693 static void view_fullscreen_toggle(ViewWindow *vw, gint force_off)
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
694 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
695 if (force_off && !vw->fs) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
696
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
697 if (vw->fs)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
698 {
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
699 if (image_osd_get(vw->imd) & OSD_SHOW_INFO)
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
700 image_osd_set(vw->imd, image_osd_get(vw->fs->imd));
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
701
117
0c2e1f0a001b Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 94
diff changeset
702 fullscreen_stop(vw->fs);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
703 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
704 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
705 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
706 vw->fs = fullscreen_start(vw->window, vw->imd, view_fullscreen_stop_func, vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
707
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
708 view_image_set_buttons(vw, vw->fs->imd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
709 g_signal_connect(G_OBJECT(vw->fs->window), "key_press_event",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
710 G_CALLBACK(view_window_key_press_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
711
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
712 if (vw->ss) vw->ss->imd = vw->fs->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
713
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
714 if (image_osd_get(vw->imd) & OSD_SHOW_INFO)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
715 {
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
716 image_osd_set(vw->fs->imd, image_osd_get(vw->imd));
614
b2898f04c82e image_osd_get() and image_osd_set() now uses flags.
zas_
parents: 586
diff changeset
717 image_osd_set(vw->imd, OSD_SHOW_NOTHING);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
718 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
719 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
720 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
721
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
722 static void view_overlay_toggle(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
723 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
724 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
725
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
726 imd = view_window_active_image(vw);
481
67a612985686 Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents: 479
diff changeset
727
67a612985686 Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents: 479
diff changeset
728 image_osd_toggle(imd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
729 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
730
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
731 static void view_slideshow_next(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
732 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
733 if (vw->ss) slideshow_next(vw->ss);
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
734 }
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
735
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
736 static void view_slideshow_prev(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
737 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
738 if (vw->ss) slideshow_prev(vw->ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
739 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
740
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
741 static void view_slideshow_stop_func(SlideShowData *fs, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
742 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
743 ViewWindow *vw = data;
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
744 GList *work;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
745 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
746
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
747 vw->ss = NULL;
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
748
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
749 work = vw->list;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
750 fd = image_get_fd(view_window_active_image(vw));
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
751 while (work)
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
752 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
753 FileData *temp;
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
754
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
755 temp = work->data;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
756 if (fd == temp)
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
757 {
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
758 vw->list_pointer = work;
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
759 work = NULL;
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
760 }
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
761 else
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
762 {
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
763 work = work->next;
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
764 }
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
765 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
766 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
767
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
768 static void view_slideshow_start(ViewWindow *vw)
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
769 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
770 if (!vw->ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
771 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
772 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
773 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
774
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
775 if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
776 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
777 vw->ss = slideshow_start_from_filelist(view_window_active_image(vw),
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
778 filelist_copy(vw->list),
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
779 view_slideshow_stop_func, vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
780 vw->list_pointer = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
781 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
782 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
783
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
784 cd = image_get_collection(view_window_active_image(vw), &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
785 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
786 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
787 vw->ss = slideshow_start_from_collection(view_window_active_image(vw), cd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
788 view_slideshow_stop_func, vw, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
789 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
790 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
791 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
792
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
793 static void view_slideshow_stop(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
794 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
795 if (vw->ss) slideshow_free(vw->ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
796 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
797
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
798 static void view_window_destroy_cb(GtkWidget *widget, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
799 {
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
800 ViewWindow *vw = data;
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
801
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
802 view_window_list = g_list_remove(view_window_list, vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
803
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
804 view_slideshow_stop(vw);
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
805 fullscreen_stop(vw->fs);
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
806
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
807 filelist_free(vw->list);
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
808
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
809 file_data_unregister_notify_func(view_window_notify_cb, vw);
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
810
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
811 g_free(vw);
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
812 }
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
813
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
814 static void view_window_close(ViewWindow *vw)
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
815 {
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
816 view_slideshow_stop(vw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
817 view_fullscreen_toggle(vw, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
818 gtk_widget_destroy(vw->window);
4
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
819 }
e149abcda4eb Syncing to 0.8.1
gqview
parents: 3
diff changeset
820
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
821 static gint view_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
822 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
823 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
824
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
825 view_window_close(vw);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
826 return TRUE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
827 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
828
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
829 static ViewWindow *real_view_window_new(FileData *fd, GList *list, CollectionData *cd, CollectInfo *info)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
830 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
831 ViewWindow *vw;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
832 GtkAllocation req_size;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
833 GdkGeometry geometry;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
834 gint w, h;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
835
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
836 if (!fd && !list && (!cd || !info)) return NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
837
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
838 vw = g_new0(ViewWindow, 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
839
289
6a7298988a7a Simplify and unify gtk_window creation with the help of
zas_
parents: 288
diff changeset
840 vw->window = window_new(GTK_WINDOW_TOPLEVEL, "view", PIXBUF_INLINE_ICON_VIEW, NULL, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
841
1029
1a4b18c58556 Use a constant for minimal window size. Set it to 32 for all dialogs.
zas_
parents: 1022
diff changeset
842 geometry.min_width = DEFAULT_MINIMAL_WINDOW_SIZE;
1a4b18c58556 Use a constant for minimal window size. Set it to 32 for all dialogs.
zas_
parents: 1022
diff changeset
843 geometry.min_height = DEFAULT_MINIMAL_WINDOW_SIZE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
844 gtk_window_set_geometry_hints(GTK_WINDOW(vw->window), NULL, &geometry, GDK_HINT_MIN_SIZE);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
845
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
846 gtk_window_set_resizable(GTK_WINDOW(vw->window), TRUE);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
847 gtk_container_set_border_width(GTK_CONTAINER(vw->window), 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
848
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
849 vw->imd = image_new(FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
850
339
de1c2cd06fce Rename user_specified_window_background and window_background_color
zas_
parents: 334
diff changeset
851 image_background_set_color(vw->imd, options->image.use_custom_border_color ? &options->image.border_color : NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
852
288
d1f74154463e Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents: 281
diff changeset
853 image_attach_window(vw->imd, vw->window, NULL, GQ_APPNAME, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
854
888
d8e1e820cee7 reload changed images
nadvornik
parents: 885
diff changeset
855 image_auto_refresh_enable(vw->imd, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
856 image_top_window_set_sync(vw->imd, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
857
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
858 gtk_container_add(GTK_CONTAINER(vw->window), vw->imd->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
859 gtk_widget_show(vw->imd->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
860
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
861 view_window_dnd_init(vw);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
862
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
863 view_image_set_buttons(vw, vw->imd);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
864
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
865 g_signal_connect(G_OBJECT(vw->window), "destroy",
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
866 G_CALLBACK(view_window_destroy_cb), vw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
867 g_signal_connect(G_OBJECT(vw->window), "delete_event",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
868 G_CALLBACK(view_window_delete_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
869 g_signal_connect(G_OBJECT(vw->window), "key_press_event",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
870 G_CALLBACK(view_window_key_press_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
871 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
872 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
873 image_change_from_collection(vw->imd, cd, info, image_zoom_get_default(NULL));
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
874 if (options->image.enable_read_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
875 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
876 CollectInfo * r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
877 if (!r_info) r_info = collection_prev_by_info(cd, info);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
878 if (r_info) image_prebuffer_set(vw->imd, r_info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
879 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
880 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
881 else if (list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
882 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
883 view_window_set_list(vw, list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
884 vw->list_pointer = vw->list;
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
885 image_change_fd(vw->imd, (FileData *)vw->list->data, image_zoom_get_default(NULL));
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
886
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
887 if (options->image.enable_read_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
888 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
889 GList *work = vw->list->next;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
890 if (work) image_prebuffer_set(vw->imd, (FileData *)work->data);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
891 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
892 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
893 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
894 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
895 image_change_fd(vw->imd, fd, image_zoom_get_default(NULL));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
896 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
897
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
898 if (image_zoom_get(vw->imd) == 0.0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
899 {
531
1149a7b0a3d7 cleanup: use image_get_image_size
nadvornik
parents: 512
diff changeset
900 image_get_image_size(vw->imd, &w, &h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
901 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
902 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
903 {
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
904 pixbuf_renderer_get_scaled_size(PIXBUF_RENDERER(vw->imd->pr), &w, &h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
905 }
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
906 if (options->image.limit_window_size)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
907 {
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
908 gint mw = gdk_screen_width() * options->image.max_window_size / 100;
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
909 gint mh = gdk_screen_height() * options->image.max_window_size / 100;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
910
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
911 if (w > mw) w = mw;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
912 if (h > mh) h = mh;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
913 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
914
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
915 gtk_window_set_default_size(GTK_WINDOW(vw->window), w, h);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
916 req_size.x = req_size.y = 0;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
917 req_size.width = w;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
918 req_size.height = h;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
919 gtk_widget_size_allocate(GTK_WIDGET(vw->window), &req_size);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
920
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
921 gtk_widget_set_size_request(vw->imd->pr, w, h);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
922
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
923 gtk_widget_show(vw->window);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
924
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
925 view_window_list = g_list_append(view_window_list, vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
926
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
927 file_data_register_notify_func(view_window_notify_cb, vw, NOTIFY_PRIORITY_LOW);
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
928
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
929 return vw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
930 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
931
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
932 static void view_window_collection_unref_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
933 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
934 CollectionData *cd = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
935
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
936 collection_unref(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
937 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
938
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
939 void view_window_new(FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
940 {
780
44128da39e13 Drop initialization to NULL since filelist_read() will take care of it.
zas_
parents: 753
diff changeset
941 GList *list;
44128da39e13 Drop initialization to NULL since filelist_read() will take care of it.
zas_
parents: 753
diff changeset
942
781
2d2cca2bceb0 Replace hardcoded collection filename extension by a macro (GQ_COLLECTION_EXT).
zas_
parents: 780
diff changeset
943 if (file_extension_match(fd->path, GQ_COLLECTION_EXT))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
944 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
945 ViewWindow *vw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
946 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
947 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
948
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
949 cd = collection_new(fd->path);
358
384eed18df04 Use flags for collection_load*().
zas_
parents: 341
diff changeset
950 if (collection_load(cd, fd->path, COLLECTION_LOAD_NONE))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
951 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
952 info = collection_get_first(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
953 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
954 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
955 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
956 collection_unref(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
957 cd = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
958 info = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
959 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
960 vw = real_view_window_new(NULL, NULL, cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
961 if (vw && cd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
962 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
963 g_signal_connect(G_OBJECT(vw->window), "destroy",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
964 G_CALLBACK(view_window_collection_unref_cb), cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
965 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
966 }
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
967 else if (isdir(fd->path) && filelist_read(fd, &list, NULL))
995
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 904
diff changeset
968 {
780
44128da39e13 Drop initialization to NULL since filelist_read() will take care of it.
zas_
parents: 753
diff changeset
969 list = filelist_sort_path(list);
44128da39e13 Drop initialization to NULL since filelist_read() will take care of it.
zas_
parents: 753
diff changeset
970 list = filelist_filter(list, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
971 real_view_window_new(NULL, list, NULL, NULL);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
972 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
973 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
974 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
975 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
976 real_view_window_new(fd, NULL, NULL, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
977 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
978 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
979
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
980 void view_window_new_from_list(GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
981 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
982 real_view_window_new(NULL, list, NULL, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
983 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
984
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
985 void view_window_new_from_collection(CollectionData *cd, CollectInfo *info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
986 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
987 real_view_window_new(NULL, NULL, cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
988 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
989
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
990 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
991 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
992 * public
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
993 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
994 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
995
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
996 void view_window_colors_update(void)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
997 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
998 GList *work;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
999
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1000 work = view_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1001 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1002 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1003 ViewWindow *vw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1004 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1005
339
de1c2cd06fce Rename user_specified_window_background and window_background_color
zas_
parents: 334
diff changeset
1006 image_background_set_color(vw->imd, options->image.use_custom_border_color ? &options->image.border_color : NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1007 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1008 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1009
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1010 gint view_window_find_image(ImageWindow *imd, gint *index, gint *total)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1011 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1012 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1013
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1014 work = view_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1015 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1016 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1017 ViewWindow *vw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1018 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1019
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1020 if (vw->imd == imd ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1021 (vw->fs && vw->fs->imd == imd))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1022 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1023 if (vw->ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1024 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1025 gint n;
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1026 gint t;
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1027
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1028 n = g_list_length(vw->ss->list_done);
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1029 t = n + g_list_length(vw->ss->list);
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1030 if (n == 0) n = t;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1031 if (index) *index = n - 1;
118
ac0f7f942c4d Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1032 if (total) *total = t;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1033 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1034 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1035 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1036 if (index) *index = g_list_position(vw->list, vw->list_pointer);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1037 if (total) *total = g_list_length(vw->list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1038 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1039 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1040 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1041 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1042
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1043 return FALSE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1044 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1045
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1046 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1047 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1048 * view window menu routines and callbacks
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1049 *-----------------------------------------------------------------------------
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
1050 */
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1051
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1052 static void view_new_window_cb(GtkWidget *widget, gpointer data)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1053 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1054 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1055 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1056 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1057
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1058 cd = image_get_collection(vw->imd, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1059
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1060 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1061 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1062 view_window_new_from_collection(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1063 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1064 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1065 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1066 view_window_new(image_get_fd(vw->imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1067 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1068 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1069
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1070 static void view_edit_cb(GtkWidget *widget, gpointer data)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1071 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1072 ViewWindow *vw;
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
1073 ImageWindow *imd;
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1211
diff changeset
1074 const gchar *key = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1075
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1076 vw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1077 if (!vw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1078
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1211
diff changeset
1079 if (!editor_window_flag_set(key))
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
1080 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
1081 view_fullscreen_toggle(vw, TRUE);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
1082 }
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
1083
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
1084 imd = view_window_active_image(vw);
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1211
diff changeset
1085 file_util_start_editor_from_file(key, image_get_fd(imd), imd->widget);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1086 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1087
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1088 static void view_alter_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1089 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1090 ViewWindow *vw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1091 AlterType type;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1092
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1093 vw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1094 type = GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1095
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1096 if (!vw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1097 image_alter(vw->imd, type);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1098 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1099
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1100 static void view_wallpaper_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1101 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1102 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1103 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1104
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1105 imd = view_window_active_image(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1106 image_to_root_window(imd, (image_zoom_get(imd) == 0.0));
3
gqview
parents: 1
diff changeset
1107 }
gqview
parents: 1
diff changeset
1108
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1109 static void view_zoom_in_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1110 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1111 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1112
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1113 image_zoom_adjust(view_window_active_image(vw), get_zoom_increment());
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1114 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1115
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1116 static void view_zoom_out_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1117 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1118 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1119
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1120 image_zoom_adjust(view_window_active_image(vw), -get_zoom_increment());
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1121 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1122
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1123 static void view_zoom_1_1_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1124 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1125 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1126
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1127 image_zoom_set(view_window_active_image(vw), 1.0);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1128 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1129
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1130 static void view_zoom_fit_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1131 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1132 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1133
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1134 image_zoom_set(view_window_active_image(vw), 0.0);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1135 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1136
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1137 static void view_copy_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1138 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1139 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1140 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1141
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1142 imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1143 file_util_copy(image_get_fd(imd), NULL, NULL, imd->widget);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1144 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1145
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1146 static void view_move_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1147 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1148 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1149 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1150
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1151 imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1152 file_util_move(image_get_fd(imd), NULL, NULL, imd->widget);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1153 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1154
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1155 static void view_rename_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1156 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1157 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1158 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1159
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1160 imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1161 file_util_rename(image_get_fd(imd), NULL, imd->widget);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1162 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1163
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1164 static void view_delete_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1165 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1166 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1167 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1168
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1169 imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1170 file_util_delete(image_get_fd(imd), NULL, imd->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1171 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1172
497
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1173 static void view_copy_path_cb(GtkWidget *widget, gpointer data)
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1174 {
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1175 ViewWindow *vw = data;
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1176 ImageWindow *imd;
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1177
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1178 imd = view_window_active_image(vw);
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1179 file_util_copy_path_to_clipboard(image_get_fd(imd));
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1180 }
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1181
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1182 static void view_fullscreen_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1183 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1184 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1185
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1186 view_fullscreen_toggle(vw, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1187 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1188
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1189 static void view_slideshow_start_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1190 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1191 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1192
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1193 view_slideshow_start(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1194 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1195
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1196 static void view_slideshow_stop_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1197 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1198 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1199
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1200 view_slideshow_stop(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1201 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1202
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1203 static void view_slideshow_pause_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1204 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1205 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1206
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1207 slideshow_pause_toggle(vw->ss);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1208 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1209
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1210 static void view_close_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1211 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1212 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1213
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1214 view_window_close(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1215 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1216
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
1217 static LayoutWindow *view_new_layout_with_fd(FileData *fd)
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1218 {
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1219 LayoutWindow *nw;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1220
1309
55ea4962887a config file format changed to XML
nadvornik
parents: 1292
diff changeset
1221 nw = layout_new(NULL, NULL);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1222 layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
1223 layout_set_fd(nw, fd);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1224 return nw;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1225 }
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1226
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1227
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1228 static void view_set_layout_path_cb(GtkWidget *widget, gpointer data)
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1229 {
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1230 ViewWindow *vw = data;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1231 LayoutWindow *lw;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1232 ImageWindow *imd;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
1233
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1234 imd = view_window_active_image(vw);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1235
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1236 if (!imd || !imd->image_fd) return;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
1237
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1238 lw = layout_find_by_image_fd(imd);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1239 if (lw)
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
1240 layout_set_fd(lw, imd->image_fd);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1241 else
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
1242 view_new_layout_with_fd(imd->image_fd);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1243 view_window_close(vw);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1244 }
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1245
1397
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1246 static void view_popup_menu_destroy_cb(GtkWidget *widget, gpointer data)
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1247 {
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1248 ViewWindow *vw = data;
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1249
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1250 filelist_free(vw->editmenu_fd_list);
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1251 vw->editmenu_fd_list = NULL;
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1252 }
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1253
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1254 static GList *view_window_get_fd_list(ViewWindow *vw)
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1255 {
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1256 GList *list = NULL;
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1257 ImageWindow *imd = view_window_active_image(vw);
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1258
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1259 if (imd)
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1260 {
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1261 FileData *fd = image_get_fd(imd);
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1262 if (fd) list = g_list_append(NULL, file_data_ref(fd));
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1263 }
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1264
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1265 return list;
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1266 }
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1267
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1268 static GtkWidget *view_popup_menu(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1269 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1270 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1271 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1272
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1273 menu = popup_menu_short_lived();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1274
1397
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1275 g_signal_connect(G_OBJECT(menu), "destroy",
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1276 G_CALLBACK(view_popup_menu_destroy_cb), vw);
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1277
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1278 menu_item_add_stock(menu, _("Zoom _in"), GTK_STOCK_ZOOM_IN, G_CALLBACK(view_zoom_in_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1279 menu_item_add_stock(menu, _("Zoom _out"), GTK_STOCK_ZOOM_OUT, G_CALLBACK(view_zoom_out_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1280 menu_item_add_stock(menu, _("Zoom _1:1"), GTK_STOCK_ZOOM_100, G_CALLBACK(view_zoom_1_1_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1281 menu_item_add_stock(menu, _("Fit image to _window"), GTK_STOCK_ZOOM_FIT, G_CALLBACK(view_zoom_fit_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1282 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1283
1397
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1284 vw->editmenu_fd_list = view_window_get_fd_list(vw);
a0bd58a6535f In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents: 1367
diff changeset
1285 item = submenu_add_edit(menu, NULL, G_CALLBACK(view_edit_cb), vw, vw->editmenu_fd_list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1286 menu_item_add_divider(item);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1287 menu_item_add(item, _("Set as _wallpaper"), G_CALLBACK(view_wallpaper_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1288
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1289 submenu_add_alter(menu, G_CALLBACK(view_alter_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1290
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1291 menu_item_add_stock(menu, _("View in _new window"), GTK_STOCK_NEW, G_CALLBACK(view_new_window_cb), vw);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 358
diff changeset
1292 item = menu_item_add(menu, _("_Go to directory view"), G_CALLBACK(view_set_layout_path_cb), vw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1293
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1294 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1295 menu_item_add_stock(menu, _("_Copy..."), GTK_STOCK_COPY, G_CALLBACK(view_copy_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1296 menu_item_add(menu, _("_Move..."), G_CALLBACK(view_move_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1297 menu_item_add(menu, _("_Rename..."), G_CALLBACK(view_rename_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1298 menu_item_add_stock(menu, _("_Delete..."), GTK_STOCK_DELETE, G_CALLBACK(view_delete_cb), vw);
497
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1299 if (options->show_copy_path)
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 481
diff changeset
1300 menu_item_add(menu, _("_Copy path"), G_CALLBACK(view_copy_path_cb), vw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1301
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1302 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1303
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1304 if (vw->ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1305 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1306 menu_item_add(menu, _("_Stop slideshow"), G_CALLBACK(view_slideshow_stop_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1307 if (slideshow_paused(vw->ss))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1308 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1309 item = menu_item_add(menu, _("Continue slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1310 G_CALLBACK(view_slideshow_pause_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1311 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1312 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1313 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1314 item = menu_item_add(menu, _("Pause slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1315 G_CALLBACK(view_slideshow_pause_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1316 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1317 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1318 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1319 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1320 item = menu_item_add(menu, _("_Start slideshow"), G_CALLBACK(view_slideshow_start_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1321 gtk_widget_set_sensitive(item, (vw->list != NULL) || view_window_contains_collection(vw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1322 item = menu_item_add(menu, _("Pause slides_how"), G_CALLBACK(view_slideshow_pause_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1323 gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1324 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1325
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1326 if (vw->fs)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1327 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1328 menu_item_add(menu, _("Exit _full screen"), G_CALLBACK(view_fullscreen_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1329 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1330 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1331 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1332 menu_item_add(menu, _("_Full screen"), G_CALLBACK(view_fullscreen_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1333 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1334
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1335 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1336 menu_item_add_stock(menu, _("C_lose window"), GTK_STOCK_CLOSE, G_CALLBACK(view_close_cb), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1337
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1338 return menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1339 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1340
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1341 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1342 *-------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1343 * dnd confirm dir
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1344 *-------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1345 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1346
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1347 typedef struct {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1348 ViewWindow *vw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1349 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1350 } CViewConfirmD;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1351
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1352 static void view_dir_list_cancel(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1353 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1354 /* do nothing */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1355 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1356
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1357 static void view_dir_list_do(ViewWindow *vw, GList *list, gint skip, gint recurse)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1358 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1359 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1360
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1361 view_window_set_list(vw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1362
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1363 work = list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1364 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1365 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1366 FileData *fd = work->data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1367 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1368
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1369 if (isdir(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1370 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1371 if (!skip)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1372 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1373 GList *list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1374
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1375 if (recurse)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1376 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
1377 list = filelist_recursive(fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1378 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1379 else
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1380 { /*FIXME */
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 781
diff changeset
1381 filelist_read(fd, &list, NULL);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1382 list = filelist_sort_path(list);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1383 list = filelist_filter(list, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1384 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1385 if (list) vw->list = g_list_concat(vw->list, list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1386 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1387 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1388 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1389 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1390 /* FIXME: no filtering here */
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1391 vw->list = g_list_append(vw->list, file_data_ref(fd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1392 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1393 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1394
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1395 if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1396 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1397 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1398
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1399 vw->list_pointer = vw->list;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1400 fd = vw->list->data;
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
1401 image_change_fd(vw->imd, fd, image_zoom_get_default(vw->imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1402
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1403 work = vw->list->next;
334
df868b947aa0 Rename image-related options.
zas_
parents: 318
diff changeset
1404 if (options->image.enable_read_ahead && work)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1405 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1406 fd = work->data;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1407 image_prebuffer_set(vw->imd, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1408 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1409 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1410 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1411 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
1412 image_change_fd(vw->imd, NULL, image_zoom_get_default(vw->imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1413 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1414 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1415
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1416 static void view_dir_list_add(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1417 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1418 CViewConfirmD *d = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1419 view_dir_list_do(d->vw, d->list, FALSE, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1420 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1421
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1422 static void view_dir_list_recurse(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1423 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1424 CViewConfirmD *d = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1425 view_dir_list_do(d->vw, d->list, FALSE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1426 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1427
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1428 static void view_dir_list_skip(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1429 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1430 CViewConfirmD *d = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1431 view_dir_list_do(d->vw, d->list, TRUE, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1432 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1433
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1434 static void view_dir_list_destroy(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1435 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1436 CViewConfirmD *d = data;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
1437 filelist_free(d->list);
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
1438 g_free(d);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1439 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1440
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1441 static GtkWidget *view_confirm_dir_list(ViewWindow *vw, GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1442 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1443 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1444 CViewConfirmD *d;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1445
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1446 d = g_new(CViewConfirmD, 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1447 d->vw = vw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1448 d->list = list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1449
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1450 menu = popup_menu_short_lived();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1451 g_signal_connect(G_OBJECT(menu), "destroy",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1452 G_CALLBACK(view_dir_list_destroy), d);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1453
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1454 menu_item_add_stock(menu, _("Dropped list includes folders."), GTK_STOCK_DND_MULTIPLE, NULL, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1455 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1456 menu_item_add_stock(menu, _("_Add contents"), GTK_STOCK_OK, G_CALLBACK(view_dir_list_add), d);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1457 menu_item_add_stock(menu, _("Add contents _recursive"), GTK_STOCK_ADD, G_CALLBACK(view_dir_list_recurse), d);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1458 menu_item_add_stock(menu, _("_Skip folders"), GTK_STOCK_REMOVE, G_CALLBACK(view_dir_list_skip), d);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1459 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1460 menu_item_add_stock(menu, _("Cancel"), GTK_STOCK_CANCEL, G_CALLBACK(view_dir_list_cancel), d);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1461
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1462 return menu;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1463 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1464
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1465 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1466 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1467 * image drag and drop routines
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1468 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1469 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1470
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1471 static void view_window_get_dnd_data(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1472 gint x, gint y,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1473 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1474 guint time, gpointer data)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1475 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1476 ViewWindow *vw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1477 ImageWindow *imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1478
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
1479 if (gtk_drag_get_source_widget(context) == vw->imd->pr) return;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1480
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1481 imd = vw->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1482
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1483 if (info == TARGET_URI_LIST || info == TARGET_APP_COLLECTION_MEMBER)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1484 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1485 CollectionData *source;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1486 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1487 GList *info_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1488
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1489 if (info == TARGET_URI_LIST)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1490 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1491 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1492
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1493 list = uri_filelist_from_text((gchar *)selection_data->data, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1494
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1495 work = list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1496 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1497 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1498 FileData *fd = work->data;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1499 if (isdir(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1500 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1501 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1502 menu = view_confirm_dir_list(vw, list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1503 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, time);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1504 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1505 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1506 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1507 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1508
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1509 list = filelist_filter(list, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1510
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1511 source = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1512 info_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1513 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1514 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1515 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1516 source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1517 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1518
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1519 if (list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1520 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1521 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1522
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1523 fd = list->data;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1524 if (isfile(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1525 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1526 view_slideshow_stop(vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1527 view_window_set_list(vw, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1528
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1529 if (source && info_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1530 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
1531 image_change_from_collection(imd, source, info_list->data, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1532 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1533 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1534 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1535 if (list->next)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1536 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1537 vw->list = list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1538 list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1539
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1540 vw->list_pointer = vw->list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1541 }
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
1542 image_change_fd(imd, fd, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1543 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1544 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1545 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1546 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1547 g_list_free(info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1548 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1549 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1550
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1551 static void view_window_set_dnd_data(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1552 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1553 guint time, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1554 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1555 ViewWindow *vw = data;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1556 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1557
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1558 fd = image_get_fd(vw->imd);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1559
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1560 if (fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1561 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1562 gchar *text = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1563 gint len;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1564 gint plain_text;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1565 GList *list;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1566
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1567 switch (info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1568 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1569 case TARGET_URI_LIST:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1570 plain_text = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1571 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1572 case TARGET_TEXT_PLAIN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1573 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1574 plain_text = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1575 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1576 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1577 list = g_list_append(NULL, fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1578 text = uri_text_from_filelist(list, &len, plain_text);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1579 g_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1580 if (text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1581 {
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 497
diff changeset
1582 gtk_selection_data_set(selection_data, selection_data->target,
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 497
diff changeset
1583 8, (guchar *)text, len);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1584 g_free(text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1585 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1586 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1587 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1588 {
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 497
diff changeset
1589 gtk_selection_data_set(selection_data, selection_data->target,
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 497
diff changeset
1590 8, NULL, 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1591 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1592 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1593
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1594 static void view_window_dnd_init(ViewWindow *vw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1595 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1596 ImageWindow *imd;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1597
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1598 imd = vw->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1599
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
1600 gtk_drag_source_set(imd->pr, GDK_BUTTON2_MASK,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1601 dnd_file_drag_types, dnd_file_drag_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1602 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
1603 g_signal_connect(G_OBJECT(imd->pr), "drag_data_get",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1604 G_CALLBACK(view_window_set_dnd_data), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1605
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
1606 gtk_drag_dest_set(imd->pr,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1607 GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1608 dnd_file_drop_types, dnd_file_drop_types_count,
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 369
diff changeset
1609 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
1610 g_signal_connect(G_OBJECT(imd->pr), "drag_data_received",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1611 G_CALLBACK(view_window_get_dnd_data), vw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1612 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1613
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1614 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1615 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1616 * maintenance (for rename, move, remove)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1617 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1618 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1619
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1620 static void view_real_removed(ViewWindow *vw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1621 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1622 ImageWindow *imd;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1623 FileData *image_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1624
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1625 imd = view_window_active_image(vw);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1626 image_fd = image_get_fd(imd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1627
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1628 if (image_fd && image_fd == fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1629 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1630 if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1631 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1632 view_list_step(vw, TRUE);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1633 if (image_get_fd(imd) == image_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1634 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1635 view_list_step(vw, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1636 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1637 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1638 else if (view_window_contains_collection(vw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1639 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1640 view_collection_step(vw, TRUE);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1641 if (image_get_fd(imd) == image_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1642 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1643 view_collection_step(vw, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1644 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1645 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1646 if (image_get_fd(imd) == image_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1647 {
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
1648 image_change_fd(imd, NULL, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1649 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1650 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1651
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1652 if (vw->list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1653 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1654 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1655 GList *old;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1656
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1657 old = vw->list_pointer;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1658
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1659 work = vw->list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1660 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1661 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1662 FileData *chk_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1663 GList *chk_link;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1664
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1665 chk_fd = work->data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1666 chk_link = work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1667 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1668
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1669 if (chk_fd == fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1670 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1671 if (vw->list_pointer == chk_link)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1672 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1673 vw->list_pointer = (chk_link->next) ? chk_link->next : chk_link->prev;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1674 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1675 vw->list = g_list_remove(vw->list, chk_fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1676 file_data_unref(chk_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1677 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1678 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1679
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1680 /* handles stepping correctly when same image is in the list more than once */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1681 if (old && old != vw->list_pointer)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1682 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1683 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1684
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1685 if (vw->list_pointer)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1686 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1687 fd = vw->list_pointer->data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1688 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1689 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1690 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 122
diff changeset
1691 fd = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1692 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1693
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 868
diff changeset
1694 image_change_fd(imd, fd, image_zoom_get_default(imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1695 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1696 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1697
117
0c2e1f0a001b Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 94
diff changeset
1698 image_osd_update(imd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1699 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1700
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1701 static void view_window_notify_cb(FileData *fd, NotifyType type, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1702 {
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1703 ViewWindow *vw = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1704
803
764fd82dd099 better check for notify type
nadvornik
parents: 797
diff changeset
1705 if (type != NOTIFY_TYPE_CHANGE || !fd->change) return;
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1706
1347
79937bc55f3a Add missing space between switch and first parenthesis.
zas_
parents: 1309
diff changeset
1707 switch (fd->change->type)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1708 {
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1709 case FILEDATA_CHANGE_MOVE:
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1710 case FILEDATA_CHANGE_RENAME:
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1711 break;
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1712 case FILEDATA_CHANGE_COPY:
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1713 break;
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1714 case FILEDATA_CHANGE_DELETE:
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1715 view_real_removed(vw, fd);
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1716 break;
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1717 case FILEDATA_CHANGE_UNSPECIFIED:
1211
e2bbe90b0dcd most of the metadata options now works
nadvornik
parents: 1055
diff changeset
1718 case FILEDATA_CHANGE_WRITE_METADATA:
797
799d035b9994 use new notification in img-view
nadvornik
parents: 783
diff changeset
1719 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1720 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 4
diff changeset
1721 }
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1029
diff changeset
1722 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */