annotate src/layout_image.c @ 235:a154d41fd666

Make collect_manager_process_action() static.
author zas_
date Thu, 03 Apr 2008 20:38:59 +0000
parents 7670d5653e1f
children bee34a6a4aec
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
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * 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
10 */
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 #include "gqview.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #include "collect.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "dnd.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "editors.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include "filelist.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 #include "fullscreen.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include "image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include "image-overlay.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "img-view.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #include "info.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"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #include "pixbuf_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #include "utilops.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_bookmark.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 #include "ui_menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 #include <gdk/gdkkeysyms.h> /* for keyboard values */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35
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 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 static void layout_image_set_buttons(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39
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 * full screen overlay
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 *----------------------------------------------------------------------------
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
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
46 void layout_image_overlay_toggle(LayoutWindow *lw)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 {
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
48 if (image_osd_get(lw->image, NULL, NULL))
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
49 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
50 image_osd_set(lw->image, FALSE, FALSE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
51 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
52 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
53 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
54 image_osd_set(lw->image, (lw->full_screen != NULL), TRUE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
55 image_osd_icon(lw->image, IMAGE_OSD_ICON, -1);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
56 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 void layout_image_overlay_update(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 {
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
61 if (!lw) return;
117
0c2e1f0a001b Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
62
0c2e1f0a001b Wed Nov 29 14:28:30 2006 John Ellis <johne@verizon.net>
gqview
parents: 113
diff changeset
63 image_osd_update(lw->image);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 }
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 /*
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 * full screen
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 static void layout_image_fullscreen_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
73 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 LayoutWindow *lw = data;
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 (!lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
78 gdk_window_get_origin(lw->full_screen->imd->pr->window, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 static void layout_image_full_screen_menu_popup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 GtkWidget *menu;
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 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, layout_image_fullscreen_menu_pos_cb, lw, 0, GDK_CURRENT_TIME);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
90 #if 0
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
91 /* this is handled by layout_key_press_cb */
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
92
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
93
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 static gint layout_image_full_screen_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 LayoutWindow *lw = data;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
97 gint stop_signal;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 gint x = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 gint y = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
101 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
102 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 case GDK_Left: case GDK_KP_Left:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105 x -= 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107 case GDK_Right: case GDK_KP_Right:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 x += 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110 case GDK_Up: case GDK_KP_Up:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
111 y -= 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
113 case GDK_Down: case GDK_KP_Down:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 y += 1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
115 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
116 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
117 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
121 if (x != 0 || y!= 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
123 if (event->state & GDK_SHIFT_MASK)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
124 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
125 x *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
126 y *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
127 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
128
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
129 keyboard_scroll_calc(&x, &y, event);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
130 layout_image_scroll(lw, x, y);
9
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
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
133 if (stop_signal) return stop_signal;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
134
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 if (event->state & GDK_CONTROL_MASK)
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 gint n = -1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
138
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
139 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 switch (event->keyval)
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 case '1':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
143 n = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145 case '2':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 n = 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148 case '3':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 n = 2;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
151 case '4':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
152 n = 3;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
154 case '5':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 n = 4;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
157 case '6':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 n = 5;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
159 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160 case '7':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 n = 6;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
162 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 case '8':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164 n = 7;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
165 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
166 case '9':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
167 n = 8;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
168 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 case '0':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 n = 9;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
171 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 case 'C': case 'c':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
173 file_util_copy(layout_image_get_fd(lw), NULL, NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
174 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
175 case 'M': case 'm':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
176 file_util_move(layout_image_get_fd(lw), NULL, NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
177 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178 case 'R': case 'r':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
179 file_util_rename(layout_image_get_fd(lw), NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
180 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 case 'D': case 'd':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
182 file_util_delete(layout_image_get_fd(lw), NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
183 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
184 case 'P': case 'p':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
185 info_window_new(layout_image_get_fd(lw), NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
186 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
187 case 'Q': case 'q':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188 exit_gqview();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190 break;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
191 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
192 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
193 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
194 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
195 if (n != -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
196 {
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
197 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
198 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
199 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
200 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
201 start_editor_from_file(n, layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
202 }
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 else if (event->state & GDK_SHIFT_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
205 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
206 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
208 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
209 case 'R': case 'r':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
210 layout_image_alter(lw, ALTER_ROTATE_180);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
211 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
212 case 'M': case 'm':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
213 layout_image_alter(lw, ALTER_MIRROR);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
214 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
215 case 'F': case 'f':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
216 layout_image_alter(lw, ALTER_FLIP);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
217 break;
82
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
218 case 'G': case 'g':
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
219 layout_image_alter(lw, ALTER_DESATURATE);
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
220 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
221 default:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
222 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
223 break;
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 }
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
226 else
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
227 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
228 stop_signal = TRUE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
229 switch (event->keyval)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
230 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
231 case '+': case '=': case GDK_KP_Add:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
232 layout_image_zoom_adjust(lw, get_zoom_increment());
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
233 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
234 case '-': case GDK_KP_Subtract:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
235 layout_image_zoom_adjust(lw, -get_zoom_increment());
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
236 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
237 case 'X': case 'x': case GDK_KP_Multiply:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
238 layout_image_zoom_set(lw, 0.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
239 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
240 case 'Z': case 'z': case GDK_KP_Divide:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
241 case '1':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
242 layout_image_zoom_set(lw, 1.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
243 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
244 case '2':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
245 layout_image_zoom_set(lw, 2.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
246 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
247 case '3':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
248 layout_image_zoom_set(lw, 3.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
249 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
250 case '4':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
251 layout_image_zoom_set(lw, 4.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
252 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
253 case '7':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
254 layout_image_zoom_set(lw, -4.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
255 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
256 case '8':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
257 layout_image_zoom_set(lw, -3.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
258 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
259 case '9':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
260 layout_image_zoom_set(lw, -2.0);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
261 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
262 case 'W': case 'w':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
263 layout_image_zoom_set_fill_geometry(lw, FALSE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
264 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
265 case 'H': case 'h':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
266 layout_image_zoom_set_fill_geometry(lw, TRUE);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
267 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
268 case GDK_Page_Up: case GDK_KP_Page_Up:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
269 case GDK_BackSpace:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
270 case 'B': case 'b':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
271 layout_image_prev(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
272 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
273 case GDK_Page_Down: case GDK_KP_Page_Down:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
274 case GDK_space:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
275 case 'N': case 'n':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
276 layout_image_next(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
277 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
278 case GDK_Home: case GDK_KP_Home:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
279 layout_image_first(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
280 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
281 case GDK_End: case GDK_KP_End:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
282 layout_image_last(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
283 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
284 case ']':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
285 layout_image_alter(lw, ALTER_ROTATE_90);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
286 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
287 case '[':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
288 layout_image_alter(lw, ALTER_ROTATE_90_CC);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
289 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
290 case GDK_Delete: case GDK_KP_Delete:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
291 if (enable_delete_key)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
292 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
293 file_util_delete(layout_image_get_fd(lw), NULL, widget);
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
294 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
295 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
296 case GDK_Escape:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
297 layout_image_full_screen_stop(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
298 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
299 case 'R': case 'r':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
300 layout_refresh(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
301 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
302 case 'S': case 's':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
303 layout_image_slideshow_toggle(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
304 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
305 case 'P': case 'p':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
306 layout_image_slideshow_pause_toggle(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
307 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
308 case 'F': case 'f':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
309 case 'V': case 'v':
86
cade6a52a165 Mon Oct 23 05:34:29 2006 John Ellis <johne@verizon.net>
gqview
parents: 84
diff changeset
310 case GDK_F11:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
311 layout_image_full_screen_stop(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
312 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
313 case GDK_Menu:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
314 case GDK_F10:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
315 layout_image_full_screen_menu_popup(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
316 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
317 case 'I': case 'i':
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
318 layout_image_overlay_toggle(lw);
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
319 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
320 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
321 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
322 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
323 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 }
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 return stop_signal;
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
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
329 #endif
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
330
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331 static void layout_image_full_screen_stop_func(FullScreenData *fs, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
332 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
335 /* restore image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
336 lw->image = fs->normal_imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
337
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
338 if (lw->slideshow)
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 lw->slideshow->imd = lw->image;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
343 lw->full_screen = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
344 }
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 void layout_image_full_screen_start(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
347 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
348 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
349
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350 if (lw->full_screen) return;
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 lw->full_screen = fullscreen_start(lw->window, lw->image,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
353 layout_image_full_screen_stop_func, lw);
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 /* set to new image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
356 lw->image = lw->full_screen->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
360 lw->slideshow->imd = lw->image;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
363 layout_image_set_buttons(lw);
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 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
366 G_CALLBACK(layout_key_press_cb), lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
367
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
368 layout_actions_add_window(lw, lw->full_screen->window);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
369 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370 gtk_widget_set_sensitive(lw->window, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
371 if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
372 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
373
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
374 if (image_osd_get(lw->full_screen->normal_imd, NULL, NULL))
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
375 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
376 image_osd_set(lw->image, TRUE, TRUE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
377 image_osd_set(lw->full_screen->normal_imd, FALSE, FALSE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
378 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
379 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
380
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381 void layout_image_full_screen_stop(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
384 if (!lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
386 if (image_osd_get(lw->image, NULL, NULL))
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
387 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
388 image_osd_set(lw->full_screen->normal_imd, FALSE, TRUE);
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
389 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 fullscreen_stop(lw->full_screen);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
391
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
392 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393 gtk_widget_set_sensitive(lw->window, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
394 if (lw->tools) gtk_widget_set_sensitive(lw->tools, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
395 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
396 }
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 void layout_image_full_screen_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
399 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
400 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
401 if (lw->full_screen)
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 layout_image_full_screen_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
404 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
405 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
406 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
407 layout_image_full_screen_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
408 }
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 gint layout_image_full_screen_active(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return FALSE;
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 return (lw->full_screen != NULL);
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 /*
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 * slideshow
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 */
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 static void layout_image_slideshow_next(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
425 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
426 if (lw->slideshow) slideshow_next(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
427 }
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 static void layout_image_slideshow_prev(LayoutWindow *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 if (lw->slideshow) slideshow_prev(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
432 }
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 static void layout_image_slideshow_stop_func(SlideShowData *ss, gpointer 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 LayoutWindow *lw = data;
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 lw->slideshow = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
439 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
440 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
441
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
442 void layout_image_slideshow_start(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
443 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
444 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
445 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
446
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
447 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
448 if (lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
449
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
450 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
451
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
452 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
453 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
454 lw->slideshow = slideshow_start_from_collection(lw->image, cd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
455 layout_image_slideshow_stop_func, lw, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
456 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
457 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
458 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
459 lw->slideshow = slideshow_start(lw->image, lw,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
460 layout_list_get_index(lw, layout_image_get_path(lw)),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
461 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
462 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
463
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
464 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
465 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
466
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
467 /* 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
468 void layout_image_slideshow_start_from_list(LayoutWindow *lw, GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
469 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
470 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
471
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
472 if (lw->slideshow || !list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
473 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
474 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
475 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
476 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
477
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
478 lw->slideshow = slideshow_start_from_filelist(lw->image, list,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
479 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
480
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
481 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
482 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
483
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
484 void layout_image_slideshow_stop(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
485 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
486 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
487
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
488 if (!lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
489
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
490 slideshow_free(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
491 /* the stop_func sets lw->slideshow to NULL for us */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
492 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
493
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
494 void layout_image_slideshow_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
495 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
496 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
497
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
498 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
499 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
500 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
501 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
502 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
503 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
504 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
505 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
506 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
507
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
508 gint layout_image_slideshow_active(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
509 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
510 if (!layout_valid(&lw)) return FALSE;
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 return (lw->slideshow != NULL);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
515 gint layout_image_slideshow_pause_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
516 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
517 gint ret;
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 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
520
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
521 ret = slideshow_pause_toggle(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
522
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
523 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
524
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
525 return ret;
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 gint layout_image_slideshow_paused(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
529 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
530 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
531
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
532 return (slideshow_paused(lw->slideshow));
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 static gint layout_image_slideshow_continue_check(LayoutWindow *lw)
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 if (!lw->slideshow) return FALSE;
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 if (!slideshow_should_continue(lw->slideshow))
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 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
542 return FALSE;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
545 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
546 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
547
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
548 /*
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 * pop-up menus
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
554 static void li_pop_menu_zoom_in_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
555 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
556 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
557
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
558 layout_image_zoom_adjust(lw, get_zoom_increment());
9
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 static void li_pop_menu_zoom_out_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
564 layout_image_zoom_adjust(lw, -get_zoom_increment());
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
565 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
566
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
567 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
568 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
569 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
570
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
571 layout_image_zoom_set(lw, 1.0);
9
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 static void li_pop_menu_zoom_fit_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
575 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
576 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
577
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
578 layout_image_zoom_set(lw, 0.0);
9
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
581 static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
582 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
583 LayoutWindow *lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
584 gint n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
585
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
586 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
587 n = GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
588
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
589 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
590 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
591 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
592 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
593 start_editor_from_file(n, layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
594 }
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 static void li_pop_menu_wallpaper_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
599
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
600 layout_image_to_root(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
603 static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
604 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
605 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
606 AlterType type;
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 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
609 type = (AlterType)GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
610
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
611 image_alter(lw->image, type);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
614 static void li_pop_menu_info_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
615 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
616 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
617
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
618 info_window_new(layout_image_get_fd(lw), NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
619 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
620
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
621 static void li_pop_menu_new_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
622 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
623 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
624
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
625 view_window_new(layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
626 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
627
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
628 static GtkWidget *li_pop_menu_click_parent(GtkWidget *widget, LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
629 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
630 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
631 GtkWidget *parent;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
632
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
633 menu = gtk_widget_get_toplevel(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
634 if (!menu) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
635
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
636 parent = g_object_get_data(G_OBJECT(menu), "click_parent");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
637
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
638 if (!parent && lw->full_screen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
639 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
640 parent = lw->full_screen->imd->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
641 }
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 return parent;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
646 static void li_pop_menu_copy_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
647 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
648 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
649
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
650 file_util_copy(layout_image_get_fd(lw), NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
651 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
652 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
653
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
654 static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
657
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
658 file_util_move(layout_image_get_fd(lw), NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
659 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
660 }
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 static void li_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
663 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
664 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
665
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
666 file_util_rename(layout_image_get_fd(lw), NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
667 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
668 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
669
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
670 static void li_pop_menu_delete_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
671 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
672 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
673
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
674 file_util_delete(layout_image_get_fd(lw), NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
675 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
676 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
677
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
678 static void li_pop_menu_slide_start_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
679 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
680 LayoutWindow *lw = data;
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 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
683 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
684
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
685 static void li_pop_menu_slide_stop_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
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 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
690 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
691
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
692 static void li_pop_menu_slide_pause_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
693 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
694 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
695
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
696 layout_image_slideshow_pause_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
697 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
698
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
699 static void li_pop_menu_full_screen_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
700 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
701 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
702
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
703 layout_image_full_screen_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
704 }
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 static void li_pop_menu_hide_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
707 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
708 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
709
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
710 layout_tools_hide_toggle(lw);
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 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
714 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
715 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
716 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
717 GtkWidget *submenu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
718 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
719 gint fullscreen;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
720
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
721 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
722 fullscreen = layout_image_full_screen_active(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
723
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
724 menu = popup_menu_short_lived();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
725
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
726 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
727 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
728 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
729 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
730 menu_item_add_divider(menu);
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 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
733 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
734 menu_item_add_divider(submenu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
735 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
736
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
737 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
738
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
739 item = menu_item_add_stock(menu, _("_Properties"), GTK_STOCK_PROPERTIES, G_CALLBACK(li_pop_menu_info_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
740 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
741
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
742 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
743 if (!path || fullscreen) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
744
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
745 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
746
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
747 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
748 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
749 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
750 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
751 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
752 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
753 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
754 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
755
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
756 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
757
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
758 if (layout_image_slideshow_active(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 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
761 if (layout_image_slideshow_paused(lw))
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 item = menu_item_add(menu, _("Continue slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
764 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
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 else
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 item = menu_item_add(menu, _("Pause slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
769 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
770 }
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 else
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 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
775 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
776 gtk_widget_set_sensitive(item, FALSE);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
779 if (!fullscreen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
780 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
781 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
782 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
783 else
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 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
786 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
787
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
788 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
789
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
790 item = menu_item_add_check(menu, _("Hide file _list"), lw->tools_hidden,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
791 G_CALLBACK(li_pop_menu_hide_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
792 if (fullscreen) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
793
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
794 return menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
795 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
796
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
797 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
798 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
799 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
800
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
801 gdk_window_get_origin(lw->image->pr->window, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
802 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
803 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
804
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
805 void layout_image_menu_popup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
806 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
807 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
808
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
809 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
810 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
811 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
812
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
813 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
814 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
815 * dnd
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
816 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
817 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
818
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
819 static void layout_image_dnd_receive(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
820 gint x, gint y,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
821 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
822 guint time, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
823 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
824 LayoutWindow *lw = data;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
825 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
826
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
827
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
828 for (i=0; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
829 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
830 if (lw->split_images[i] && lw->split_images[i]->pr == widget)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
831 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
832 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
833 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
834 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
835 printf("dnd image activate %d\n", i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
836 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
837 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
838
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
839
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
840 if (info == TARGET_URI_LIST || info == TARGET_APP_COLLECTION_MEMBER)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
841 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
842 CollectionData *source;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
843 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
844 GList *info_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
845
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
846 if (info == TARGET_URI_LIST)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
847 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
848 list = uri_filelist_from_text((gchar *)selection_data->data, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
849 source = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
850 info_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
851 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
852 else
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 source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
855 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
856
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
857 if (list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
858 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
859 FileData *fd = list->data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
860
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
861 if (isfile(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
862 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
863 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
864 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
865
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
866 base = remove_level_from_path(fd->path);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
867 if (strcmp(base, layout_get_path(lw)) != 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
868 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
869 layout_set_path(lw, base);
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 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
872
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
873 row = layout_list_get_index(lw, fd->path);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
874 if (source && info_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
875 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
876 layout_image_set_collection(lw, source, info_list->data);
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 else if (row == -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
879 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
880 layout_image_set_fd(lw, fd);
9
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 else
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 layout_image_set_index(lw, row);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
885 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
886 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
887 else if (isdir(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
888 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
889 layout_set_path(lw, fd->path);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
890 layout_image_set_fd(lw, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
891 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
892 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
893
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
894 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
895 g_list_free(info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
896 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
897 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
898
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
899 static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
900 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
901 guint time, gpointer data)
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 LayoutWindow *lw = data;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
904 FileData *fd;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
905 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
906
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
907
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
908 for (i=0; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
909 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
910 if (lw->split_images[i] && lw->split_images[i]->pr == widget)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
911 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
912 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
913 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
914 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
915 printf("dnd get from %d\n", i);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
916 fd = image_get_fd(lw->split_images[i]);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
917 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
918 else
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
919 fd = layout_image_get_fd(lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
920
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
921 if (fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
922 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
923 gchar *text = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
924 gint len;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
925 gint plain_text;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
926 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
927
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
928 switch (info)
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 case TARGET_URI_LIST:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
931 plain_text = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
932 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
933 case TARGET_TEXT_PLAIN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
934 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
935 plain_text = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
936 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
937 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
938 list = g_list_append(NULL, fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
939 text = uri_text_from_filelist(list, &len, plain_text);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
940 g_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
941 if (text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
942 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
943 gtk_selection_data_set (selection_data, selection_data->target,
64
04ff0df3ad2f Mon Aug 15 17:13:57 2005 John Ellis <johne@verizon.net>
gqview
parents: 60
diff changeset
944 8, (guchar *)text, len);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
945 g_free(text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
946 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
947 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
948 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
949 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
950 gtk_selection_data_set (selection_data, selection_data->target,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
951 8, NULL, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
952 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
953 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
954
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
955 static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
958 if (context->action == GDK_ACTION_MOVE)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
959 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
960 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
961 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
962
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
963 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
964 row = layout_list_get_index(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
965 if (row < 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
966
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
967 if (!isfile(path))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
968 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
969 if (row < layout_list_count(lw, NULL) - 1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
970 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
971 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
972 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
973 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
974 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
975 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
976 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
977 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
978 layout_refresh(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
979 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
980 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
981
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
982 static void layout_image_dnd_init(LayoutWindow *lw, gint i)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
983 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
984 ImageWindow *imd = lw->split_images[i];
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
985
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
986 gtk_drag_source_set(imd->pr, GDK_BUTTON2_MASK,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
987 dnd_file_drag_types, dnd_file_drag_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
988 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
989 g_signal_connect(G_OBJECT(imd->pr), "drag_data_get",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
990 G_CALLBACK(layout_image_dnd_get), lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
991 g_signal_connect(G_OBJECT(imd->pr), "drag_end",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
992 G_CALLBACK(layout_image_dnd_end), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
993
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
994 gtk_drag_dest_set(imd->pr,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
995 GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
996 dnd_file_drop_types, dnd_file_drop_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
997 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
998 g_signal_connect(G_OBJECT(imd->pr), "drag_data_received",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
999 G_CALLBACK(layout_image_dnd_receive), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1000 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1001
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1002
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1003 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1004 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1005 * misc
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 */
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 void layout_image_to_root(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1010 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1011 image_to_root_window(lw->image, (image_zoom_get(lw->image) == 0));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1012 }
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 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1015 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1016 * manipulation + accessors
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1017 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1018 */
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 void layout_image_scroll(LayoutWindow *lw, gint x, gint y)
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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1023
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1024 image_scroll(lw->image, x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1025 }
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 void layout_image_zoom_adjust(LayoutWindow *lw, gdouble increment)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1028 {
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1029 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1030 if (!layout_valid(&lw)) return;
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 image_zoom_adjust(lw->image, increment);
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1033
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1034 for (i=0; i < MAX_SPLIT_IMAGES; i++)
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1035 {
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1036 if (lw->split_images[i] && lw->split_images[i] != lw->image && lw->connect_zoom)
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1037 image_zoom_adjust(lw->split_images[i], increment); ;
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1038 }
9
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1041 void layout_image_zoom_set(LayoutWindow *lw, gdouble zoom)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1042 {
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1043 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1044 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1045
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1046 image_zoom_set(lw->image, zoom);
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1047
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1048 for (i=0; i < MAX_SPLIT_IMAGES; i++)
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1049 {
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1050 if (lw->split_images[i] && lw->split_images[i] != lw->image && lw->connect_zoom)
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1051 image_zoom_set(lw->split_images[i], zoom);
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1052 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1053 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1054
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1055 void layout_image_zoom_set_fill_geometry(LayoutWindow *lw, gint vertical)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1056 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1057 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1058
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1059 image_zoom_set_fill_geometry(lw->image, vertical);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1060 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1061
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1062 void layout_image_alter(LayoutWindow *lw, AlterType type)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1063 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1064 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1065
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1066 image_alter(lw->image, type);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1067 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1068
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1069 const gchar *layout_image_get_path(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1070 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1071 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1072
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1073 return image_get_path(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1074 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1075
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1076 const gchar *layout_image_get_name(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1077 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1078 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1079
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1080 return image_get_name(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1081 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1082
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1083 FileData *layout_image_get_fd(LayoutWindow *lw)
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1084 {
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1085 if (!layout_valid(&lw)) return NULL;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1086
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1087 return image_get_fd(lw->image);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1088 }
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1089
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1090 CollectionData *layout_image_get_collection(LayoutWindow *lw, CollectInfo **info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1091 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1092 if (!layout_valid(&lw)) return NULL;
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 return image_get_collection(lw->image, info);
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 gint layout_image_get_index(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1098 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1099 return layout_list_get_index(lw, image_get_path(lw->image));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1100 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1102 /*
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 * image changers
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 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1107
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1108 void layout_image_set_fd(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1109 {
131
b1acdfc7271b relative scroll is working; some cleanup
nadvornik
parents: 130
diff changeset
1110 gdouble sx, sy;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1111 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1112
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1113 image_get_scroll_center(lw->image, &sx, &sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1114
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1115 image_change_fd(lw->image, fd, image_zoom_get_default(lw->image, zoom_mode));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1116
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1117 image_set_scroll_center(lw->image, sx, sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1118
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1119 layout_list_sync_fd(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1120 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1121 layout_bars_new_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1122 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1123
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1124 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
1125 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1126 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1127
144
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
1128 /*
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
1129 This should be handled at the caller: in vflist_select_image
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
1130 if (path)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1131 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1132 const gchar *old_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1133
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1134 old_path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1135 if (old_path && strcmp(path, old_path) == 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1136 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1137 */
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1138 layout_image_set_fd(lw, fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1139 if (enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1140 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1141
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1142 void layout_image_set_index(LayoutWindow *lw, gint index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1143 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1144 FileData *fd;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1145 FileData *read_ahead_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1146 gint old;
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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1149
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1150 old = layout_list_get_index(lw, layout_image_get_path(lw));
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1151 fd = layout_list_get_fd(lw, index);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1152
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1153 if (old > index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1154 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1155 read_ahead_fd = layout_list_get_fd(lw, index - 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1156 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1157 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1158 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1159 read_ahead_fd = layout_list_get_fd(lw, index + 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1160 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1161
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1162 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1163 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1164 GList *x = layout_selection_list_by_index(lw);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1165 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1166 GList *last;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1167
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1168 for (last = y = x; y; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1169 last = y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1170 for (y = x; y && ((gint)y->data) != index; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1171 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1172
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1173 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1174 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1175 gint newindex;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1176
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1177 if ((index > old && (index != (gint) last->data || old != (gint) x->data))
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1178 || (old == (gint) last->data && index == (gint) x->data))
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1179 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1180 if (y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1181 newindex = (gint) y->next->data;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1182 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1183 newindex = (gint) x->data;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1184 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1185 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1186 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1187 if (y->prev)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1188 newindex = (gint) y->prev->data;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1189 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1190 newindex = (gint) last->data;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1191 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1192
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1193 read_ahead_fd = layout_list_get_fd(lw, newindex);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1194 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1195
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1196 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1197 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1198 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1199
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1200 layout_image_set_with_ahead(lw, fd, read_ahead_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1201 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1202
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1203 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
1204 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1205 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1206
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1207 image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image, zoom_mode));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1208 if (enable_read_ahead)
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 CollectInfo *r_info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1211 if (forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1212 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1213 r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1214 if (!r_info) r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1215 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1216 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1217 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1218 r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1219 if (!r_info) r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1220 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1221 if (r_info) image_prebuffer_set(lw->image, r_info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1222 }
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 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1225 layout_bars_new_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1226 }
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 void layout_image_set_collection(LayoutWindow *lw, CollectionData *cd, CollectInfo *info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1229 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1230 layout_image_set_collection_real(lw, cd, info, TRUE);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1231 layout_list_sync_fd(lw, layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1232 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1233
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1234 void layout_image_refresh(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1235 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1236 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1237
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1238 image_reload(lw->image);
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
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1241 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
1242 gint input_type, gint screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1243 gint use_image)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1244 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1245 if (!layout_valid(&lw)) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1246
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1247 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
1248 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1249
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1250 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
1251 gint *input_type, gint *screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1252 gint *use_image)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1253 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1254 if (!layout_valid(&lw)) return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1255
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1256 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
1257 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1258
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1259 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
1260 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1261 if (!layout_valid(&lw)) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1262
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1263 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
1264
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1265 if (lw->info_color)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1266 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1267 #ifndef HAVE_LCMS
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1268 enable = FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1269 #endif
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1270 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
1271 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1272 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1273
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1274 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
1275 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1276 if (!layout_valid(&lw)) return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1277
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1278 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
1279 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1280
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1281 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1282 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1283 * list walkers
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 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1286
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1287 void layout_image_next(LayoutWindow *lw)
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 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1290 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1291 CollectInfo *info;
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 if (!layout_valid(&lw)) return;
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 if (layout_image_slideshow_active(lw))
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 layout_image_slideshow_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1298 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1299 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1300
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1301 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1302 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1303 GList *x = layout_selection_list_by_index(lw);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1304 gint old = layout_list_get_index(lw, layout_image_get_path(lw));
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1305 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1306
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1307 for (y = x; y && ((gint) y->data) != old; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1308 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1309 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1310 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1311 if (y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1312 layout_image_set_index(lw, (gint) y->next->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1313 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1314 layout_image_set_index(lw, (gint) x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1315 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1316 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1317 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1318 if (y) /* not dereferenced */
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1319 return;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1320 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1321
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1322 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1323
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1324 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1325 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1326 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
1327 if (info)
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1328 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1329 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
1330 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1331 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1332 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1333 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
1334 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1335 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1336 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1337
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1338 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1339
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1340 if (current >= 0)
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 if (current < layout_list_count(lw, NULL) - 1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1343 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1344 layout_image_set_index(lw, current + 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1345 }
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1346 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1347 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1348 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
1349 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1350 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1351 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1352 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1353 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1354 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1355 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1356
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1357 void layout_image_prev(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1358 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1359 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1360 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1361 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1362
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1363 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1364
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1365 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1366 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1367 layout_image_slideshow_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1368 return;
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
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1371 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1372 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1373 GList *x = layout_selection_list_by_index(lw);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1374 gint old = layout_list_get_index(lw, layout_image_get_path(lw));
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1375 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1376 GList *last;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1377
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1378 for (last = y = x; y; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1379 last = y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1380 for (y = x; y && ((gint) y->data) != old; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1381 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1382 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1383 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1384 if (y->prev)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1385 layout_image_set_index(lw, (gint) y->prev->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1386 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1387 layout_image_set_index(lw, (gint) last->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1388 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1389 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1390 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1391 if (y) /* not dereferenced */
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1392 return;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1393 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1394
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1395 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1396
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1397 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1398 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1399 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
1400 if (info)
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1401 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1402 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
1403 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1404 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1405 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1406 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
1407 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1408 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1409 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1410
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1411 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1412
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1413 if (current >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1414 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1415 if (current > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1416 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1417 layout_image_set_index(lw, current - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1418 }
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1419 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1420 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1421 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
1422 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1423 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1424 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1425 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1426 layout_image_set_index(lw, layout_list_count(lw, NULL) - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1427 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1428 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1429
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1430 void layout_image_first(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1431 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1432 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1433 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1434 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1435
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1436 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1437
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1438 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1439
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1440 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1441 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1442 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1443 new = collection_get_first(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1444 if (new != info) layout_image_set_collection_real(lw, cd, new, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1445 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1446 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1447
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1448 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1449 if (current != 0 && layout_list_count(lw, NULL) > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1450 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1451 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1452 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1453 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1454
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1455 void layout_image_last(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1456 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1457 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1458 gint count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1459 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1460 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1461
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1462 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1463
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1464 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1465
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1466 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1467 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1468 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1469 new = collection_get_last(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1470 if (new != info) layout_image_set_collection_real(lw, cd, new, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1471 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1472 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1473
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1474 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1475 count = layout_list_count(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1476 if (current != count - 1 && count > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1477 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1478 layout_image_set_index(lw, count - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1479 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1480 }
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 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1483 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1484 * mouse callbacks
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1485 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1486 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1487
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1488 static gint image_idx(LayoutWindow *lw, ImageWindow *imd)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1489 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1490 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1491
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1492 for (i=0; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1493 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1494 if (lw->split_images[i] == imd)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1495 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1496 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1497 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1498 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1499 return i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1500 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1501 return -1;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1502 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1503
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1504
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1505 static void layout_image_button_cb(ImageWindow *imd, gint button, guint32 time,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1506 gdouble x, gdouble y, guint state, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1507 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1508 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1509 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1510
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1511 switch (button)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1512 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1513 case 1:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1514 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1515 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1516 case 2:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1517 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1518 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1519 case 3:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1520 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1521 if (imd == lw->image)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1522 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1523 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1524 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1525 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, time);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1526 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1527 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1528 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1529 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1530 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1531
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1532 static void layout_image_scroll_cb(ImageWindow *imd, GdkScrollDirection direction, guint32 time,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1533 gdouble x, gdouble y, guint state, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1534 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1535 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1536
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1537 gint i = image_idx(lw, imd);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1538
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1539 if (i != -1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1540 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1541 printf("image activate scroll %d\n", i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1542 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1543 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1544
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1545
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1546 if (state & GDK_CONTROL_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1547 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1548 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1549 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1550 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1551 image_zoom_adjust_at_point(imd, get_zoom_increment(), x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1552 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1553 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1554 image_zoom_adjust_at_point(imd, -get_zoom_increment(), x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1555 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1556 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1557 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1558 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1559 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1560 else if ( (state & GDK_SHIFT_MASK) != (mousewheel_scrolls))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1561 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1562 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1563 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1564 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1565 image_scroll(imd, 0, -MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1566 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1567 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1568 image_scroll(imd, 0, MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1569 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1570 case GDK_SCROLL_LEFT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1571 image_scroll(imd, -MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1572 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1573 case GDK_SCROLL_RIGHT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1574 image_scroll(imd, MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1575 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1576 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1577 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1578 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1579 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1580 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1581 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1582 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1583 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1584 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1585 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1586 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1587 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1588 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1589 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1590 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1591 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1592 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1593 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1594 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1595
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1596 static void layout_image_drag_cb(ImageWindow *imd, gint button, guint32 time,
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1597 gdouble x, gdouble y, guint state, gdouble dx, gdouble dy, gpointer data)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1598 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1599 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1600 LayoutWindow *lw = data;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1601
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1602
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1603 for (i=0; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1604 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1605 if (lw->split_images[i] && lw->split_images[i] != imd)
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1606 if (lw->connect_scroll)
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1607 {
131
b1acdfc7271b relative scroll is working; some cleanup
nadvornik
parents: 130
diff changeset
1608 gdouble sx, sy;
b1acdfc7271b relative scroll is working; some cleanup
nadvornik
parents: 130
diff changeset
1609 if (state & GDK_CONTROL_MASK)
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1610 {
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1611 image_get_scroll_center(imd, &sx, &sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1612 }
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1613 else
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1614 {
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1615 image_get_scroll_center(lw->split_images[i], &sx, &sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1616 sx += dx;
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1617 sy += dy;
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1618 }
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1619 image_set_scroll_center(lw->split_images[i], sx, sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1620 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1621 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1622 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1623
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1624 static void layout_image_button_inactive_cb(ImageWindow *imd, gint button, guint32 time,
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1625 gdouble x, gdouble y, guint state, gpointer data)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1626 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1627 LayoutWindow *lw = data;
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1628 GtkWidget *menu;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1629 gint i = image_idx(lw, imd);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1630
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1631 if (i != -1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1632 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1633 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1634 }
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1635
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1636 switch (button)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1637 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1638 case 3:
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1639 menu = layout_image_pop_menu(lw);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1640 if (imd == lw->image)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1641 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1642 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1643 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1644 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, time);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1645 break;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1646 default:
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1647 break;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1648 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1649
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1650 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1651
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1652 static void layout_image_drag_inactive_cb(ImageWindow *imd, gint button, guint32 time,
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1653 gdouble x, gdouble y, guint state, gdouble dx, gdouble dy, gpointer data)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1654 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1655 LayoutWindow *lw = data;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1656
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1657 gint i = image_idx(lw, imd);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1658
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1659 if (i != -1)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1660 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1661 layout_image_activate(lw, i);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1662 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1663
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1664
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1665 /* continue as with active image */
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1666 layout_image_drag_cb(imd, button, time, x, y, state, dx, dy, data);
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1667 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1668
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1669
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1670 static void layout_image_set_buttons(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1671 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1672 image_set_button_func(lw->image, layout_image_button_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1673 image_set_scroll_func(lw->image, layout_image_scroll_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1674 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1675
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1676 static void layout_image_set_buttons_inactive(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1677 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1678 image_set_button_func(lw->split_images[i], layout_image_button_inactive_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1679 image_set_scroll_func(lw->split_images[i], layout_image_scroll_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1680 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1681
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1682 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1683 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1684 * setup
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1685 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1686 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1687
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1688 static void layout_image_update_cb(ImageWindow *imd, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1689 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1690 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1691 layout_status_update_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1692 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1693
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1694 GtkWidget *layout_image_new(LayoutWindow *lw, gint i)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1695 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1696 if (!lw->split_images[i])
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1697 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1698 lw->split_images[i] = image_new(TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1699
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1700 gtk_widget_ref(lw->split_images[i]->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1701
208
fa0e05f985c3 set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents: 207
diff changeset
1702 image_background_set_color(lw->split_images[i], user_specified_window_background ? &window_background_color : NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1703
207
ec068409bee7 fixed color management initialization
nadvornik
parents: 196
diff changeset
1704 image_auto_refresh(lw->split_images[i], 0);
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1705
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1706 layout_image_dnd_init(lw, i);
207
ec068409bee7 fixed color management initialization
nadvornik
parents: 196
diff changeset
1707 image_color_profile_set(lw->split_images[i],
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1708 color_profile_input_type, color_profile_screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1709 color_profile_use_image);
207
ec068409bee7 fixed color management initialization
nadvornik
parents: 196
diff changeset
1710 image_color_profile_set_use(lw->split_images[i], color_profile_enabled);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1711 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1712
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1713 return lw->split_images[i]->widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1714 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1715
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1716 void layout_image_deactivate(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1717 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1718
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1719 if (!lw->split_images[i]) return;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1720 image_set_update_func(lw->split_images[i], NULL, NULL);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1721 layout_image_set_buttons_inactive(lw, i);
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1722 image_set_drag_func(lw->split_images[i], layout_image_drag_inactive_cb, lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1723
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1724 image_attach_window(lw->split_images[i], NULL, NULL, NULL, FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1725 image_select(lw->split_images[i], FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1726 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1727
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1728
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1729 void layout_image_activate(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1730 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1731 FileData *fd;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1732
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1733 gchar *base;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1734 gint row;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1735 gint j;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1736
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1737 if (!lw->split_images[i]) return;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1738
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1739 /* deactivate currently active */
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1740 if (lw->active_split_image != i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1741 layout_image_deactivate(lw, lw->active_split_image);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1742
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1743 lw->image = lw->split_images[i];
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1744 lw->active_split_image = i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1745
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1746 image_set_update_func(lw->image, layout_image_update_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1747 layout_image_set_buttons(lw);
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1748 image_set_drag_func(lw->image, layout_image_drag_cb, lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1749
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 175
diff changeset
1750 image_attach_window(lw->image, lw->window, NULL, "Geeqie", FALSE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1751
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1752 /* do not hilight selected image in SPLIT_NONE */
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1753 /* 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
1754 another image option */
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1755 if (lw->split_mode != SPLIT_NONE)
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1756 image_select(lw->split_images[i], TRUE);
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1757 else
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1758 image_select(lw->split_images[i], FALSE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1759
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1760 fd = image_get_fd(lw->image);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1761
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1762 if (fd)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1763 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1764 // layout_list_sync_path(lw, path);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1765 layout_set_path(lw, fd->path);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1766 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1767 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1768
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1769
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1770 GtkWidget *layout_image_setup_split_none(LayoutWindow *lw)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1771 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1772 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1773
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1774 lw->split_mode = SPLIT_NONE;
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1775
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1776 if (!lw->split_images[0])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1777 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1778 layout_image_new(lw, 0);
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1779 image_set_frame(lw->split_images[0], (!lw->tools_float && !lw->tools_hidden));
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1780 image_set_selectable(lw->split_images[0], 0);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1781 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1782 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1783 else
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1784 {
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1785 image_set_frame(lw->split_images[0], (!lw->tools_float && !lw->tools_hidden));
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1786 image_set_selectable(lw->split_images[0], 0);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1787 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1788
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1789 for (i=1; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1790 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1791 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1792 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1793 gtk_widget_unref(lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1794 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1795 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1796 }
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1797
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1798
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1799 layout_image_activate(lw, 0);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1800
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1801 lw->split_image_widget = lw->split_images[0]->widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1802
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1803 return lw->split_image_widget;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1804 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1805
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1806 GtkWidget *layout_image_setup_split_hv(LayoutWindow *lw, gboolean horizontal)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1807 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1808 GtkWidget *paned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1809 gint i;
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1810
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1811 lw->split_mode = horizontal ? SPLIT_HOR : SPLIT_VERT;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1812
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1813 if (!lw->split_images[0])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1814 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1815 layout_image_new(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1816 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1817 image_set_frame(lw->split_images[0], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1818 image_set_selectable(lw->split_images[0], 1);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1819
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1820 if (!lw->split_images[1])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1821 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1822 layout_image_new(lw, 1);
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1823 image_set_frame(lw->split_images[1], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1824 image_set_selectable(lw->split_images[1], 1);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1825 if (lw->image)
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1826 {
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1827 gdouble sx, sy;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1828 image_change_fd(lw->split_images[1],
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1829 image_get_fd(lw->image), image_zoom_get(lw->image));
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1830 image_get_scroll_center(lw->image, &sx, &sy);
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1831 image_set_scroll_center(lw->split_images[1], sx, sy);
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1832 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1833 layout_image_deactivate(lw, 1);
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1834 layout_image_activate(lw, 0);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1835 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1836 else
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1837 {
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1838 image_set_frame(lw->split_images[1], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1839 image_set_selectable(lw->split_images[1], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1840 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1841
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1842
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1843 for (i=2; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1844 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1845 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1846 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1847 gtk_widget_unref(lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1848 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1849 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1850 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1851
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1852 if (!lw->image || lw->active_split_image < 0 || lw->active_split_image > 1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1853 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1854 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1855 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1856
156
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1857 /* horizontal split means vpaned and vice versa */
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1858 if (horizontal)
156
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1859 paned = gtk_vpaned_new ();
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1860 else
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1861 paned = gtk_hpaned_new ();
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1862
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1863 gtk_paned_pack1 (GTK_PANED (paned), lw->split_images[0]->widget, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1864 gtk_paned_pack2 (GTK_PANED (paned), lw->split_images[1]->widget, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1865
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1866 gtk_widget_show (lw->split_images[0]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1867 gtk_widget_show (lw->split_images[1]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1868
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1869
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1870 lw->split_image_widget = paned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1871
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1872 return lw->split_image_widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1873
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1874 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1875
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1876 GtkWidget *layout_image_setup_split_quad(LayoutWindow *lw)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1877 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1878 GtkWidget *hpaned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1879 GtkWidget *vpaned1;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1880 GtkWidget *vpaned2;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1881 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1882
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1883 lw->split_mode = SPLIT_QUAD;
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1884
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1885 if (!lw->split_images[0])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1886 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1887 layout_image_new(lw, 0);
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1888 }
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1889
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1890 image_set_frame(lw->split_images[0], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1891 image_set_selectable(lw->split_images[0], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1892
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1893 if (!lw->split_images[1])
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1894 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1895 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1896 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1897
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1898 for (i=1; i < 4; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1899 if (!lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1900 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1901 layout_image_new(lw, i);
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1902 image_set_frame(lw->split_images[i], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1903 image_set_selectable(lw->split_images[i], 1);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1904 if (lw->image)
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1905 {
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1906 gdouble sx, sy;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1907 image_change_fd(lw->split_images[i],
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1908 image_get_fd(lw->image), image_zoom_get(lw->image));
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1909 image_get_scroll_center(lw->image, &sx, &sy);
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1910 image_set_scroll_center(lw->split_images[i], sx, sy);
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1911 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1912 layout_image_deactivate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1913 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1914 else
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1915 {
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1916 image_set_frame(lw->split_images[i], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1917 image_set_selectable(lw->split_images[i], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1918 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1919
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1920 for (i=4; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1921 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1922 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1923 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1924 gtk_widget_unref(lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1925 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1926 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1927 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1928
174
126724275319 improved drawing of image frames
nadvornik
parents: 160
diff changeset
1929
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1930 if (!lw->image || lw->active_split_image < 0 || lw->active_split_image > 3)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1931 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1932 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1933 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1934
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1935 hpaned = gtk_hpaned_new ();
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1936 vpaned1 = gtk_vpaned_new ();
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1937 vpaned2 = gtk_vpaned_new ();
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1938
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1939 gtk_paned_pack1 (GTK_PANED (vpaned1), lw->split_images[0]->widget, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1940 gtk_paned_pack2 (GTK_PANED (vpaned1), lw->split_images[2]->widget, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1941
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1942 gtk_paned_pack1 (GTK_PANED (vpaned2), lw->split_images[1]->widget, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1943 gtk_paned_pack2 (GTK_PANED (vpaned2), lw->split_images[3]->widget, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1944
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1945 gtk_paned_pack1 (GTK_PANED (hpaned), vpaned1, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1946 gtk_paned_pack2 (GTK_PANED (hpaned), vpaned2, TRUE, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1947
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1948
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1949 for (i=0; i < 4; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1950 gtk_widget_show (lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1951 gtk_widget_show (vpaned1);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1952 gtk_widget_show (vpaned2);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1953
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1954
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1955 lw->split_image_widget = hpaned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1956
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1957 return lw->split_image_widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1958
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1959 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1960
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1961 GtkWidget *layout_image_setup_split(LayoutWindow *lw, ImageSplitMode mode)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1962 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1963 switch (mode)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1964 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1965 case SPLIT_HOR:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1966 return layout_image_setup_split_hv(lw, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1967 case SPLIT_VERT:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1968 return layout_image_setup_split_hv(lw, FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1969 case SPLIT_QUAD:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1970 return layout_image_setup_split_quad(lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1971 case SPLIT_NONE:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1972 default:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1973 return layout_image_setup_split_none(lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1974 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1975 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1976
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1977
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1978 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1979 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1980 * maintenance (for rename, move, remove)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1981 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1982 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1983
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1984 void layout_image_maint_renamed(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1985 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1986 FileData *img_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1987
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1988 img_fd = layout_image_get_fd(lw);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1989 if (img_fd == fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1990 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1991 image_set_fd(lw->image, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1992 layout_bars_maint_renamed(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1993 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1994 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1995
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1996 void layout_image_maint_removed(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1997 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1998 FileData *img_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1999
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2000 img_fd = layout_image_get_fd(lw);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2001 if (img_fd == fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2002 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2003 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2004 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2005
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2006 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2007 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2008 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2009 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2010
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2011 new = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2012 if (!new) new = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2013
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2014 if (new)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2015 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2016 layout_image_set_collection(lw, cd, new);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2017 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2018 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2019 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2020
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2021 layout_image_set_fd(lw, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2022 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2023 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2024
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2025 void layout_image_maint_moved(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2026 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2027 layout_image_maint_renamed(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2028 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2029