annotate src/layout_image.c @ 740:9b0ac8d58c89

Move setup_default_options() and sync_options_with_current_state() to options.[ch]. Pass ConfOptions * to these instead of directly using global variable. Cleanup #include in main.c.
author zas_
date Thu, 22 May 2008 23:09:53 +0000
parents a7289f9e8d29
children 477f48ba28d8
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
475
48c8e49b571c updated copyright in source files
nadvornik
parents: 448
diff changeset
4 * Copyright (C) 2008 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 278
diff changeset
13 #include "main.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "collect.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "dnd.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include "editors.h"
586
905688aa2317 split filelist.c to filefilter.c and filedata.c
nadvornik
parents: 530
diff changeset
19 #include "filedata.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include "fullscreen.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include "image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "image-overlay.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #include "img-view.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #include "info.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 #include "layout.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #include "layout_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #include "menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #include "pixbuf_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 #include "utilops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 #include "slideshow.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 #include "ui_bookmark.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 #include "ui_menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 #include <gdk/gdkkeysyms.h> /* for keyboard values */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 static void layout_image_set_buttons(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 * full screen overlay
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
47 void layout_image_overlay_toggle(LayoutWindow *lw)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 {
481
67a612985686 Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents: 479
diff changeset
49 if (!lw) return;
67a612985686 Merge view_overlay_toggle() and layout_image_overlay_toggle() into new image_osd_toggle().
zas_
parents: 479
diff changeset
50 image_osd_toggle(lw->image);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 * full screen
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 */
246
bee34a6a4aec Drop 3 unused variables and comment out 2 unused functions.
zas_
parents: 220
diff changeset
58 #if 0
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 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
60 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 if (!lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
65 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
66 popup_menu_position_clamp(menu, x, y, 0);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 static void layout_image_full_screen_menu_popup(LayoutWindow *lw)
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 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 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
75 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
77 /* this is handled by layout_key_press_cb */
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
78
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
79
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 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
81 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 LayoutWindow *lw = data;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
83 gint stop_signal;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 gint x = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 gint y = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
87 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 case GDK_Left: case GDK_KP_Left:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 x -= 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 case GDK_Right: case GDK_KP_Right:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 x += 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 case GDK_Up: case GDK_KP_Up:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 y -= 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 case GDK_Down: case GDK_KP_Down:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100 y += 1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
101 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
102 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
103 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
107 if (x != 0 || y!= 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
109 if (event->state & GDK_SHIFT_MASK)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
110 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
111 x *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
112 y *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
113 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
114
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
115 keyboard_scroll_calc(&x, &y, event);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
116 layout_image_scroll(lw, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
119 if (stop_signal) return stop_signal;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
120
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121 if (event->state & GDK_CONTROL_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123 gint n = -1;
84
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 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128 case '1':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129 n = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
130 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 case '2':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132 n = 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 case '3':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 n = 2;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137 case '4':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
138 n = 3;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
139 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 case '5':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 n = 4;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
143 case '6':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144 n = 5;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 case '7':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 n = 6;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 case '8':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150 n = 7;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
151 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
152 case '9':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153 n = 8;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
154 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 case '0':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156 n = 9;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
157 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 case 'C': case 'c':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
159 file_util_copy(layout_image_get_fd(lw), NULL, NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 case 'M': case 'm':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
162 file_util_move(layout_image_get_fd(lw), NULL, NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164 case 'R': case 'r':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
165 file_util_rename(layout_image_get_fd(lw), NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
166 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
167 case 'D': case 'd':
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
168 file_util_delete(layout_image_get_fd(lw), NULL, widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 case 'P': case 'p':
479
5212d4fed37f Ensure Properties dialog is displayed above fullscreen window.
zas_
parents: 475
diff changeset
171 info_window_new(layout_image_get_fd(lw), NULL, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
173 case 'Q': case 'q':
278
04abf5b160eb exit_gqview() renamed to exit_program().
zas_
parents: 246
diff changeset
174 exit_program();
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
175 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176 break;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
177 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
178 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
179 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
180 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 if (n != -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
182 {
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
183 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
184 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
185 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
186 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
187 start_editor_from_file(n, layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190 else if (event->state & GDK_SHIFT_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
192 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
193 switch (event->keyval)
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 case 'R': case 'r':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
196 layout_image_alter(lw, ALTER_ROTATE_180);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
197 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
198 case 'M': case 'm':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
199 layout_image_alter(lw, ALTER_MIRROR);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
200 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
201 case 'F': case 'f':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
202 layout_image_alter(lw, ALTER_FLIP);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
203 break;
82
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
204 case 'G': case 'g':
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
205 layout_image_alter(lw, ALTER_DESATURATE);
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
206 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207 default:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
208 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
209 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
210 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
211 }
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
212 else
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
213 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
214 stop_signal = TRUE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
215 switch (event->keyval)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
216 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
217 case '+': case '=': case GDK_KP_Add:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
218 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
219 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
220 case '-': case GDK_KP_Subtract:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
221 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
222 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
223 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
224 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
225 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
226 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
227 case '1':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
228 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
229 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
230 case '2':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
231 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
232 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
233 case '3':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
234 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
235 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
236 case '4':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
237 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
238 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
239 case '7':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
240 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
241 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
242 case '8':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
243 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
244 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
245 case '9':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
246 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
247 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
248 case 'W': case 'w':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
249 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
250 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
251 case 'H': case 'h':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
252 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
253 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
254 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
255 case GDK_BackSpace:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
256 case 'B': case 'b':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
257 layout_image_prev(lw);
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 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
260 case GDK_space:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
261 case 'N': case 'n':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
262 layout_image_next(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
263 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
264 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
265 layout_image_first(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
266 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
267 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
268 layout_image_last(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
269 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
270 case ']':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
271 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
272 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
273 case '[':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
274 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
275 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
276 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
277 if (enable_delete_key)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
278 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
279 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
280 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
281 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
282 case GDK_Escape:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
283 layout_image_full_screen_stop(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
284 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
285 case 'R': case 'r':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
286 layout_refresh(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
287 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
288 case 'S': case 's':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
289 layout_image_slideshow_toggle(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
290 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
291 case 'P': case 'p':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
292 layout_image_slideshow_pause_toggle(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
293 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
294 case 'F': case 'f':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
295 case 'V': case 'v':
86
cade6a52a165 Mon Oct 23 05:34:29 2006 John Ellis <johne@verizon.net>
gqview
parents: 84
diff changeset
296 case GDK_F11:
84
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 GDK_Menu:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
300 case GDK_F10:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
301 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
302 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
303 case 'I': case 'i':
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
304 layout_image_overlay_toggle(lw);
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
305 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
306 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
307 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
308 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
309 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
310 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
311
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
312 return stop_signal;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
313 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
314
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
315 #endif
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
316
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
317 static void layout_image_full_screen_stop_func(FullScreenData *fs, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
318 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
319 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
320
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
321 /* restore image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
322 lw->image = fs->normal_imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
323
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 if (lw->slideshow)
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 lw->slideshow->imd = lw->image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
327 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
328
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
329 lw->full_screen = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
330 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
332 void layout_image_full_screen_start(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
335
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
336 if (lw->full_screen) return;
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 lw->full_screen = fullscreen_start(lw->window, lw->image,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
339 layout_image_full_screen_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
340
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
341 /* set to new image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
342 lw->image = lw->full_screen->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
343
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
344 if (lw->slideshow)
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 lw->slideshow->imd = lw->image;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
349 layout_image_set_buttons(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
351 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
352 G_CALLBACK(layout_key_press_cb), lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
353
160
85657b4766c9 use accels also in fullscreen mode
nadvornik
parents: 156
diff changeset
354 layout_actions_add_window(lw, lw->full_screen->window);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
355 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
356 gtk_widget_set_sensitive(lw->window, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357 if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
360 if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
361 {
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
362 image_osd_set(lw->image, image_osd_get(lw->full_screen->normal_imd));
614
b2898f04c82e image_osd_get() and image_osd_set() now uses flags.
zas_
parents: 586
diff changeset
363 image_osd_set(lw->full_screen->normal_imd, OSD_SHOW_NOTHING);
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
364 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
365 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
366
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
367 void layout_image_full_screen_stop(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
368 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
369 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370 if (!lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
371
621
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
372 if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
373 image_osd_set(lw->full_screen->normal_imd, image_osd_get(lw->image));
734b6b0a3356 image_osd_get() now returns OsdShowFlags.
zas_
parents: 614
diff changeset
374
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
375 fullscreen_stop(lw->full_screen);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
376
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
377 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
378 gtk_widget_set_sensitive(lw->window, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
379 if (lw->tools) gtk_widget_set_sensitive(lw->tools, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
380 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383 void layout_image_full_screen_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
384 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
386 if (lw->full_screen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
387 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388 layout_image_full_screen_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
389 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 else
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 layout_image_full_screen_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
394 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
395
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
396 gint layout_image_full_screen_active(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return FALSE;
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 return (lw->full_screen != NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
401 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
402
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
403 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
404 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
405 * slideshow
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 */
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 static void layout_image_slideshow_next(LayoutWindow *lw)
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 if (lw->slideshow) slideshow_next(lw->slideshow);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
414 static void layout_image_slideshow_prev(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
415 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
416 if (lw->slideshow) slideshow_prev(lw->slideshow);
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 static void layout_image_slideshow_stop_func(SlideShowData *ss, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
420 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
421 LayoutWindow *lw = data;
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 lw->slideshow = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
424 layout_status_update_info(lw, NULL);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
427 void layout_image_slideshow_start(LayoutWindow *lw)
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 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
430 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
431
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
432 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
433 if (lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
434
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
435 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
436
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
437 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
438 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
439 lw->slideshow = slideshow_start_from_collection(lw->image, cd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
440 layout_image_slideshow_stop_func, lw, info);
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 else
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 lw->slideshow = slideshow_start(lw->image, lw,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
445 layout_list_get_index(lw, layout_image_get_path(lw)),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
446 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
447 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
448
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
449 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
450 }
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 /* 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
453 void layout_image_slideshow_start_from_list(LayoutWindow *lw, GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
454 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
455 if (!layout_valid(&lw)) return;
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 if (lw->slideshow || !list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
458 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
459 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
460 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
461 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
462
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
463 lw->slideshow = slideshow_start_from_filelist(lw->image, list,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
464 layout_image_slideshow_stop_func, lw);
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 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
467 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
468
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
469 void layout_image_slideshow_stop(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
470 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
471 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
472
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
473 if (!lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
474
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
475 slideshow_free(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
476 /* the stop_func sets lw->slideshow to NULL for us */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
477 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
478
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
479 void layout_image_slideshow_toggle(LayoutWindow *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 if (!layout_valid(&lw)) return;
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 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
484 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
485 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
486 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
487 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
488 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
489 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
490 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
491 }
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 gint layout_image_slideshow_active(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
494 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
495 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
496
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
497 return (lw->slideshow != NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
498 }
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 gint layout_image_slideshow_pause_toggle(LayoutWindow *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 gint ret;
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 if (!layout_valid(&lw)) return FALSE;
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 ret = slideshow_pause_toggle(lw->slideshow);
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 layout_status_update_info(lw, NULL);
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 return ret;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
513 gint layout_image_slideshow_paused(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return FALSE;
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 return (slideshow_paused(lw->slideshow));
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
520 static gint layout_image_slideshow_continue_check(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
521 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
522 if (!lw->slideshow) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
523
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
524 if (!slideshow_should_continue(lw->slideshow))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
525 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
526 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
527 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
528 }
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 return TRUE;
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
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 * pop-up menus
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 */
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 static void li_pop_menu_zoom_in_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
542
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
543 layout_image_zoom_adjust(lw, get_zoom_increment());
9
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
546 static void li_pop_menu_zoom_out_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
549 layout_image_zoom_adjust(lw, -get_zoom_increment());
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
550 }
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 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
553 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
554 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
555
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
556 layout_image_zoom_set(lw, 1.0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
557 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
558
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
559 static void li_pop_menu_zoom_fit_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
562
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
563 layout_image_zoom_set(lw, 0.0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
564 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
565
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
566 static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
567 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
568 LayoutWindow *lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
569 gint n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
570
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
571 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
572 n = GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
573
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
574 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
575 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
576 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
577 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
578 start_editor_from_file(n, layout_image_get_fd(lw));
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_wallpaper_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 = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
584
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
585 layout_image_to_root(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
586 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
587
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
588 static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
589 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
590 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
591 AlterType type;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
592
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
593 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
594 type = (AlterType)GPOINTER_TO_INT(data);
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 image_alter(lw->image, type);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
599 static void li_pop_menu_info_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
600 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
601 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
602
479
5212d4fed37f Ensure Properties dialog is displayed above fullscreen window.
zas_
parents: 475
diff changeset
603 info_window_new(layout_image_get_fd(lw), NULL, lw->full_screen ? lw->full_screen->window : NULL);
9
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
606 static void li_pop_menu_new_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
609
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
610 view_window_new(layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
611 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
612
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
613 static GtkWidget *li_pop_menu_click_parent(GtkWidget *widget, LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
614 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
615 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
616 GtkWidget *parent;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
617
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
618 menu = gtk_widget_get_toplevel(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
619 if (!menu) return NULL;
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 parent = g_object_get_data(G_OBJECT(menu), "click_parent");
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 if (!parent && lw->full_screen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
624 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
625 parent = lw->full_screen->imd->widget;
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 return parent;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
631 static void li_pop_menu_copy_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
634
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
635 file_util_copy(layout_image_get_fd(lw), NULL, NULL,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
636 li_pop_menu_click_parent(widget, lw));
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
497
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
639 static void li_pop_menu_copy_path_cb(GtkWidget *widget, gpointer data)
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
640 {
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
641 LayoutWindow *lw = data;
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
642
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
643 file_util_copy_path_to_clipboard(layout_image_get_fd(lw));
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
644 }
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
645
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
646 static void li_pop_menu_move_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_move(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_rename_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_rename(layout_image_get_fd(lw), 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_delete_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_delete(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_slide_start_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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
674 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
675 }
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 static void li_pop_menu_slide_stop_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
678 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
679 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
680
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
681 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
682 }
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 static void li_pop_menu_slide_pause_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
685 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
686 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
687
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
688 layout_image_slideshow_pause_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
689 }
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 static void li_pop_menu_full_screen_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
692 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
693 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
694
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
695 layout_image_full_screen_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
696 }
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 static void li_pop_menu_hide_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
699 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
700 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
701
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
702 layout_tools_hide_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
703 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
704
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
705 static void li_set_layout_path_cb(GtkWidget *widget, gpointer data)
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
706 {
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
707 LayoutWindow *lw = data;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
708 const gchar *path;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
709
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
710 if (!layout_valid(&lw)) return;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
711
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
712 path = layout_image_get_path(lw);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
713 if (path) layout_set_path(lw, path);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
714 }
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
715
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
716 static gint li_check_if_current_path(LayoutWindow *lw, const gchar *path)
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
717 {
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
718 gchar *dirname;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
719 gint ret;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
720
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
721 if (!path || !layout_valid(&lw) || !lw->path) return FALSE;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
722
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
723 dirname = g_path_get_dirname(path);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
724 ret = (strcmp(lw->path, dirname) == 0);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
725 g_free(dirname);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
726 return ret;
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
727 }
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
728
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
729 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
730 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
731 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
732 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
733 GtkWidget *submenu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
734 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
735 gint fullscreen;
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 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
738 fullscreen = layout_image_full_screen_active(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
739
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
740 menu = popup_menu_short_lived();
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 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
743 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
744 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
745 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
746 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
747
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
748 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
749 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
750 menu_item_add_divider(submenu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
751 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
752
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
753 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
754
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
755 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
756 if (!path) gtk_widget_set_sensitive(item, FALSE);
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 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
759 if (!path || fullscreen) gtk_widget_set_sensitive(item, FALSE);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
760
368
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
761 item = menu_item_add(menu, _("_Go to directory view"), G_CALLBACK(li_set_layout_path_cb), lw);
95fe470440ad New Go to directory view feature that permits to find and display the directory
zas_
parents: 339
diff changeset
762 if (!path || li_check_if_current_path(lw, path)) gtk_widget_set_sensitive(item, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
763
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
764 menu_item_add_divider(menu);
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 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
767 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
768 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
769 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
770 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
771 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
772 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
773 if (!path) gtk_widget_set_sensitive(item, FALSE);
497
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
774
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
775 if (options->show_copy_path)
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
776 {
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
777 item = menu_item_add(menu, _("_Copy path"), G_CALLBACK(li_pop_menu_copy_path_cb), lw);
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
778 if (!path) gtk_widget_set_sensitive(item, FALSE);
a33badd85f16 Allow the copy of file paths to clipboard.
zas_
parents: 495
diff changeset
779 }
9
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_divider(menu);
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 if (layout_image_slideshow_active(lw))
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, _("_Stop slideshow"), G_CALLBACK(li_pop_menu_slide_stop_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
786 if (layout_image_slideshow_paused(lw))
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 item = menu_item_add(menu, _("Continue slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
789 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
790 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
791 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
792 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
793 item = menu_item_add(menu, _("Pause slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
794 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
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 else
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
798 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
799 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
800 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
801 gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
802 }
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 if (!fullscreen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
805 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
806 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
807 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
808 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
809 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
810 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
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 menu_item_add_divider(menu);
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 item = menu_item_add_check(menu, _("Hide file _list"), lw->tools_hidden,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
816 G_CALLBACK(li_pop_menu_hide_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
817 if (fullscreen) gtk_widget_set_sensitive(item, FALSE);
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 return menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
820 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
821
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
822 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
823 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
824 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
825
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
826 gdk_window_get_origin(lw->image->pr->window, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
827 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
828 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
829
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
830 void layout_image_menu_popup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
831 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
832 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
833
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
834 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
835 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
836 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
837
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
838 /*
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 * dnd
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 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
843
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
844 static void layout_image_dnd_receive(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
845 gint x, gint y,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
846 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
847 guint time, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
848 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
849 LayoutWindow *lw = data;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
850 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
851
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
852
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
853 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
854 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
855 if (lw->split_images[i] && lw->split_images[i]->pr == widget)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
856 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
857 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
858 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
859 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 497
diff changeset
860 DEBUG_1("dnd image activate %d", i);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
861 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
862 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
863
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
864
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
865 if (info == TARGET_URI_LIST || info == TARGET_APP_COLLECTION_MEMBER)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
866 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
867 CollectionData *source;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
868 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
869 GList *info_list;
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 if (info == TARGET_URI_LIST)
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 list = uri_filelist_from_text((gchar *)selection_data->data, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
874 source = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
875 info_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
876 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
877 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
878 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
879 source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
880 }
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 if (list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
883 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
884 FileData *fd = list->data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
885
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
886 if (isfile(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
887 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
888 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
889 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
890
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
891 base = remove_level_from_path(fd->path);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
892 if (strcmp(base, layout_get_path(lw)) != 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
893 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
894 layout_set_path(lw, base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
895 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
896 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
897
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
898 row = layout_list_get_index(lw, fd->path);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
899 if (source && info_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
900 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
901 layout_image_set_collection(lw, source, info_list->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 else if (row == -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
904 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
905 layout_image_set_fd(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
906 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
907 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
908 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
909 layout_image_set_index(lw, row);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
910 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
911 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
912 else if (isdir(fd->path))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
913 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
914 layout_set_path(lw, fd->path);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
915 layout_image_set_fd(lw, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
916 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
917 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
918
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
919 filelist_free(list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
920 g_list_free(info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
921 }
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
924 static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
925 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
926 guint time, gpointer data)
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 LayoutWindow *lw = data;
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
929 FileData *fd;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
930 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
931
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
932
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
933 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
934 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
935 if (lw->split_images[i] && lw->split_images[i]->pr == widget)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
936 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
937 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
938 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
939 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 497
diff changeset
940 DEBUG_1("dnd get from %d", i);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
941 fd = image_get_fd(lw->split_images[i]);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
942 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
943 else
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
944 fd = layout_image_get_fd(lw);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
945
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
946 if (fd)
9
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 gchar *text = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
949 gint len;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
950 gint plain_text;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
951 GList *list;
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 switch (info)
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 case TARGET_URI_LIST:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
956 plain_text = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
957 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
958 case TARGET_TEXT_PLAIN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
959 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
960 plain_text = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
961 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
962 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
963 list = g_list_append(NULL, fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
964 text = uri_text_from_filelist(list, &len, plain_text);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
965 g_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
966 if (text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
967 {
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
968 gtk_selection_data_set(selection_data, selection_data->target,
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
969 8, (guchar *)text, len);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
970 g_free(text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
971 }
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 {
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
975 gtk_selection_data_set(selection_data, selection_data->target,
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
976 8, NULL, 0);
9
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 }
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 static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
981 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
982 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
983 if (context->action == GDK_ACTION_MOVE)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
984 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
985 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
986 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
987
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
988 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
989 row = layout_list_get_index(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
990 if (row < 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
991
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
992 if (!isfile(path))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
993 {
736
a7289f9e8d29 Fix signed vs unsigned warnings.
zas_
parents: 671
diff changeset
994 if ((guint) row < layout_list_count(lw, NULL) - 1)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
995 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
996 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
997 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
998 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
999 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1000 layout_image_prev(lw);
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 layout_refresh(lw);
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 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1006
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1007 static void layout_image_dnd_init(LayoutWindow *lw, gint i)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1008 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1009 ImageWindow *imd = lw->split_images[i];
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1010
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1011 gtk_drag_source_set(imd->pr, GDK_BUTTON2_MASK,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1012 dnd_file_drag_types, dnd_file_drag_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1013 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1014 g_signal_connect(G_OBJECT(imd->pr), "drag_data_get",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1015 G_CALLBACK(layout_image_dnd_get), lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1016 g_signal_connect(G_OBJECT(imd->pr), "drag_end",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1017 G_CALLBACK(layout_image_dnd_end), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1018
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1019 gtk_drag_dest_set(imd->pr,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1020 GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1021 dnd_file_drop_types, dnd_file_drop_types_count,
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1022 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1023 g_signal_connect(G_OBJECT(imd->pr), "drag_data_received",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1024 G_CALLBACK(layout_image_dnd_receive), lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1028 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1029 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1030 * misc
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 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1033
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1034 void layout_image_to_root(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1035 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1036 image_to_root_window(lw->image, (image_zoom_get(lw->image) == 0));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1037 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1038
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 * manipulation + accessors
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1042 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1043 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1044
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1045 void layout_image_scroll(LayoutWindow *lw, gint x, gint y)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1046 {
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1047 gdouble dx, dy;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1048 gint width, height, i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1049 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1050
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1051 image_scroll(lw->image, x, y);
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1052
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1053 image_get_image_size(lw->image, &width, &height);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1054 dx = (gdouble) x / width;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1055 dy = (gdouble) y / height;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1056
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1057 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1058 {
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1059 if (lw->split_images[i] && lw->split_images[i] != lw->image && lw->connect_scroll)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1060 {
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1061 gdouble sx, sy;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1062 image_get_scroll_center(lw->split_images[i], &sx, &sy);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1063 sx += dx;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1064 sy += dy;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1065 image_set_scroll_center(lw->split_images[i], sx, sy);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1066 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1067 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1068
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1069 }
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 void layout_image_zoom_adjust(LayoutWindow *lw, gdouble increment)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1072 {
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1073 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1074 if (!layout_valid(&lw)) return;
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 image_zoom_adjust(lw->image, increment);
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1077
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1078 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1079 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1080 if (lw->split_images[i] && lw->split_images[i] != lw->image && lw->connect_zoom)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1081 image_zoom_adjust(lw->split_images[i], increment); ;
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1082 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1083 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1084
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1085 void layout_image_zoom_adjust_at_point(LayoutWindow *lw, gdouble increment, gint x, gint y)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1086 {
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1087 gint i;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1088 if (!layout_valid(&lw)) return;
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1089
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1090 image_zoom_adjust_at_point(lw->image, increment, x, y);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1091
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1092 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1093 {
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1094 if (lw->split_images[i] && lw->split_images[i] != lw->image && lw->connect_zoom)
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1095 image_zoom_adjust_at_point(lw->split_images[i], increment, x, y);
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1096 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1097 }
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1098
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1099 void layout_image_zoom_set(LayoutWindow *lw, gdouble zoom)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1100 {
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1101 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1102 if (!layout_valid(&lw)) return;
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_zoom_set(lw->image, zoom);
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1105
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1106 for (i=0; i < MAX_SPLIT_IMAGES; i++)
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1107 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1108 if (lw->split_images[i] && lw->split_images[i] != lw->image && lw->connect_zoom)
130
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1109 image_zoom_set(lw->split_images[i], zoom);
7ea9fbcff664 connected zoom
nadvornik
parents: 129
diff changeset
1110 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1111 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1112
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1113 void layout_image_zoom_set_fill_geometry(LayoutWindow *lw, gint vertical)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1114 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1115 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1116
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1117 image_zoom_set_fill_geometry(lw->image, vertical);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1118 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1119
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1120 void layout_image_alter(LayoutWindow *lw, AlterType type)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1121 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1122 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1123
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1124 image_alter(lw->image, type);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1127 const gchar *layout_image_get_path(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1128 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1129 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1130
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1131 return image_get_path(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1132 }
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 const gchar *layout_image_get_name(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1135 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1136 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1137
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1138 return image_get_name(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1139 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1140
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1141 FileData *layout_image_get_fd(LayoutWindow *lw)
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1142 {
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1143 if (!layout_valid(&lw)) return NULL;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1144
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1145 return image_get_fd(lw->image);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1146 }
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1147
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1148 CollectionData *layout_image_get_collection(LayoutWindow *lw, CollectInfo **info)
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 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1151
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1152 return image_get_collection(lw->image, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1153 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1154
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1155 gint layout_image_get_index(LayoutWindow *lw)
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 return layout_list_get_index(lw, image_get_path(lw->image));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1158 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1159
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 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1162 * image changers
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1163 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1164 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1165
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1166 void layout_image_set_fd(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1167 {
131
b1acdfc7271b relative scroll is working; some cleanup
nadvornik
parents: 130
diff changeset
1168 gdouble sx, sy;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1169 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1170
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1171 image_get_scroll_center(lw->image, &sx, &sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1172
334
df868b947aa0 Rename image-related options.
zas_
parents: 327
diff changeset
1173 image_change_fd(lw->image, fd, image_zoom_get_default(lw->image, options->image.zoom_mode));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1174
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1175 image_set_scroll_center(lw->image, sx, sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1176
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1177 layout_list_sync_fd(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1178 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1179 layout_bars_new_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1180 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1181
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1182 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
1183 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1184 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1185
144
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
1186 /*
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
1187 This should be handled at the caller: in vflist_select_image
2310066cc55a fixed preloading images in file list
nadvornik
parents: 138
diff changeset
1188 if (path)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1189 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1190 const gchar *old_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1191
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1192 old_path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1193 if (old_path && strcmp(path, old_path) == 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1194 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1195 */
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1196 layout_image_set_fd(lw, fd);
334
df868b947aa0 Rename image-related options.
zas_
parents: 327
diff changeset
1197 if (options->image.enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1198 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1199
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1200 void layout_image_set_index(LayoutWindow *lw, gint index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1201 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1202 FileData *fd;
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1203 FileData *read_ahead_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1204 gint old;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1205
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1206 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1207
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1208 old = layout_list_get_index(lw, layout_image_get_path(lw));
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1209 fd = layout_list_get_fd(lw, index);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1210
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1211 if (old > index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1212 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1213 read_ahead_fd = layout_list_get_fd(lw, index - 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1214 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1215 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1216 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1217 read_ahead_fd = layout_list_get_fd(lw, index + 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1218 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1219
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1220 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1221 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1222 GList *x = layout_selection_list_by_index(lw);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1223 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1224 GList *last;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1225
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1226 for (last = y = x; y; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1227 last = y;
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1228 for (y = x; y && (GPOINTER_TO_INT(y->data)) != index; y = y->next)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1229 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1230
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1231 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1232 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1233 gint newindex;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1234
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1235 if ((index > old && (index != GPOINTER_TO_INT(last->data) || old != GPOINTER_TO_INT(x->data)))
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1236 || (old == GPOINTER_TO_INT(last->data) && index == GPOINTER_TO_INT(x->data)))
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1237 {
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1238 if (y->next)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1239 newindex = GPOINTER_TO_INT(y->next->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1240 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1241 newindex = GPOINTER_TO_INT(x->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1242 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1243 else
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1244 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1245 if (y->prev)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1246 newindex = GPOINTER_TO_INT(y->prev->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1247 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1248 newindex = GPOINTER_TO_INT(last->data);
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1249 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1250
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1251 read_ahead_fd = layout_list_get_fd(lw, newindex);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1252 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1253
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1254 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1255 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1256 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1257
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1258 layout_image_set_with_ahead(lw, fd, read_ahead_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1259 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1260
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1261 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
1262 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1263 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1264
334
df868b947aa0 Rename image-related options.
zas_
parents: 327
diff changeset
1265 image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image, options->image.zoom_mode));
df868b947aa0 Rename image-related options.
zas_
parents: 327
diff changeset
1266 if (options->image.enable_read_ahead)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1267 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1268 CollectInfo *r_info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1269 if (forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1270 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1271 r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1272 if (!r_info) r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1273 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1274 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1275 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1276 r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1277 if (!r_info) r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1278 }
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1279 if (r_info) image_prebuffer_set(lw->image, r_info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1280 }
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 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1283 layout_bars_new_image(lw);
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 void layout_image_set_collection(LayoutWindow *lw, CollectionData *cd, CollectInfo *info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1287 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1288 layout_image_set_collection_real(lw, cd, info, TRUE);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1289 layout_list_sync_fd(lw, layout_image_get_fd(lw));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1290 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1291
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1292 void layout_image_refresh(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1293 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1294 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1295
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1296 image_reload(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1297 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1298
113
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1299 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
1300 gint input_type, gint screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1301 gint use_image)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1302 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1303 if (!layout_valid(&lw)) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1304
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1305 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
1306 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1307
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1308 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
1309 gint *input_type, gint *screen_type,
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1310 gint *use_image)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1311 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1312 if (!layout_valid(&lw)) return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1313
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1314 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
1315 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1316
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1317 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
1318 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1319 if (!layout_valid(&lw)) return;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1320
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1321 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
1322
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1323 if (lw->info_color)
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1324 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1325 #ifndef HAVE_LCMS
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1326 enable = FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1327 #endif
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1328 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
1329 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1330 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1331
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1332 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
1333 {
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1334 if (!layout_valid(&lw)) return FALSE;
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1335
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1336 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
1337 }
55166d93498d Fri Nov 24 21:37:01 2006 John Ellis <johne@verizon.net>
gqview
parents: 86
diff changeset
1338
426
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1339 gint layout_image_color_profile_get_from_image(LayoutWindow *lw)
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1340 {
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1341 if (!layout_valid(&lw)) return FALSE;
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1342
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1343 return image_color_profile_get_from_image(lw->image);
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1344 }
9fe0ca1b5263 show the AdobeRGB profile in the menu, indicate input profile from image
nadvornik
parents: 369
diff changeset
1345
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1346 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1347 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1348 * list walkers
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1349 *----------------------------------------------------------------------------
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1352 void layout_image_next(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1353 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1354 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1355 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1356 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1357
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1358 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1359
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1360 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1361 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1362 layout_image_slideshow_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1363 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
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1366 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1367 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1368 GList *x = layout_selection_list_by_index(lw);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1369 gint old = layout_list_get_index(lw, layout_image_get_path(lw));
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1370 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1371
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1372 for (y = x; y && (GPOINTER_TO_INT(y->data)) != old; y = y->next)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1373 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1374 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1375 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1376 if (y->next)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1377 layout_image_set_index(lw, GPOINTER_TO_INT(y->next->data));
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1378 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1379 layout_image_set_index(lw, GPOINTER_TO_INT(x->data));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1380 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1381 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1382 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1383 if (y) /* not dereferenced */
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1384 return;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1385 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1386
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1387 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1388
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1389 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1390 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1391 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
1392 if (info)
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1393 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1394 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
1395 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1396 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1397 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1398 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
1399 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1400 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1401 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1402
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1403 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1404
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1405 if (current >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1406 {
736
a7289f9e8d29 Fix signed vs unsigned warnings.
zas_
parents: 671
diff changeset
1407 if ((guint) current < layout_list_count(lw, NULL) - 1)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1408 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1409 layout_image_set_index(lw, current + 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1410 }
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1411 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1412 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1413 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
1414 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1415 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1416 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1417 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1418 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1419 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1420 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1421
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1422 void layout_image_prev(LayoutWindow *lw)
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 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1425 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1426 CollectInfo *info;
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 if (!layout_valid(&lw)) return;
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 if (layout_image_slideshow_active(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 layout_image_slideshow_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1433 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1434 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1435
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1436 if (layout_selection_count(lw, 0) > 1)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1437 {
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1438 GList *x = layout_selection_list_by_index(lw);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1439 gint old = layout_list_get_index(lw, layout_image_get_path(lw));
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1440 GList *y;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1441 GList *last;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1442
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1443 for (last = y = x; y; y = y->next)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1444 last = y;
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1445 for (y = x; y && (GPOINTER_TO_INT(y->data)) != old; y = y->next)
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1446 ;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1447 if (y)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1448 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1449 if (y->prev)
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1450 layout_image_set_index(lw, GPOINTER_TO_INT(y->prev->data));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1451 else
529
8815fea478ee fix warning cast from pointer to integer of different size (when an integer is
bruclik
parents: 520
diff changeset
1452 layout_image_set_index(lw, GPOINTER_TO_INT(last->data));
220
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1453 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1454 while (x)
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1455 x = g_list_remove(x, x->data);
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1456 if (y) /* not dereferenced */
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1457 return;
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1458 }
7670d5653e1f Honor selection while fullscreen navigation.
zas_
parents: 208
diff changeset
1459
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1460 cd = image_get_collection(lw->image, &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 (cd && info)
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 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
1465 if (info)
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1466 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1467 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
1468 }
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1469 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1470 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1471 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
1472 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1473 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1474 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1475
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1476 current = layout_image_get_index(lw);
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 if (current >= 0)
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 if (current > 0)
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 layout_image_set_index(lw, current - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1483 }
122
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1484 else
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1485 {
e2a8b7f2165b Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net>
gqview
parents: 117
diff changeset
1486 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
1487 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1488 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1489 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1490 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1491 layout_image_set_index(lw, layout_list_count(lw, NULL) - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1492 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1493 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1494
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1495 void layout_image_first(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1496 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1497 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1498 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1499 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1500
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1501 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1502
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1503 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1504
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1505 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1506 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1507 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1508 new = collection_get_first(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1509 if (new != info) layout_image_set_collection_real(lw, cd, new, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1510 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1511 }
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 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1514 if (current != 0 && layout_list_count(lw, NULL) > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1515 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1516 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1517 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1518 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1519
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1520 void layout_image_last(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1521 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1522 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1523 gint count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1524 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1525 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1526
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1527 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1528
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1529 cd = image_get_collection(lw->image, &info);
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 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1532 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1533 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1534 new = collection_get_last(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1535 if (new != info) layout_image_set_collection_real(lw, cd, new, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1536 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1537 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1538
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1539 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1540 count = layout_list_count(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1541 if (current != count - 1 && count > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1542 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1543 layout_image_set_index(lw, count - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1544 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1545 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1546
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 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1549 * mouse callbacks
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1550 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1551 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1552
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1553 static gint image_idx(LayoutWindow *lw, ImageWindow *imd)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1554 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1555 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1556
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1557 for (i = 0; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1558 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1559 if (lw->split_images[i] == imd)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1560 break;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1561 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1562 if (i < MAX_SPLIT_IMAGES)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1563 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1564 return i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1565 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1566 return -1;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1567 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1568
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1569
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1570 static void layout_image_button_cb(ImageWindow *imd, gint button, guint32 time,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1571 gdouble x, gdouble y, guint state, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1572 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1573 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1574 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1575
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1576 switch (button)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1577 {
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1578 case MOUSE_BUTTON_LEFT:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1579 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1580 break;
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1581 case MOUSE_BUTTON_MIDDLE:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1582 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1583 break;
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1584 case MOUSE_BUTTON_RIGHT:
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1585 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1586 if (imd == lw->image)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1587 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1588 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1589 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1590 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, time);
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 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1593 break;
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 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1596
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1597 static void layout_image_scroll_cb(ImageWindow *imd, GdkScrollDirection direction, guint32 time,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1598 gdouble x, gdouble y, guint state, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1599 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1600 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1601
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1602 gint i = image_idx(lw, imd);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1603
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1604 if (i != -1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1605 {
506
fc9c8a3e1a8b Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents: 497
diff changeset
1606 DEBUG_1("image activate scroll %d", i);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1607 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1608 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1609
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1610
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1611 if (state & GDK_CONTROL_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1612 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1613 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1614 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1615 case GDK_SCROLL_UP:
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1616 layout_image_zoom_adjust_at_point(lw, get_zoom_increment(), x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1617 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1618 case GDK_SCROLL_DOWN:
530
1d67ef911fa8 fixed connected zoom and scroll that didn't work in some cases
nadvornik
parents: 529
diff changeset
1619 layout_image_zoom_adjust_at_point(lw, -get_zoom_increment(), x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1620 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1621 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1622 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1623 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1624 }
736
a7289f9e8d29 Fix signed vs unsigned warnings.
zas_
parents: 671
diff changeset
1625 else if ( (state & GDK_SHIFT_MASK) != (guint) (options->mousewheel_scrolls))
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1626 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1627 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1628 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1629 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1630 image_scroll(imd, 0, -MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1631 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1632 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1633 image_scroll(imd, 0, MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1634 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1635 case GDK_SCROLL_LEFT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1636 image_scroll(imd, -MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1637 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1638 case GDK_SCROLL_RIGHT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1639 image_scroll(imd, MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1640 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1641 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1642 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1643 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1644 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1645 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1646 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1647 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1648 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1649 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1650 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1651 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1652 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1653 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1654 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1655 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1656 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1657 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1658 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1659 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1660
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1661 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
1662 gdouble x, gdouble y, guint state, gdouble dx, gdouble dy, gpointer data)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1663 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1664 gint i;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1665 LayoutWindow *lw = data;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1666
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1667
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1668 for (i=0; i < MAX_SPLIT_IMAGES; i++)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1669 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1670 if (lw->split_images[i] && lw->split_images[i] != imd)
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1671 if (lw->connect_scroll)
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1672 {
131
b1acdfc7271b relative scroll is working; some cleanup
nadvornik
parents: 130
diff changeset
1673 gdouble sx, sy;
b1acdfc7271b relative scroll is working; some cleanup
nadvornik
parents: 130
diff changeset
1674 if (state & GDK_CONTROL_MASK)
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1675 {
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1676 image_get_scroll_center(imd, &sx, &sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1677 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1678 else
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1679 {
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1680 image_get_scroll_center(lw->split_images[i], &sx, &sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1681 sx += dx;
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1682 sy += dy;
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1683 }
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1684 image_set_scroll_center(lw->split_images[i], sx, sy);
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1685 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1686 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1687 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1688
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1689 static void layout_image_button_inactive_cb(ImageWindow *imd, gint button, guint32 time,
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1690 gdouble x, gdouble y, guint state, gpointer data)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1691 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1692 LayoutWindow *lw = data;
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1693 GtkWidget *menu;
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1694 gint i = image_idx(lw, imd);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1695
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1696 if (i != -1)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1697 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1698 layout_image_activate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1699 }
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1700
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1701 switch (button)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1702 {
448
a73cc0fa14d0 Use explicit names for mouse buttons instead of numbers.
zas_
parents: 446
diff changeset
1703 case MOUSE_BUTTON_RIGHT:
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1704 menu = layout_image_pop_menu(lw);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1705 if (imd == lw->image)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1706 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1707 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1708 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1709 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
1710 break;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1711 default:
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1712 break;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1713 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1714
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1715 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1716
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1717 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
1718 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
1719 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1720 LayoutWindow *lw = data;
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1721
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1722 gint i = image_idx(lw, imd);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1723
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1724 if (i != -1)
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1725 {
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1726 layout_image_activate(lw, i);
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1727 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1728
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1729
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1730 /* continue as with active image */
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1731 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
1732 }
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1733
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1734
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1735 static void layout_image_set_buttons(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1736 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1737 image_set_button_func(lw->image, layout_image_button_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1738 image_set_scroll_func(lw->image, layout_image_scroll_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1739 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1740
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1741 static void layout_image_set_buttons_inactive(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1742 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1743 image_set_button_func(lw->split_images[i], layout_image_button_inactive_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1744 image_set_scroll_func(lw->split_images[i], layout_image_scroll_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1745 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1746
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1747 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1748 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1749 * setup
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1750 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1751 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1752
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1753 static void layout_image_update_cb(ImageWindow *imd, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1754 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1755 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1756 layout_status_update_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1757 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1758
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1759 GtkWidget *layout_image_new(LayoutWindow *lw, gint i)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1760 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1761 if (!lw->split_images[i])
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1762 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1763 lw->split_images[i] = image_new(TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1764
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1765 gtk_widget_ref(lw->split_images[i]->widget);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1766
339
de1c2cd06fce Rename user_specified_window_background and window_background_color
zas_
parents: 334
diff changeset
1767 image_background_set_color(lw->split_images[i], options->image.use_custom_border_color ? &options->image.border_color : NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1768
207
ec068409bee7 fixed color management initialization
nadvornik
parents: 196
diff changeset
1769 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
1770
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1771 layout_image_dnd_init(lw, i);
207
ec068409bee7 fixed color management initialization
nadvornik
parents: 196
diff changeset
1772 image_color_profile_set(lw->split_images[i],
327
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1773 options->color_profile.input_type,
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1774 options->color_profile.screen_type,
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1775 options->color_profile.use_image);
049d6b00cc14 Rename color profile options.
zas_
parents: 320
diff changeset
1776 image_color_profile_set_use(lw->split_images[i], options->color_profile.enabled);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1777 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1778
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1779 return lw->split_images[i]->widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1780 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1781
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1782 void layout_image_deactivate(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1783 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1784
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1785 if (!lw->split_images[i]) return;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1786 image_set_update_func(lw->split_images[i], NULL, NULL);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1787 layout_image_set_buttons_inactive(lw, i);
129
89fc00ffbce2 started relative scroll, keep scroll position
nadvornik
parents: 128
diff changeset
1788 image_set_drag_func(lw->split_images[i], layout_image_drag_inactive_cb, lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1789
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1790 image_attach_window(lw->split_images[i], NULL, NULL, NULL, FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1791 image_select(lw->split_images[i], FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1792 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1793
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1794
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1795 void layout_image_activate(LayoutWindow *lw, gint i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1796 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1797 FileData *fd;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1798
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1799 if (!lw->split_images[i]) return;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1800
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1801 /* deactivate currently active */
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1802 if (lw->active_split_image != i)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1803 layout_image_deactivate(lw, lw->active_split_image);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1804
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1805 lw->image = lw->split_images[i];
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1806 lw->active_split_image = i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1807
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1808 image_set_update_func(lw->image, layout_image_update_cb, lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1809 layout_image_set_buttons(lw);
128
98e2632b5d3d improved connected scroll and active image switching
nadvornik
parents: 127
diff changeset
1810 image_set_drag_func(lw->image, layout_image_drag_cb, lw);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1811
288
d1f74154463e Replace occurences of Geeqie / geeqie by constants defined in main.h.
zas_
parents: 281
diff changeset
1812 image_attach_window(lw->image, lw->window, NULL, GQ_APPNAME, FALSE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1813
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1814 /* do not hilight selected image in SPLIT_NONE */
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1815 /* 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
1816 another image option */
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1817 if (lw->split_mode != SPLIT_NONE)
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1818 image_select(lw->split_images[i], TRUE);
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1819 else
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1820 image_select(lw->split_images[i], FALSE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1821
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1822 fd = image_get_fd(lw->image);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1823
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1824 if (fd)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1825 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1826 // layout_list_sync_path(lw, path);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
1827 layout_set_path(lw, fd->path);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1828 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1829 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1830
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1831
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1832 GtkWidget *layout_image_setup_split_none(LayoutWindow *lw)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1833 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1834 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1835
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1836 lw->split_mode = SPLIT_NONE;
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1837
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1838 if (!lw->split_images[0])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1839 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1840 layout_image_new(lw, 0);
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1841 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
1842 image_set_selectable(lw->split_images[0], 0);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1843 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1844 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1845 else
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1846 {
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1847 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
1848 image_set_selectable(lw->split_images[0], 0);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1849 }
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1850
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1851 for (i = 1; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1852 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1853 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1854 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1855 gtk_widget_unref(lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1856 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1857 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1858 }
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1859
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1860
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1861 layout_image_activate(lw, 0);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1862
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1863 lw->split_image_widget = lw->split_images[0]->widget;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1864
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1865 return lw->split_image_widget;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1866 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1867
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1868 GtkWidget *layout_image_setup_split_hv(LayoutWindow *lw, gboolean horizontal)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1869 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1870 GtkWidget *paned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1871 gint i;
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1872
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1873 lw->split_mode = horizontal ? SPLIT_HOR : SPLIT_VERT;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1874
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1875 if (!lw->split_images[0])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1876 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1877 layout_image_new(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1878 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1879 image_set_frame(lw->split_images[0], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1880 image_set_selectable(lw->split_images[0], 1);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1881
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1882 if (!lw->split_images[1])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1883 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1884 layout_image_new(lw, 1);
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1885 image_set_frame(lw->split_images[1], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1886 image_set_selectable(lw->split_images[1], 1);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1887 if (lw->image)
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1888 {
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1889 gdouble sx, sy;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1890 image_change_fd(lw->split_images[1],
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1891 image_get_fd(lw->image), image_zoom_get(lw->image));
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1892 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
1893 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
1894 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1895 layout_image_deactivate(lw, 1);
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1896 layout_image_activate(lw, 0);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1897 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1898 else
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1899 {
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1900 image_set_frame(lw->split_images[1], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1901 image_set_selectable(lw->split_images[1], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1902 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1903
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1904
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1905 for (i = 2; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1906 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1907 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1908 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1909 gtk_widget_unref(lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1910 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1911 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1912 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1913
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1914 if (!lw->image || lw->active_split_image < 0 || lw->active_split_image > 1)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1915 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1916 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1917 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1918
156
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1919 /* horizontal split means vpaned and vice versa */
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1920 if (horizontal)
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1921 paned = gtk_vpaned_new();
156
dd6dc0a55d3d better integration of split image functions into menu
nadvornik
parents: 153
diff changeset
1922 else
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1923 paned = gtk_hpaned_new();
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1924
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1925 gtk_paned_pack1(GTK_PANED(paned), lw->split_images[0]->widget, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1926 gtk_paned_pack2(GTK_PANED(paned), lw->split_images[1]->widget, TRUE, TRUE);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1927
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1928 gtk_widget_show(lw->split_images[0]->widget);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1929 gtk_widget_show(lw->split_images[1]->widget);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1930
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1931
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1932 lw->split_image_widget = paned;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1933
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1934 return lw->split_image_widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1935
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1936 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1937
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1938 GtkWidget *layout_image_setup_split_quad(LayoutWindow *lw)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1939 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1940 GtkWidget *hpaned;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1941 GtkWidget *vpaned1;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1942 GtkWidget *vpaned2;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1943 gint i;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1944
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1945 lw->split_mode = SPLIT_QUAD;
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1946
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1947 if (!lw->split_images[0])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1948 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1949 layout_image_new(lw, 0);
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1950 }
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1951
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1952 image_set_frame(lw->split_images[0], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1953 image_set_selectable(lw->split_images[0], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1954
152
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1955 if (!lw->split_images[1])
2c534c7c8c1f do not hilight selected image in SPLIT_NONE
nadvornik
parents: 144
diff changeset
1956 {
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1957 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1958 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1959
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1960 for (i = 1; i < 4; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1961 if (!lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1962 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1963 layout_image_new(lw, i);
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1964 image_set_frame(lw->split_images[i], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1965 image_set_selectable(lw->split_images[i], 1);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1966 if (lw->image)
153
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1967 {
0e54267762f6 fixed copying zoom an scroll values from the original image on splitting
nadvornik
parents: 152
diff changeset
1968 gdouble sx, sy;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1969 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
1970 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
1971 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
1972 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
1973 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1974 layout_image_deactivate(lw, i);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1975 }
175
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1976 else
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1977 {
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1978 image_set_frame(lw->split_images[i], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1979 image_set_selectable(lw->split_images[i], 1);
682705e0c0e0 do not show frame for full-window images
nadvornik
parents: 174
diff changeset
1980 }
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1981
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
1982 for (i = 4; i < MAX_SPLIT_IMAGES; i++)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1983 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1984 if (lw->split_images[i])
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1985 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1986 gtk_widget_unref(lw->split_images[i]->widget);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1987 lw->split_images[i] = NULL;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1988 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1989 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1990
174
126724275319 improved drawing of image frames
nadvornik
parents: 160
diff changeset
1991
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
1992 if (!lw->image || lw->active_split_image < 0 || lw->active_split_image > 3)
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1993 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1994 layout_image_activate(lw, 0);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1995 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
1996
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1997 hpaned = gtk_hpaned_new();
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1998 vpaned1 = gtk_vpaned_new();
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
1999 vpaned2 = gtk_vpaned_new();
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2000
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2001 gtk_paned_pack1(GTK_PANED(vpaned1), lw->split_images[0]->widget, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2002 gtk_paned_pack2(GTK_PANED(vpaned1), lw->split_images[2]->widget, TRUE, TRUE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2003
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2004 gtk_paned_pack1(GTK_PANED(vpaned2), lw->split_images[1]->widget, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2005 gtk_paned_pack2(GTK_PANED(vpaned2), lw->split_images[3]->widget, TRUE, TRUE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2006
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2007 gtk_paned_pack1(GTK_PANED(hpaned), vpaned1, TRUE, TRUE);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2008 gtk_paned_pack2(GTK_PANED(hpaned), vpaned2, TRUE, TRUE);
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2009
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
2010
520
b5e79bcb46df Add missing spaces around equal sign.
zas_
parents: 512
diff changeset
2011 for (i = 0; i < 4; i++)
512
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2012 gtk_widget_show(lw->split_images[i]->widget);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2013
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2014 gtk_widget_show(vpaned1);
f9bf33be53ff Remove whitespace between function name and first parenthesis for the sake of consistency.
zas_
parents: 507
diff changeset
2015 gtk_widget_show(vpaned2);
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
2016
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2017
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2018 lw->split_image_widget = hpaned;
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
2019
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2020 return lw->split_image_widget;
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2021
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2022 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2023
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2024 GtkWidget *layout_image_setup_split(LayoutWindow *lw, ImageSplitMode mode)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2025 {
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2026 switch (mode)
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2027 {
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 426
diff changeset
2028 case SPLIT_HOR:
127
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2029 return layout_image_setup_split_hv(lw, TRUE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2030 case SPLIT_VERT:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2031 return layout_image_setup_split_hv(lw, FALSE);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2032 case SPLIT_QUAD:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2033 return layout_image_setup_split_quad(lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2034 case SPLIT_NONE:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2035 default:
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2036 return layout_image_setup_split_none(lw);
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2037 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2038 }
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2039
271afad04d07 implemented split windows
nadvornik
parents: 122
diff changeset
2040
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2041 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2042 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2043 * maintenance (for rename, move, remove)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2044 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2045 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2046
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2047 void layout_image_maint_renamed(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2048 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2049 FileData *img_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2050
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2051 img_fd = layout_image_get_fd(lw);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2052 if (img_fd == fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2053 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2054 image_set_fd(lw->image, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2055 layout_bars_maint_renamed(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2056 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2057 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2058
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2059 void layout_image_maint_removed(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2060 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2061 FileData *img_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2062
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2063 img_fd = layout_image_get_fd(lw);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2064 if (img_fd == fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2065 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2066 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2067 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2068
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2069 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2070 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2071 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2072 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2073
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2074 new = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2075 if (!new) new = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2076
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2077 if (new)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2078 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2079 layout_image_set_collection(lw, cd, new);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2080 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2081 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2082 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2083
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2084 layout_image_set_fd(lw, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2085 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2086 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2087
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2088 void layout_image_maint_moved(LayoutWindow *lw, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2089 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 131
diff changeset
2090 layout_image_maint_renamed(lw, fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2091 }