annotate src/layout_image.c @ 1309:55ea4962887a

config file format changed to XML save and restore all layout windows save and restore sidebar configuration
author nadvornik
date Sun, 22 Feb 2009 15:35:37 +0000
parents 4a3ae0e6f1eb
children cd7204a18f14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 175
diff changeset
2 * Geeqie
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
3 * (C) 2006 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1273
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
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:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 278
diff changeset
13 #include "main.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "collect.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "dnd.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include "editors.h"
586
905688aa2317 split filelist.c to filefilter.c and filedata.c
nadvornik
parents: 530
diff changeset
19 #include "filedata.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include "fullscreen.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include "image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "image-overlay.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #include "img-view.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #include "layout.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 #include "layout_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #include "menu.h"
1022
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 995
diff changeset
27 #include "misc.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #include "pixbuf_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 #include "slideshow.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 #include "ui_menu.h"
904
1698baa37871 Move uri_*() functions to separate files: uri_utils.[ch]
zas_
parents: 888
diff changeset
32 #include "uri_utils.h"
1022
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 995
diff changeset
33 #include "utilops.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 #include <gdk/gdkkeysyms.h> /* for keyboard values */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 static void layout_image_set_buttons(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 * full screen overlay
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
47 void layout_image_overlay_toggle(LayoutWindow *lw)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 {
481
67a612985686 Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents: 479
diff changeset
49 if (!lw) return;
67a612985686 Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents: 479
diff changeset
50 image_osd_toggle(lw->image);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 * full screen
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 */
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
58
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 static void layout_image_full_screen_stop_func(FullScreenData *fs, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 /* restore image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 lw->image = fs->normal_imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 lw->slideshow->imd = lw->image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 lw->full_screen = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 void layout_image_full_screen_start(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 if (lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 lw->full_screen = fullscreen_start(lw->window, lw->image,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 layout_image_full_screen_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 /* set to new image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 lw->image = lw->full_screen->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 lw->slideshow->imd = lw->image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 layout_image_set_buttons(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 g_signal_connect(G_OBJECT(lw->full_screen->window), "key_press_event",
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
94 G_CALLBACK(layout_key_press_cb), lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
96 layout_actions_add_window(lw, lw->full_screen->window);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 gtk_widget_set_sensitive(lw->window, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
102 if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
103 {
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
104 image_osd_set(lw->image, image_osd_get(lw->full_screen->normal_imd));
614
b2898f04c82e image_osd_get() and image_osd_set() now uses flags.
zas_
parents: 586
diff changeset
105 image_osd_set(lw->full_screen->normal_imd, OSD_SHOW_NOTHING);
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
106 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109 void layout_image_full_screen_stop(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
111 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112 if (!lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
113
1252
fd16a3af0e88 fixed restoring of OSD at layout_image_full_screen_stop
nadvornik
parents: 1211
diff changeset
114 if (image_osd_get(lw->image) & OSD_SHOW_INFO)
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
115 image_osd_set(lw->full_screen->normal_imd, image_osd_get(lw->image));
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
116
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 fullscreen_stop(lw->full_screen);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120 gtk_widget_set_sensitive(lw->window, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121 if (lw->tools) gtk_widget_set_sensitive(lw->tools, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
124
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
125 void layout_image_full_screen_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128 if (lw->full_screen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
130 layout_image_full_screen_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 layout_image_full_screen_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
138 gint layout_image_full_screen_active(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
139 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142 return (lw->full_screen != NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
143 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 * slideshow
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
151 static void layout_image_slideshow_next(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
152 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153 if (lw->slideshow) slideshow_next(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
154 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156 static void layout_image_slideshow_prev(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
157 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 if (lw->slideshow) slideshow_prev(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
159 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 static void layout_image_slideshow_stop_func(SlideShowData *ss, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
162 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
165 lw->slideshow = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
166 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
167 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
168
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 void layout_image_slideshow_start(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
171 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
173
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
174 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
175 if (lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
177 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
179 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
180 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 lw->slideshow = slideshow_start_from_collection(lw->image, cd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
182 layout_image_slideshow_stop_func, lw, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
183 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
184 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
185 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
186 lw->slideshow = slideshow_start(lw->image, lw,
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
187 layout_list_get_index(lw, layout_image_get_fd(lw)),
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
192 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
193
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
194 /* note that slideshow will take ownership of the list, do not free it */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
195 void layout_image_slideshow_start_from_list(LayoutWindow *lw, GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
196 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
197 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
198
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
199 if (lw->slideshow || !list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
200 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
201 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
202 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
203 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
204
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
205 lw->slideshow = slideshow_start_from_filelist(lw->image, list,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
206 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
208 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
209 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
210
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
211 void layout_image_slideshow_stop(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
212 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
213 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
214
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
215 if (!lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
216
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
217 slideshow_free(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
218 /* the stop_func sets lw->slideshow to NULL for us */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
219 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
220
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
221 void layout_image_slideshow_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
222 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
223 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
224
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
225 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
226 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
227 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
228 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
229 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
230 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
231 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
232 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
233 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
234
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
235 gint layout_image_slideshow_active(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
236 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
237 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
238
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
239 return (lw->slideshow != NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
240 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
241
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
242 gint layout_image_slideshow_pause_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
243 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
244 gint ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
245
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
246 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
247
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
248 ret = slideshow_pause_toggle(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
249
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
250 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
251
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
252 return ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
253 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
254
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
255 gint layout_image_slideshow_paused(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
256 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
257 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
258
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
259 return (slideshow_paused(lw->slideshow));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
260 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
261
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
262 static gint layout_image_slideshow_continue_check(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
263 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
264 if (!lw->slideshow) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
265
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
266 if (!slideshow_should_continue(lw->slideshow))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
267 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
268 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
269 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
270 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
271
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
272 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
273 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
274
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
275 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
276 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
277 * pop-up menus
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
278 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
279 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
280
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
281 static void li_pop_menu_zoom_in_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
282 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
283 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
284
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
285 layout_image_zoom_adjust(lw, get_zoom_increment(), FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
286 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
287
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
288 static void li_pop_menu_zoom_out_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
289 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
290 LayoutWindow *lw = data;
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
291 layout_image_zoom_adjust(lw, -get_zoom_increment(), FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
292 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
293
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
294 static void li_pop_menu_zoom_1_1_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
295 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
296 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
297
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
298 layout_image_zoom_set(lw, 1.0, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
299 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
300
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
301 static void li_pop_menu_zoom_fit_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
302 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
303 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
304
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
305 layout_image_zoom_set(lw, 0.0, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
306 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
307
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
308 static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
309 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
310 LayoutWindow *lw;
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1269
diff changeset
311 const gchar *key = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
312
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
313 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
314
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1269
diff changeset
315 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
316 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
317 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
318 }
1272
e0e12512cde2 read external editors from .desktop files
nadvornik
parents: 1269
diff changeset
319 file_util_start_editor_from_file(key, layout_image_get_fd(lw), lw->window);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
320 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
321
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
322 static void li_pop_menu_wallpaper_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
323 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
325
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
326 layout_image_to_root(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
327 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
328
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
329 static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
330 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
332 AlterType type;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
335 type = (AlterType)GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
336
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
337 image_alter(lw->image, type);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
338 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
339
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
340 static void li_pop_menu_new_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
341 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
342 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
343
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
344 view_window_new(layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
345 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
346
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
347 static GtkWidget *li_pop_menu_click_parent(GtkWidget *widget, LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
348 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
349 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350 GtkWidget *parent;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
351
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
352 menu = gtk_widget_get_toplevel(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
353 if (!menu) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
354
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
355 parent = g_object_get_data(G_OBJECT(menu), "click_parent");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
356
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357 if (!parent && lw->full_screen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359 parent = lw->full_screen->imd->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
360 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
361
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
362 return parent;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
363 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
364
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
365 static void li_pop_menu_copy_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
366 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
367 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
368
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
369 file_util_copy(layout_image_get_fd(lw), NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
371 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
372
497
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
373 static void li_pop_menu_copy_path_cb(GtkWidget *widget, gpointer data)
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
374 {
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
375 LayoutWindow *lw = data;
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
376
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
377 file_util_copy_path_to_clipboard(layout_image_get_fd(lw));
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
378 }
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
379
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
380 static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
384 file_util_move(layout_image_get_fd(lw), NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
386 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
387
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388 static void li_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
389 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
391
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
392 file_util_rename(layout_image_get_fd(lw), NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
394 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
395
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
396 static void li_pop_menu_delete_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
397 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
398 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
399
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
400 file_util_delete(layout_image_get_fd(lw), NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
401 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
402 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
403
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
404 static void li_pop_menu_slide_start_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
405 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
406 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
407
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
408 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
409 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
410
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
411 static void li_pop_menu_slide_stop_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
412 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
413 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
414
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
415 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
416 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
417
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
418 static void li_pop_menu_slide_pause_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
419 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
420 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
421
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
422 layout_image_slideshow_pause_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
423 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
424
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
425 static void li_pop_menu_full_screen_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
426 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
427 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
428
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
429 layout_image_full_screen_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
430 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
431
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
432 static void li_pop_menu_hide_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
433 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
434 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
435
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
436 layout_tools_hide_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
437 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
438
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
439 static void li_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: 339
diff changeset
440 {
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
441 LayoutWindow *lw = data;
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
442 FileData *fd;
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
443
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
444 if (!layout_valid(&lw)) return;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
445
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
446 fd = layout_image_get_fd(lw);
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
447 if (fd) layout_set_fd(lw, fd);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
448 }
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
449
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
450 static gint li_check_if_current_path(LayoutWindow *lw, const gchar *path)
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
451 {
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
452 gchar *dirname;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
453 gint ret;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
454
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
455 if (!path || !layout_valid(&lw) || !lw->dir_fd) return FALSE;
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
456
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
457 dirname = g_path_get_dirname(path);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
458 ret = (strcmp(lw->dir_fd->path, dirname) == 0);
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
459 g_free(dirname);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
460 return ret;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
461 }
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
462
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
463 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
464 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
465 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
466 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
467 GtkWidget *submenu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
468 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
469 gint fullscreen;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
470
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
471 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
472 fullscreen = layout_image_full_screen_active(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
473
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
474 menu = popup_menu_short_lived();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
475
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
476 menu_item_add_stock(menu, _("Zoom _in"), GTK_STOCK_ZOOM_IN, G_CALLBACK(li_pop_menu_zoom_in_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
477 menu_item_add_stock(menu, _("Zoom _out"), GTK_STOCK_ZOOM_OUT, G_CALLBACK(li_pop_menu_zoom_out_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
478 menu_item_add_stock(menu, _("Zoom _1:1"), GTK_STOCK_ZOOM_100, G_CALLBACK(li_pop_menu_zoom_1_1_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
479 menu_item_add_stock(menu, _("Fit image to _window"), GTK_STOCK_ZOOM_FIT, G_CALLBACK(li_pop_menu_zoom_fit_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
480 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
481
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
482 submenu = submenu_add_edit(menu, &item, G_CALLBACK(li_pop_menu_edit_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
483 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
484 menu_item_add_divider(submenu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
485 menu_item_add(submenu, _("Set as _wallpaper"), G_CALLBACK(li_pop_menu_wallpaper_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
486
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
487 item = submenu_add_alter(menu, G_CALLBACK(li_pop_menu_alter_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
488
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
489 item = menu_item_add_stock(menu, _("View in _new window"), GTK_STOCK_NEW, G_CALLBACK(li_pop_menu_new_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
490 if (!path || fullscreen) gtk_widget_set_sensitive(item, FALSE);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
491
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
492 item = menu_item_add(menu, _("_Go to directory view"), G_CALLBACK(li_set_layout_path_cb), lw);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
493 if (!path || li_check_if_current_path(lw, path)) gtk_widget_set_sensitive(item, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
494
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
495 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
496
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
497 item = menu_item_add_stock(menu, _("_Copy..."), GTK_STOCK_COPY, G_CALLBACK(li_pop_menu_copy_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
498 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
499 item = menu_item_add(menu, _("_Move..."), G_CALLBACK(li_pop_menu_move_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
500 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
501 item = menu_item_add(menu, _("_Rename..."), G_CALLBACK(li_pop_menu_rename_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
502 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
503 item = menu_item_add_stock(menu, _("_Delete..."), GTK_STOCK_DELETE, G_CALLBACK(li_pop_menu_delete_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
504 if (!path) gtk_widget_set_sensitive(item, FALSE);
497
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
505
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
506 if (options->show_copy_path)
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
507 {
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
508 item = menu_item_add(menu, _("_Copy path"), G_CALLBACK(li_pop_menu_copy_path_cb), lw);
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
509 if (!path) gtk_widget_set_sensitive(item, FALSE);
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
510 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
511
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
512 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
513
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
514 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
515 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
516 menu_item_add(menu, _("_Stop slideshow"), G_CALLBACK(li_pop_menu_slide_stop_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
517 if (layout_image_slideshow_paused(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
518 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
519 item = menu_item_add(menu, _("Continue slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
520 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
521 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
522 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
523 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
524 item = menu_item_add(menu, _("Pause slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
525 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
526 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
527 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
528 else
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
529 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
530 menu_item_add(menu, _("_Start slideshow"), G_CALLBACK(li_pop_menu_slide_start_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
531 item = menu_item_add(menu, _("Pause slides_how"), G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
532 gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
533 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
534
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
535 if (!fullscreen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
536 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
537 menu_item_add(menu, _("_Full screen"), G_CALLBACK(li_pop_menu_full_screen_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
538 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
539 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
540 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
541 menu_item_add(menu, _("Exit _full screen"), G_CALLBACK(li_pop_menu_full_screen_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
542 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
543
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
544 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
545
1309
55ea4962887a config file format changed to XML
nadvornik
parents: 1292
diff changeset
546 item = menu_item_add_check(menu, _("Hide file _list"), lw->options.tools_hidden,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
547 G_CALLBACK(li_pop_menu_hide_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
548 if (fullscreen) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
549
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
550 return menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
551 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
552
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
553 static void layout_image_menu_pos_cb(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
554 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
555 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
556
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
557 gdk_window_get_origin(lw->image->pr->window, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
558 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
559 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
560
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
561 void layout_image_menu_popup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
562 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
563 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
564
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
565 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
566 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, layout_image_menu_pos_cb, lw, 0, GDK_CURRENT_TIME);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
567 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
568
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
569 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
570 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
571 * dnd
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
572 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
573 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
574
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
575 static void layout_image_dnd_receive(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
576 gint x, gint y,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
577 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
578 guint time, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
579 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
580 LayoutWindow *lw = data;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
581 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
582
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
583
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
584 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
585 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
586 if (lw->split_images[i] && lw->split_images[i]->pr == widget)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
587 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
588 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
589 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
590 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 497
diff changeset
591 DEBUG_1("dnd image activate %d", i);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
592 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
593 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
594
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
595
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
596 if (info == TARGET_URI_LIST || info == TARGET_APP_COLLECTION_MEMBER)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
597 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
598 CollectionData *source;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
599 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
600 GList *info_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
601
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
602 if (info == TARGET_URI_LIST)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
603 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
604 list = uri_filelist_from_text((gchar *)selection_data->data, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
605 source = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
606 info_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
607 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
608 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
609 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
610 source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
611 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
612
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
613 if (list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
614 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
615 FileData *fd = list->data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
616
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
617 if (isfile(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
618 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
619 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
620 gint row;
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
621 FileData *dir_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
622
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
623 base = remove_level_from_path(fd->path);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
624 dir_fd = file_data_new_simple(base);
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
625 if (dir_fd != lw->dir_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
626 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
627 layout_set_fd(lw, dir_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
628 }
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
629 file_data_unref(dir_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
630 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
631
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
632 row = layout_list_get_index(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
633 if (source && info_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
634 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
635 layout_image_set_collection(lw, source, info_list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
636 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
637 else if (row == -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
638 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
639 layout_image_set_fd(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
640 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
641 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
642 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
643 layout_image_set_index(lw, row);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
644 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
645 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
646 else if (isdir(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
647 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
648 layout_set_fd(lw, fd);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
649 layout_image_set_fd(lw, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
650 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
651 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
652
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
653 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
654 g_list_free(info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
655 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
656 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
657
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
658 static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
659 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
660 guint time, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
661 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
662 LayoutWindow *lw = data;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
663 FileData *fd;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
664 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
665
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
666
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
667 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
668 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
669 if (lw->split_images[i] && lw->split_images[i]->pr == widget)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
670 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
671 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
672 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
673 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 497
diff changeset
674 DEBUG_1("dnd get from %d", i);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
675 fd = image_get_fd(lw->split_images[i]);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
676 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
677 else
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
678 fd = layout_image_get_fd(lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
679
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
680 if (fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
681 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
682 gchar *text = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
683 gint len;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
684 gint plain_text;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
685 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
686
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
687 switch (info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
688 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
689 case TARGET_URI_LIST:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
690 plain_text = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
691 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
692 case TARGET_TEXT_PLAIN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
693 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
694 plain_text = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
695 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
696 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
697 list = g_list_append(NULL, fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
698 text = uri_text_from_filelist(list, &len, plain_text);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
699 g_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
700 if (text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
701 {
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
702 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: 507
diff changeset
703 8, (guchar *)text, len);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
704 g_free(text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
705 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
706 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
707 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
708 {
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
709 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: 507
diff changeset
710 8, NULL, 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
711 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
712 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
713
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
714 static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
715 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
716 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
717 if (context->action == GDK_ACTION_MOVE)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
718 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
719 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
720 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
721
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
722 fd = layout_image_get_fd(lw);
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
723 row = layout_list_get_index(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
724 if (row < 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
725
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
726 if (!isfile(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
727 {
736
a7289f9e8d29 Fix signed vs unsigned warnings.
zas_
parents: 671
diff changeset
728 if ((guint) row < layout_list_count(lw, NULL) - 1)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
729 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
730 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
731 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
732 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
733 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
734 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
735 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
736 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
737 layout_refresh(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
738 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
739 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
740
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
741 static void layout_image_dnd_init(LayoutWindow *lw, gint i)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
742 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
743 ImageWindow *imd = lw->split_images[i];
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
744
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
745 gtk_drag_source_set(imd->pr, GDK_BUTTON2_MASK,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
746 dnd_file_drag_types, dnd_file_drag_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
747 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
748 g_signal_connect(G_OBJECT(imd->pr), "drag_data_get",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
749 G_CALLBACK(layout_image_dnd_get), lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
750 g_signal_connect(G_OBJECT(imd->pr), "drag_end",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
751 G_CALLBACK(layout_image_dnd_end), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
752
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
753 gtk_drag_dest_set(imd->pr,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
754 GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
755 dnd_file_drop_types, dnd_file_drop_types_count,
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
756 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
757 g_signal_connect(G_OBJECT(imd->pr), "drag_data_received",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
758 G_CALLBACK(layout_image_dnd_receive), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
759 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
760
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
761
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
762 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
763 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
764 * misc
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
765 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
766 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
767
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
768 void layout_image_to_root(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
769 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
770 image_to_root_window(lw->image, (image_zoom_get(lw->image) == 0));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
771 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
772
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
773 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
774 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
775 * manipulation + accessors
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
776 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
777 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
778
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
779 void layout_image_scroll(LayoutWindow *lw, gint x, gint y, gboolean connect_scroll)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
780 {
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
781 gdouble dx, dy;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
782 gint width, height, i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
783 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
784
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
785 image_scroll(lw->image, x, y);
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
786
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
787 if (!connect_scroll) return;
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
788
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
789 image_get_image_size(lw->image, &width, &height);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
790 dx = (gdouble) x / width;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
791 dy = (gdouble) y / height;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
792
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
793 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
794 {
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
795 if (lw->split_images[i] && lw->split_images[i] != lw->image)
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
796 {
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
797 gdouble sx, sy;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
798 image_get_scroll_center(lw->split_images[i], &sx, &sy);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
799 sx += dx;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
800 sy += dy;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
801 image_set_scroll_center(lw->split_images[i], sx, sy);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
802 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
803 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
804
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
805 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
806
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
807 void layout_image_zoom_adjust(LayoutWindow *lw, gdouble increment, gboolean connect_zoom)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
808 {
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
809 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
810 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
811
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
812 image_zoom_adjust(lw->image, increment);
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
813
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
814 if (!connect_zoom) return;
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
815
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
816 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
817 {
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
818 if (lw->split_images[i] && lw->split_images[i] != lw->image)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
819 image_zoom_adjust(lw->split_images[i], increment); ;
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
820 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
821 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
822
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
823 void layout_image_zoom_adjust_at_point(LayoutWindow *lw, gdouble increment, gint x, gint y, gboolean connect_zoom)
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
824 {
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
825 gint i;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
826 if (!layout_valid(&lw)) return;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
827
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
828 image_zoom_adjust_at_point(lw->image, increment, x, y);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
829
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
830 if (!connect_zoom) return;
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
831
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
832 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
833 {
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
834 if (lw->split_images[i] && lw->split_images[i] != lw->image)
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
835 image_zoom_adjust_at_point(lw->split_images[i], increment, x, y);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
836 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
837 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
838
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
839 void layout_image_zoom_set(LayoutWindow *lw, gdouble zoom, gboolean connect_zoom)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
840 {
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
841 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
842 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
843
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
844 image_zoom_set(lw->image, zoom);
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
845
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
846 if (!connect_zoom) return;
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
847
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
848 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
849 {
879
0f85435ac335 Optimize a bit when connected zoom and scrolling are unset,
zas_
parents: 869
diff changeset
850 if (lw->split_images[i] && lw->split_images[i] != lw->image)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
851 image_zoom_set(lw->split_images[i], zoom);
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
852 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
853 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
854
1269
08b4598c7cba gint -> gboolean.
zas_
parents: 1252
diff changeset
855 void layout_image_zoom_set_fill_geometry(LayoutWindow *lw, gboolean vertical, gboolean connect_zoom)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
856 {
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
857 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
858 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
859
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
860 image_zoom_set_fill_geometry(lw->image, vertical);
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
861
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
862 if (!connect_zoom) return;
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
863
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
864 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
865 {
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
866 if (lw->split_images[i] && lw->split_images[i] != lw->image)
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
867 image_zoom_set_fill_geometry(lw->split_images[i], vertical);
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
868 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
869 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
870
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
871 void layout_image_alter(LayoutWindow *lw, AlterType type)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
872 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
873 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
874
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
875 image_alter(lw->image, type);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
876 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
877
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
878 const gchar *layout_image_get_path(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
879 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
880 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
881
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
882 return image_get_path(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
883 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
884
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
885 const gchar *layout_image_get_name(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
886 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
887 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
888
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
889 return image_get_name(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
890 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
891
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
892 FileData *layout_image_get_fd(LayoutWindow *lw)
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
893 {
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
894 if (!layout_valid(&lw)) return NULL;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
895
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
896 return image_get_fd(lw->image);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
897 }
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
898
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
899 CollectionData *layout_image_get_collection(LayoutWindow *lw, CollectInfo **info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
900 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
901 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
902
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
903 return image_get_collection(lw->image, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
904 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
905
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
906 gint layout_image_get_index(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
907 {
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
908 return layout_list_get_index(lw, image_get_fd(lw->image));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
909 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
910
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
911 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
912 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
913 * image changers
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
914 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
915 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
916
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
917 void layout_image_set_fd(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
918 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
919 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
920
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 879
diff changeset
921 image_change_fd(lw->image, fd, image_zoom_get_default(lw->image));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
922
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
923 layout_list_sync_fd(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
924 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
925 layout_bars_new_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
926 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
927
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
928 void layout_image_set_with_ahead(LayoutWindow *lw, FileData *fd, FileData *read_ahead_fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
929 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
930 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
931
144
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
932 /*
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
933 This should be handled at the caller: in vflist_select_image
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
934 if (path)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
935 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
936 const gchar *old_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
937
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
938 old_path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
939 if (old_path && strcmp(path, old_path) == 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
940 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
941 */
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
942 layout_image_set_fd(lw, fd);
334
df868b947aa0 Rename image-related options.
zas_
parents: 327
diff changeset
943 if (options->image.enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
944 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
945
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
946 void layout_image_set_index(LayoutWindow *lw, gint index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
947 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
948 FileData *fd;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
949 FileData *read_ahead_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
950 gint old;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
951
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
952 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
953
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
954 old = layout_list_get_index(lw, layout_image_get_fd(lw));
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
955 fd = layout_list_get_fd(lw, index);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
956
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
957 if (old > index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
958 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
959 read_ahead_fd = layout_list_get_fd(lw, index - 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
960 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
961 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
962 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
963 read_ahead_fd = layout_list_get_fd(lw, index + 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
964 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
965
995
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
966 if (layout_selection_count(lw, 0) > 1)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
967 {
995
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
968 GList *x = layout_selection_list_by_index(lw);
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
969 GList *y;
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
970 GList *last;
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
971
995
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
972 for (last = y = x; y; y = y->next)
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
973 last = y;
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
974 for (y = x; y && (GPOINTER_TO_INT(y->data)) != index; y = y->next)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
975 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
976
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
977 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
978 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
979 gint newindex;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
980
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
981 if ((index > old && (index != GPOINTER_TO_INT(last->data) || old != GPOINTER_TO_INT(x->data)))
995
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
982 || (old == GPOINTER_TO_INT(last->data) && index == GPOINTER_TO_INT(x->data)))
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
983 {
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
984 if (y->next)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
985 newindex = GPOINTER_TO_INT(y->next->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
986 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
987 newindex = GPOINTER_TO_INT(x->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
988 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
989 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
990 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
991 if (y->prev)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
992 newindex = GPOINTER_TO_INT(y->prev->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
993 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
994 newindex = GPOINTER_TO_INT(last->data);
995
6ca2c5fd7b13 Whitespaces cleanup.
zas_
parents: 993
diff changeset
995 }
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
996
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
997 read_ahead_fd = layout_list_get_fd(lw, newindex);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
998 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
999
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1000 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1001 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1002 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1003
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1004 layout_image_set_with_ahead(lw, fd, read_ahead_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1005 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1006
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1007 static void layout_image_set_collection_real(LayoutWindow *lw, CollectionData *cd, CollectInfo *info, gint forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1008 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1009 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1010
885
ad420f2eb789 Use a specific enum for image.zoom_mode values (ZoomMode) and
zas_
parents: 879
diff changeset
1011 image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image));
334
df868b947aa0 Rename image-related options.
zas_
parents: 327
diff changeset
1012 if (options->image.enable_read_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1013 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1014 CollectInfo *r_info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1015 if (forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1016 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1017 r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1018 if (!r_info) r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1019 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1020 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1021 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1022 r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1023 if (!r_info) r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1024 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1025 if (r_info) image_prebuffer_set(lw->image, r_info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1026 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1027
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1028 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1029 layout_bars_new_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1030 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1031
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1032 void layout_image_set_collection(LayoutWindow *lw, CollectionData *cd, CollectInfo *info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1033 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1034 layout_image_set_collection_real(lw, cd, info, TRUE);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1035 layout_list_sync_fd(lw, layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1036 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1037
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1038 void layout_image_refresh(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1039 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1040 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1041
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1042 image_reload(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1043 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1044
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1045 void layout_image_color_profile_set(LayoutWindow *lw,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1046 gint input_type, gint screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1047 gint use_image)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1048 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1049 if (!layout_valid(&lw)) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1050
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1051 image_color_profile_set(lw->image, input_type, screen_type, use_image);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1052 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1053
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1054 gint layout_image_color_profile_get(LayoutWindow *lw,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1055 gint *input_type, gint *screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1056 gint *use_image)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1057 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1058 if (!layout_valid(&lw)) return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1059
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1060 return image_color_profile_get(lw->image, input_type, screen_type, use_image);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1061 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1062
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1063 void layout_image_color_profile_set_use(LayoutWindow *lw, gint enable)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1064 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1065 if (!layout_valid(&lw)) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1066
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1067 image_color_profile_set_use(lw->image, enable);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1068
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1069 if (lw->info_color)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1070 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1071 #ifndef HAVE_LCMS
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1072 enable = FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1073 #endif
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1074 gtk_widget_set_sensitive(GTK_BIN(lw->info_color)->child, enable);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1075 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1076 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1077
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1078 gint layout_image_color_profile_get_use(LayoutWindow *lw)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1079 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1080 if (!layout_valid(&lw)) return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1081
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1082 return image_color_profile_get_use(lw->image);
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1083 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1084
426
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1085 gint layout_image_color_profile_get_from_image(LayoutWindow *lw)
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1086 {
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1087 if (!layout_valid(&lw)) return FALSE;
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1088
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1089 return image_color_profile_get_from_image(lw->image);
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1090 }
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1091
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1092 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1093 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1094 * list walkers
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1095 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1096 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1097
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1098 void layout_image_next(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1099 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1100 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1101 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1102 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1103
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1104 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1105
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1106 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1107 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1108 layout_image_slideshow_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1109 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1110 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1111
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1112 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1113 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1114 GList *x = layout_selection_list_by_index(lw);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
1115 gint old = layout_list_get_index(lw, layout_image_get_fd(lw));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1116 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1117
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1118 for (y = x; y && (GPOINTER_TO_INT(y->data)) != old; y = y->next)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1119 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1120 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1121 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1122 if (y->next)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1123 layout_image_set_index(lw, GPOINTER_TO_INT(y->next->data));
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1124 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1125 layout_image_set_index(lw, GPOINTER_TO_INT(x->data));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1126 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1127 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1128 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1129 if (y) /* not dereferenced */
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1130 return;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1131 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1132
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1133 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1134
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1135 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1136 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1137 info = collection_next_by_info(cd, info);
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1138 if (info)
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1139 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1140 layout_image_set_collection_real(lw, cd, info, TRUE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1141 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1142 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1143 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1144 image_osd_icon(lw->image, IMAGE_OSD_LAST, -1);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1145 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1146 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1147 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1148
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1149 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1150
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1151 if (current >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1152 {
736
a7289f9e8d29 Fix signed vs unsigned warnings.
zas_
parents: 671
diff changeset
1153 if ((guint) current < layout_list_count(lw, NULL) - 1)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1154 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1155 layout_image_set_index(lw, current + 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1156 }
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1157 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1158 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1159 image_osd_icon(lw->image, IMAGE_OSD_LAST, -1);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1160 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1161 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1162 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1163 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1164 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1165 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1166 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1167
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1168 void layout_image_prev(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1169 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1170 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1171 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1172 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1173
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1174 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1175
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1176 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1177 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1178 layout_image_slideshow_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1179 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1180 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1181
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1182 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1183 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1184 GList *x = layout_selection_list_by_index(lw);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
1185 gint old = layout_list_get_index(lw, layout_image_get_fd(lw));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1186 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1187 GList *last;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1188
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1189 for (last = y = x; y; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1190 last = y;
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1191 for (y = x; y && (GPOINTER_TO_INT(y->data)) != old; y = y->next)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1192 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1193 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1194 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1195 if (y->prev)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1196 layout_image_set_index(lw, GPOINTER_TO_INT(y->prev->data));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1197 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1198 layout_image_set_index(lw, GPOINTER_TO_INT(last->data));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1199 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1200 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1201 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1202 if (y) /* not dereferenced */
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1203 return;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1204 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1205
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1206 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1207
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1208 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1209 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1210 info = collection_prev_by_info(cd, info);
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1211 if (info)
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1212 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1213 layout_image_set_collection_real(lw, cd, info, FALSE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1214 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1215 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1216 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1217 image_osd_icon(lw->image, IMAGE_OSD_FIRST, -1);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1218 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1219 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1220 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1221
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1222 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1223
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1224 if (current >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1225 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1226 if (current > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1227 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1228 layout_image_set_index(lw, current - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1229 }
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1230 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1231 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1232 image_osd_icon(lw->image, IMAGE_OSD_FIRST, -1);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1233 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1234 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1235 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1236 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1237 layout_image_set_index(lw, layout_list_count(lw, NULL) - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1238 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1239 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1240
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1241 void layout_image_first(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1242 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1243 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1244 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1245 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1246
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1247 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1248
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1249 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1250
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1251 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1252 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1253 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1254 new = collection_get_first(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1255 if (new != info) layout_image_set_collection_real(lw, cd, new, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1256 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1257 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1258
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1259 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1260 if (current != 0 && layout_list_count(lw, NULL) > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1261 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1262 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1263 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1264 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1265
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1266 void layout_image_last(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1267 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1268 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1269 gint count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1270 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1271 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1272
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1273 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1274
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1275 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1276
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1277 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1278 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1279 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1280 new = collection_get_last(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1281 if (new != info) layout_image_set_collection_real(lw, cd, new, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1282 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1283 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1284
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1285 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1286 count = layout_list_count(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1287 if (current != count - 1 && count > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1288 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1289 layout_image_set_index(lw, count - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1290 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1291 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1292
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1293 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1294 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1295 * mouse callbacks
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1296 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1297 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1298
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1299 static gint image_idx(LayoutWindow *lw, ImageWindow *imd)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1300 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1301 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1302
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1303 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1304 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1305 if (lw->split_images[i] == imd)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1306 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1307 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1308 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1309 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1310 return i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1311 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1312 return -1;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1313 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1314
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1315
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1316 static void layout_image_button_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1317 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1318 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1319 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1320
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1321 switch (event->button)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1322 {
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1323 case MOUSE_BUTTON_LEFT:
1286
eba0b4ae413b do not switch to the next image on mouse click in split mode
nadvornik
parents: 1284
diff changeset
1324 if (lw->split_mode == SPLIT_NONE)
eba0b4ae413b do not switch to the next image on mouse click in split mode
nadvornik
parents: 1284
diff changeset
1325 layout_image_next(lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1326 break;
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1327 case MOUSE_BUTTON_MIDDLE:
1286
eba0b4ae413b do not switch to the next image on mouse click in split mode
nadvornik
parents: 1284
diff changeset
1328 if (lw->split_mode == SPLIT_NONE)
eba0b4ae413b do not switch to the next image on mouse click in split mode
nadvornik
parents: 1284
diff changeset
1329 layout_image_prev(lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1330 break;
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1331 case MOUSE_BUTTON_RIGHT:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1332 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1333 if (imd == lw->image)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1334 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1335 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1336 }
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1337 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, event->time);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1338 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1339 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1340 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1341 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1342 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1343
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1344 static void layout_image_scroll_cb(ImageWindow *imd, GdkEventScroll *event, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1345 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1346 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1347
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1348 gint i = image_idx(lw, imd);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1349
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1350 if (i != -1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1351 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 497
diff changeset
1352 DEBUG_1("image activate scroll %d", i);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1353 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1354 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1355
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1356
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1357 if (event->state & GDK_CONTROL_MASK)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1358 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1359 switch (event->direction)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1360 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1361 case GDK_SCROLL_UP:
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
1362 layout_image_zoom_adjust_at_point(lw, get_zoom_increment(), event->x, event->y, event->state & GDK_SHIFT_MASK);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1363 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1364 case GDK_SCROLL_DOWN:
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
1365 layout_image_zoom_adjust_at_point(lw, -get_zoom_increment(), event->x, event->y, event->state & GDK_SHIFT_MASK);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1366 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1367 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1368 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1369 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1370 }
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
1371 else if (options->mousewheel_scrolls)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1372 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1373 switch (event->direction)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1374 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1375 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1376 image_scroll(imd, 0, -MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1377 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1378 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1379 image_scroll(imd, 0, MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1380 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1381 case GDK_SCROLL_LEFT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1382 image_scroll(imd, -MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1383 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1384 case GDK_SCROLL_RIGHT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1385 image_scroll(imd, MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1386 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1387 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1388 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1389 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1390 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1391 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1392 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1393 switch (event->direction)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1394 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1395 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1396 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1397 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1398 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1399 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1400 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1401 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1402 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1403 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1404 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1405 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1406
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1407 static void layout_image_drag_cb(ImageWindow *imd, GdkEventButton *event, gdouble dx, gdouble dy, gpointer data)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1408 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1409 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1410 LayoutWindow *lw = data;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1411
1047
81ec7d977d5f use SHIFT for connected scroll and zoom
nadvornik
parents: 1043
diff changeset
1412 if (!(event->state & GDK_SHIFT_MASK)) return;
869
371a1c3d4504 layout_image_drag_cb(): optimize when connected scrolling is unset.
zas_
parents: 868
diff changeset
1413
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1414 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1415 {
869
371a1c3d4504 layout_image_drag_cb(): optimize when connected scrolling is unset.
zas_
parents: 868
diff changeset
1416 if (lw->split_images[i] && lw->split_images[i] != imd)
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1417 {
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1418 gdouble sx, sy;
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1419
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1420 if (event->state & GDK_CONTROL_MASK)
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1421 {
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1422 image_get_scroll_center(imd, &sx, &sy);
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1423 }
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1424 else
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1425 {
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1426 image_get_scroll_center(lw->split_images[i], &sx, &sy);
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1427 sx += dx;
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1428 sy += dy;
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1429 }
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1430 image_set_scroll_center(lw->split_images[i], sx, sy);
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1431 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1432 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1433 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1434
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1435 static void layout_image_button_inactive_cb(ImageWindow *imd, GdkEventButton *event, gpointer data)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1436 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1437 LayoutWindow *lw = data;
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1438 GtkWidget *menu;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1439 gint i = image_idx(lw, imd);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1440
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1441 if (i != -1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1442 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1443 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1444 }
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1445
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1446 switch (event->button)
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1447 {
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1448 case MOUSE_BUTTON_RIGHT:
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1449 menu = layout_image_pop_menu(lw);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1450 if (imd == lw->image)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1451 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1452 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1453 }
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1454 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, event->time);
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1455 break;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1456 default:
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1457 break;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1458 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1459
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1460 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1461
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1462 static void layout_image_drag_inactive_cb(ImageWindow *imd, GdkEventButton *event, gdouble dx, gdouble dy, gpointer data)
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1463 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1464 LayoutWindow *lw = data;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1465 gint i = image_idx(lw, imd);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1466
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1467 if (i != -1)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1468 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1469 layout_image_activate(lw, i);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1470 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1471
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1472 /* continue as with active image */
868
db6977f8b0f1 Reduce number of parameters (mostly unused), just pass the event pointer.
zas_
parents: 837
diff changeset
1473 layout_image_drag_cb(imd, event, dx, dy, data);
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1474 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1475
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1476
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1477 static void layout_image_set_buttons(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1478 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1479 image_set_button_func(lw->image, layout_image_button_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1480 image_set_scroll_func(lw->image, layout_image_scroll_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1481 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1482
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1483 static void layout_image_set_buttons_inactive(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1484 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1485 image_set_button_func(lw->split_images[i], layout_image_button_inactive_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1486 image_set_scroll_func(lw->split_images[i], layout_image_scroll_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1487 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1488
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1489 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1490 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1491 * setup
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1492 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1493 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1494
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1495 static void layout_image_update_cb(ImageWindow *imd, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1496 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1497 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1498 layout_status_update_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1499 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1500
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1501 GtkWidget *layout_image_new(LayoutWindow *lw, gint i)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1502 {
837
f8c22438376c use GtkSizeGroup to control initial size of split images
nadvornik
parents: 836
diff changeset
1503 if (!lw->split_image_sizegroup) lw->split_image_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
f8c22438376c use GtkSizeGroup to control initial size of split images
nadvornik
parents: 836
diff changeset
1504
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1505 if (!lw->split_images[i])
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1506 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1507 lw->split_images[i] = image_new(TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1508
1043
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1509 #if GTK_CHECK_VERSION(2,12,0)
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1510 g_object_ref(lw->split_images[i]->widget);
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1511 #else
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1512 gtk_widget_ref(lw->split_images[i]->widget);
1043
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1513 #endif
339
de1c2cd06fce Rename user_specified_window_background and window_background_color
zas_
parents: 334
diff changeset
1514 image_background_set_color(lw->split_images[i], options->image.use_custom_border_color ? &options->image.border_color : NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1515
888
d8e1e820cee7 reload changed images
nadvornik
parents: 885
diff changeset
1516 image_auto_refresh_enable(lw->split_images[i], TRUE);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1517
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1518 layout_image_dnd_init(lw, i);
207
ec068409bee7 fixed color management initialization
nadvornik
parents: 196
diff changeset
1519 image_color_profile_set(lw->split_images[i],
327
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1520 options->color_profile.input_type,
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1521 options->color_profile.screen_type,
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1522 options->color_profile.use_image);
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1523 image_color_profile_set_use(lw->split_images[i], options->color_profile.enabled);
837
f8c22438376c use GtkSizeGroup to control initial size of split images
nadvornik
parents: 836
diff changeset
1524
f8c22438376c use GtkSizeGroup to control initial size of split images
nadvornik
parents: 836
diff changeset
1525 gtk_size_group_add_widget(lw->split_image_sizegroup, lw->split_images[i]->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1526 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1527
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1528 return lw->split_images[i]->widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1529 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1530
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1531 void layout_image_deactivate(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1532 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1533
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1534 if (!lw->split_images[i]) return;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1535 image_set_update_func(lw->split_images[i], NULL, NULL);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1536 layout_image_set_buttons_inactive(lw, i);
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1537 image_set_drag_func(lw->split_images[i], layout_image_drag_inactive_cb, lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1538
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1539 image_attach_window(lw->split_images[i], NULL, NULL, NULL, FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1540 image_select(lw->split_images[i], FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1541 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1542
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1543
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1544 void layout_image_activate(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1545 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1546 FileData *fd;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1547
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1548 if (!lw->split_images[i]) return;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1549
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1550 /* deactivate currently active */
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1551 if (lw->active_split_image != i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1552 layout_image_deactivate(lw, lw->active_split_image);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1553
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1554 lw->image = lw->split_images[i];
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1555 lw->active_split_image = i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1556
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1557 image_set_update_func(lw->image, layout_image_update_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1558 layout_image_set_buttons(lw);
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1559 image_set_drag_func(lw->image, layout_image_drag_cb, lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1560
288
d1f74154463e Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents: 281
diff changeset
1561 image_attach_window(lw->image, lw->window, NULL, GQ_APPNAME, FALSE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1562
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1563 /* do not hilight selected image in SPLIT_NONE */
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1564 /* maybe the image should be selected always and hilight should be controled by
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1565 another image option */
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1566 if (lw->split_mode != SPLIT_NONE)
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1567 image_select(lw->split_images[i], TRUE);
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1568 else
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1569 image_select(lw->split_images[i], FALSE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1570
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1571 fd = image_get_fd(lw->image);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1572
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1573 if (fd)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1574 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1575 // layout_list_sync_path(lw, path);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 753
diff changeset
1576 layout_set_fd(lw, fd);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1577 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1578 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1579
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1580
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1581 static void layout_image_setup_split_common(LayoutWindow *lw, gint n)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1582 {
1309
55ea4962887a config file format changed to XML
nadvornik
parents: 1292
diff changeset
1583 gboolean frame = (n == 1) ? (!lw->options.tools_float && !lw->options.tools_hidden) : 1;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1584 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1585
1169
cb699bd2742d layout_image_setup_split_*(): simplify code.
zas_
parents: 1168
diff changeset
1586 for (i = 0; i < n; i++)
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1587 if (!lw->split_images[i])
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1588 {
1172
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1589 FileData *img_fd = NULL;
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1590 double zoom = 0.0;
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1591
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1592 layout_image_new(lw, i);
1170
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1593 image_set_frame(lw->split_images[i], frame);
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1594 image_set_selectable(lw->split_images[i], 1);
1173
52ce0263cb7c Use the last selected images for the splitted views. Ie. when 5 images are selected, the last one is displayed, split quad while open images 5,4,3,2. It seems better to me.
zas_
parents: 1172
diff changeset
1595
1172
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1596 if (layout_selection_count(lw, 0) > 1)
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1597 {
1173
52ce0263cb7c Use the last selected images for the splitted views. Ie. when 5 images are selected, the last one is displayed, split quad while open images 5,4,3,2. It seems better to me.
zas_
parents: 1172
diff changeset
1598 GList *work = g_list_last(layout_selection_list(lw));
1172
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1599 gint j = 0;
1173
52ce0263cb7c Use the last selected images for the splitted views. Ie. when 5 images are selected, the last one is displayed, split quad while open images 5,4,3,2. It seems better to me.
zas_
parents: 1172
diff changeset
1600
52ce0263cb7c Use the last selected images for the splitted views. Ie. when 5 images are selected, the last one is displayed, split quad while open images 5,4,3,2. It seems better to me.
zas_
parents: 1172
diff changeset
1601 if (work) work = work->prev;
1172
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1602
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1603 while (work && j < i)
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1604 {
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1605 FileData *fd = work->data;
1173
52ce0263cb7c Use the last selected images for the splitted views. Ie. when 5 images are selected, the last one is displayed, split quad while open images 5,4,3,2. It seems better to me.
zas_
parents: 1172
diff changeset
1606 work = work->prev;
1172
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1607
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1608 j++;
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1609 if (!fd || !*fd->path) continue;
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1610 img_fd = fd;
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1611 }
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1612 }
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1613
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1614 if (!img_fd && lw->image)
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1615 {
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1616 img_fd = image_get_fd(lw->image);
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1617 zoom = image_zoom_get(lw->image);
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1618 }
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1619
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1620 if (img_fd)
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1621 {
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1622 gdouble sx, sy;
1172
08ef8c605723 When more than one image is selected, Split Horizontal, Vertical and Quad will use selected images when initialized.
zas_
parents: 1171
diff changeset
1623 image_change_fd(lw->split_images[i], img_fd, zoom);
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1624 image_get_scroll_center(lw->image, &sx, &sy);
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1625 image_set_scroll_center(lw->split_images[i], sx, sy);
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1626 }
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1627 layout_image_deactivate(lw, i);
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1628 }
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1629 else
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1630 {
1170
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1631 image_set_frame(lw->split_images[i], frame);
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1632 image_set_selectable(lw->split_images[i], 1);
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1633 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1634
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1635 for (i = n; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1636 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1637 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1638 {
1043
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1639 #if GTK_CHECK_VERSION(2,12,0)
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1640 g_object_unref(lw->split_images[i]->widget);
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1641 #else
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1642 gtk_widget_unref(lw->split_images[i]->widget);
1043
5fc64d6252e7 Replaced gtk depreceated code.
bruclik
parents: 1037
diff changeset
1643 #endif
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1644 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1645 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1646 }
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1647
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1648 if (!lw->image || lw->active_split_image < 0 || lw->active_split_image >= n)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1649 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1650 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1651 }
1273
1ac2baeb8dc9 fixed switch from single to split image
nadvornik
parents: 1272
diff changeset
1652 else
1ac2baeb8dc9 fixed switch from single to split image
nadvornik
parents: 1272
diff changeset
1653 {
1ac2baeb8dc9 fixed switch from single to split image
nadvornik
parents: 1272
diff changeset
1654 /* this will draw the frame around selected image (image_select)
1ac2baeb8dc9 fixed switch from single to split image
nadvornik
parents: 1272
diff changeset
1655 on switch from single to split images */
1ac2baeb8dc9 fixed switch from single to split image
nadvornik
parents: 1272
diff changeset
1656 layout_image_activate(lw, lw->active_split_image);
1ac2baeb8dc9 fixed switch from single to split image
nadvornik
parents: 1272
diff changeset
1657 }
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1658 }
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1659
1170
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1660 GtkWidget *layout_image_setup_split_none(LayoutWindow *lw)
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1661 {
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1662 lw->split_mode = SPLIT_NONE;
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1663
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1664 layout_image_setup_split_common(lw, 1);
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1665
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1666 lw->split_image_widget = lw->split_images[0]->widget;
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1667
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1668 return lw->split_image_widget;
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1669 }
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1670
159f225985c5 Use common code for layout_image_setup_split_none() too.
zas_
parents: 1169
diff changeset
1671
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1672 GtkWidget *layout_image_setup_split_hv(LayoutWindow *lw, gboolean horizontal)
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1673 {
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1674 GtkWidget *paned;
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1675
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1676 lw->split_mode = horizontal ? SPLIT_HOR : SPLIT_VERT;
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1677
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1678 layout_image_setup_split_common(lw, 2);
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1679
156
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1680 /* horizontal split means vpaned and vice versa */
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1681 if (horizontal)
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1682 paned = gtk_vpaned_new();
156
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1683 else
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1684 paned = gtk_hpaned_new();
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1685
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1686 gtk_paned_pack1(GTK_PANED(paned), lw->split_images[0]->widget, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1687 gtk_paned_pack2(GTK_PANED(paned), lw->split_images[1]->widget, TRUE, TRUE);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1688
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1689 gtk_widget_show(lw->split_images[0]->widget);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1690 gtk_widget_show(lw->split_images[1]->widget);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1691
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1692 lw->split_image_widget = paned;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1693
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1694 return lw->split_image_widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1695
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1696 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1697
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1698 GtkWidget *layout_image_setup_split_quad(LayoutWindow *lw)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1699 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1700 GtkWidget *hpaned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1701 GtkWidget *vpaned1;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1702 GtkWidget *vpaned2;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1703 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1704
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1705 lw->split_mode = SPLIT_QUAD;
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1706
1168
0c7534002b0a layout_image_setup_split_*(): move common code to a new function layout_image_setup_split_common().
zas_
parents: 1055
diff changeset
1707 layout_image_setup_split_common(lw, 4);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1708
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1709 hpaned = gtk_hpaned_new();
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1710 vpaned1 = gtk_vpaned_new();
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1711 vpaned2 = gtk_vpaned_new();
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1712
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1713 gtk_paned_pack1(GTK_PANED(vpaned1), lw->split_images[0]->widget, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1714 gtk_paned_pack2(GTK_PANED(vpaned1), lw->split_images[2]->widget, TRUE, TRUE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1715
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1716 gtk_paned_pack1(GTK_PANED(vpaned2), lw->split_images[1]->widget, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1717 gtk_paned_pack2(GTK_PANED(vpaned2), lw->split_images[3]->widget, TRUE, TRUE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1718
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1719 gtk_paned_pack1(GTK_PANED(hpaned), vpaned1, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1720 gtk_paned_pack2(GTK_PANED(hpaned), vpaned2, TRUE, TRUE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1721
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1722 for (i = 0; i < 4; i++)
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1723 gtk_widget_show(lw->split_images[i]->widget);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1724
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1725 gtk_widget_show(vpaned1);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1726 gtk_widget_show(vpaned2);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1727
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1728 lw->split_image_widget = hpaned;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1729
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1730 return lw->split_image_widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1731
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1732 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1733
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1734 GtkWidget *layout_image_setup_split(LayoutWindow *lw, ImageSplitMode mode)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1735 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1736 switch (mode)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1737 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1738 case SPLIT_HOR:
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1739 return layout_image_setup_split_hv(lw, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1740 case SPLIT_VERT:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1741 return layout_image_setup_split_hv(lw, FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1742 case SPLIT_QUAD:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1743 return layout_image_setup_split_quad(lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1744 case SPLIT_NONE:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1745 default:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1746 return layout_image_setup_split_none(lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1747 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1748 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1749
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1750
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1751 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1752 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1753 * maintenance (for rename, move, remove)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1754 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1755 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1756
796
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1757 static void layout_image_maint_renamed(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1758 {
1171
8721675f80ce Tidy up.
zas_
parents: 1170
diff changeset
1759 if (fd == layout_image_get_fd(lw))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1760 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1761 image_set_fd(lw->image, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1762 layout_bars_maint_renamed(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1763 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1764 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1765
796
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1766 static void layout_image_maint_removed(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1767 {
1171
8721675f80ce Tidy up.
zas_
parents: 1170
diff changeset
1768 if (fd == layout_image_get_fd(lw))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1769 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1770 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1771 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1772
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1773 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1774 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1775 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1776 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1777
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1778 new = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1779 if (!new) new = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1780
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1781 if (new)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1782 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1783 layout_image_set_collection(lw, cd, new);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1784 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1785 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1786 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1787
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1788 layout_image_set_fd(lw, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1789 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1790 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1791
796
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1792
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1793 void layout_image_notify_cb(FileData *fd, NotifyType type, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1794 {
796
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1795 LayoutWindow *lw = data;
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1796
803
764fd82dd099 better check for notify type
nadvornik
parents: 796
diff changeset
1797 if (type != NOTIFY_TYPE_CHANGE || !fd->change) return;
796
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1798
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1799 switch(fd->change->type)
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1800 {
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1801 case FILEDATA_CHANGE_MOVE:
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1802 case FILEDATA_CHANGE_RENAME:
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1803 layout_image_maint_renamed(lw, fd);
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1804 break;
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1805 case FILEDATA_CHANGE_DELETE:
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1806 layout_image_maint_removed(lw, fd);
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1807 break;
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1808 case FILEDATA_CHANGE_COPY:
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1809 case FILEDATA_CHANGE_UNSPECIFIED:
1211
e2bbe90b0dcd most of the metadata options now works
nadvornik
parents: 1173
diff changeset
1810 case FILEDATA_CHANGE_WRITE_METADATA:
796
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1811 break;
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1812 }
0be132a51f51 use new notification in layout and layout_image
nadvornik
parents: 783
diff changeset
1813
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1814 }
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1047
diff changeset
1815 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */