annotate src/layout_image.c @ 86:cade6a52a165

Mon Oct 23 05:34:29 2006 John Ellis <johne@verizon.net> * img-view.c, layout_image.c, layout_util.c, pan-view.c: Make F11 also toggle fullscreen.
author gqview
date Mon, 23 Oct 2006 09:40:37 +0000
parents ba3c39002a24
children 55166d93498d
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 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * GQview
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12 #include "gqview.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #include "collect.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "dnd.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "editors.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include "filelist.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 #include "fullscreen.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include "image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include "image-overlay.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "img-view.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #include "info.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #include "layout.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 #include "layout_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #include "menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #include "pixbuf_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #include "utilops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 #include "slideshow.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 #include "ui_bookmark.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 #include "ui_menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 #include <gdk/gdkkeysyms.h> /* for keyboard values */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 static void layout_image_set_buttons(LayoutWindow *lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 * full screen overlay
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 static void layout_image_overlay_set(LayoutWindow *lw, gint enable)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 lw->full_screen_overlay_on = enable;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 if (!lw->full_screen) return;
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 if (enable)
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 if (lw->full_screen_overlay_id == -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 lw->full_screen_overlay_id = image_overlay_info_enable(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 else
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 if (lw->full_screen_overlay_id != -1)
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 image_overlay_info_disable(lw->image, lw->full_screen_overlay_id);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 lw->full_screen_overlay_id = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 void layout_image_overlay_update(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 if (!lw || !lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 if (lw->full_screen_overlay_id != -1) image_overlay_update(lw->image, lw->full_screen_overlay_id);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74
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 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 * full screen
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 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
82 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 if (!lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
87 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
88 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 static void layout_image_full_screen_menu_popup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 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
97 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 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
100 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101 LayoutWindow *lw = data;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
102 gint stop_signal;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103 gint x = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 gint y = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
106 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109 case GDK_Left: case GDK_KP_Left:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110 x -= 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
111 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112 case GDK_Right: case GDK_KP_Right:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
113 x += 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
115 case GDK_Up: case GDK_KP_Up:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116 y -= 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 case GDK_Down: case GDK_KP_Down:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 y += 1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
120 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
121 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
122 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
124 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
125
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
126 if (x != 0 || y!= 0)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
128 if (event->state & GDK_SHIFT_MASK)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
129 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
130 x *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
131 y *= 3;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
132 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
133
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
134 keyboard_scroll_calc(&x, &y, event);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
135 layout_image_scroll(lw, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
138 if (stop_signal) return stop_signal;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
139
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 if (event->state & GDK_CONTROL_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142 gint n = -1;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
143
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
144 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 case '1':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148 n = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150 case '2':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
151 n = 1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
152 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153 case '3':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
154 n = 2;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156 case '4':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
157 n = 3;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
159 case '5':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160 n = 4;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
162 case '6':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 n = 5;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
165 case '7':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
166 n = 6;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
167 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
168 case '8':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 n = 7;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
171 case '9':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 n = 8;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
173 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
174 case '0':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
175 n = 9;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
177 case 'C': case 'c':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178 file_util_copy(layout_image_get_path(lw), NULL, NULL, widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
179 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
180 case 'M': case 'm':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 file_util_move(layout_image_get_path(lw), NULL, NULL, widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
182 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
183 case 'R': case 'r':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
184 file_util_rename(layout_image_get_path(lw), NULL, widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
185 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
186 case 'D': case 'd':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
187 file_util_delete(layout_image_get_path(lw), NULL, widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 case 'P': case 'p':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190 info_window_new(layout_image_get_path(lw), NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
192 case 'Q': case 'q':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
193 exit_gqview();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
194 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
195 break;
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
196 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
197 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
198 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
199 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
200 if (n != -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
201 {
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
202 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
203 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
204 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
205 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
206 start_editor_from_file(n, layout_image_get_path(lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
208 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
209 else if (event->state & GDK_SHIFT_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
210 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
211 stop_signal = TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
212 switch (event->keyval)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
213 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
214 case 'R': case 'r':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
215 layout_image_alter(lw, ALTER_ROTATE_180);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
216 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
217 case 'M': case 'm':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
218 layout_image_alter(lw, ALTER_MIRROR);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
219 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
220 case 'F': case 'f':
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
221 layout_image_alter(lw, ALTER_FLIP);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
222 break;
82
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
223 case 'G': case 'g':
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
224 layout_image_alter(lw, ALTER_DESATURATE);
a4c1b7014e6e Thu Oct 19 15:20:51 2006 John Ellis <johne@verizon.net>
gqview
parents: 64
diff changeset
225 break;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
226 default:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
227 stop_signal = FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
228 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
229 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
230 }
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
231 else
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
232 {
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
233 stop_signal = TRUE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
234 switch (event->keyval)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
235 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
236 case '+': case '=': case GDK_KP_Add:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
237 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
238 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
239 case '-': case GDK_KP_Subtract:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
240 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
241 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
242 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
243 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
244 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
245 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
246 case '1':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
247 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
248 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
249 case '2':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
250 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
251 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
252 case '3':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
253 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
254 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
255 case '4':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
256 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
257 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
258 case '7':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
259 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
260 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
261 case '8':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
262 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
263 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
264 case '9':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
265 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
266 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
267 case 'W': case 'w':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
268 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
269 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
270 case 'H': case 'h':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
271 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
272 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
273 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
274 case GDK_BackSpace:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
275 case 'B': case 'b':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
276 layout_image_prev(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
277 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
278 case GDK_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
279 case GDK_space:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
280 case 'N': case 'n':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
281 layout_image_next(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
282 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
283 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
284 layout_image_first(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
285 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
286 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
287 layout_image_last(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
288 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
289 case ']':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
290 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
291 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
292 case '[':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
293 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
294 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
295 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
296 if (enable_delete_key)
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
297 {
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
298 file_util_delete(layout_image_get_path(lw), NULL, widget);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
299 }
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
300 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
301 case GDK_Escape:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
302 layout_image_full_screen_stop(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
303 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
304 case 'R': case 'r':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
305 layout_refresh(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
306 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
307 case 'S': case 's':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
308 layout_image_slideshow_toggle(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
309 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
310 case 'P': case 'p':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
311 layout_image_slideshow_pause_toggle(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
312 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
313 case 'F': case 'f':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
314 case 'V': case 'v':
86
cade6a52a165 Mon Oct 23 05:34:29 2006 John Ellis <johne@verizon.net>
gqview
parents: 84
diff changeset
315 case GDK_F11:
84
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
316 layout_image_full_screen_stop(lw);
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
317 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
318 case GDK_Menu:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
319 case GDK_F10:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
320 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
321 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
322 case 'I': case 'i':
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
323 layout_image_overlay_set(lw, !(lw->full_screen_overlay_on));
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
324 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
325 default:
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
326 stop_signal = FALSE;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
327 break;
ba3c39002a24 Fri Oct 20 08:00:08 2006 John Ellis <johne@verizon.net>
gqview
parents: 82
diff changeset
328 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
329 }
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 return stop_signal;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
332 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334 static void layout_image_full_screen_stop_func(FullScreenData *fs, gpointer data)
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 LayoutWindow *lw = data;
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 /* restore image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
339 lw->image = fs->normal_imd;
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 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
342 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
343 lw->slideshow->imd = lw->image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
344 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
345
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
346 lw->full_screen = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
347 lw->full_screen_overlay_id = -1;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350 void layout_image_full_screen_start(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
351 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
352 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
353
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
354 if (lw->full_screen) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
355
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
356 lw->full_screen = fullscreen_start(lw->window, lw->image,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357 layout_image_full_screen_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359 /* set to new image window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
360 lw->image = lw->full_screen->imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
361
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
362 if (lw->slideshow)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
363 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
364 lw->slideshow->imd = lw->image;
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 layout_image_set_buttons(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 g_signal_connect(G_OBJECT(lw->full_screen->window), "key_press_event",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370 G_CALLBACK(layout_image_full_screen_key_press_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
371
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
372 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
373 gtk_widget_set_sensitive(lw->window, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
374 if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
375 #endif
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 layout_image_overlay_set(lw, lw->full_screen_overlay_on);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
378 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
379
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
380 void layout_image_full_screen_stop(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383 if (!lw->full_screen) return;
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 fullscreen_stop(lw->full_screen);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
386
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
387 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388 gtk_widget_set_sensitive(lw->window, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
389 if (lw->tools) gtk_widget_set_sensitive(lw->tools, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 #endif
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393 void layout_image_full_screen_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
394 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
395 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
396 if (lw->full_screen)
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 layout_image_full_screen_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
399 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
400 else
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 layout_image_full_screen_start(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
406 gint layout_image_full_screen_active(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
409
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
410 return (lw->full_screen != NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
411 }
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 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
415 * slideshow
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
416 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
417 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
418
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
419 static void layout_image_slideshow_next(LayoutWindow *lw)
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 if (lw->slideshow) slideshow_next(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
422 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
423
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
424 static void layout_image_slideshow_prev(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
425 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
426 if (lw->slideshow) slideshow_prev(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
427 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
428
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
429 static void layout_image_slideshow_stop_func(SlideShowData *ss, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
430 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
431 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
432
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
433 lw->slideshow = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
434 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
435 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
436
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
437 void layout_image_slideshow_start(LayoutWindow *lw)
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 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
440 CollectInfo *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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
443 if (lw->slideshow) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
444
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
445 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
446
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
447 if (cd && info)
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 lw->slideshow = slideshow_start_from_collection(lw->image, cd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
450 layout_image_slideshow_stop_func, lw, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
451 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
452 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
453 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
454 lw->slideshow = slideshow_start(lw->image, lw,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
455 layout_list_get_index(lw, layout_image_get_path(lw)),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
456 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
457 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
458
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
459 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
460 }
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 /* 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
463 void layout_image_slideshow_start_from_list(LayoutWindow *lw, GList *list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
464 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
465 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
466
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
467 if (lw->slideshow || !list)
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 path_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
470 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
471 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
472
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
473 lw->slideshow = slideshow_start_from_path_list(lw->image, list,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
474 layout_image_slideshow_stop_func, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
475
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
476 layout_status_update_info(lw, NULL);
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_stop(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) return;
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 slideshow_free(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
486 /* the stop_func sets lw->slideshow to NULL for us */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
487 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
488
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
489 void layout_image_slideshow_toggle(LayoutWindow *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 if (!layout_valid(&lw)) return;
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 if (lw->slideshow)
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 layout_image_slideshow_stop(lw);
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 else
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 layout_image_slideshow_start(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
500 }
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
503 gint layout_image_slideshow_active(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
504 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
505 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
506
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
507 return (lw->slideshow != NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
508 }
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 gint layout_image_slideshow_pause_toggle(LayoutWindow *lw)
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 gint ret;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
513
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
514 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
515
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
516 ret = slideshow_pause_toggle(lw->slideshow);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
517
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
518 layout_status_update_info(lw, NULL);
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 return ret;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
523 gint layout_image_slideshow_paused(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
524 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
525 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
526
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
527 return (slideshow_paused(lw->slideshow));
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 static gint layout_image_slideshow_continue_check(LayoutWindow *lw)
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 if (!lw->slideshow) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
533
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
534 if (!slideshow_should_continue(lw->slideshow))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
535 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
536 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
537 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
538 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
539
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
540 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
541 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
542
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
543 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
544 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
545 * pop-up menus
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
546 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
547 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
548
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
549 static void li_pop_menu_zoom_in_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
552
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
553 image_zoom_adjust(lw->image, get_zoom_increment());
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
554 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
555
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
556 static void li_pop_menu_zoom_out_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
559 image_zoom_adjust(lw->image, -get_zoom_increment());
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
562 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
563 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
564 LayoutWindow *lw = data;
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 image_zoom_set(lw->image, 1.0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
567 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
568
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
569 static void li_pop_menu_zoom_fit_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
572
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
573 image_zoom_set(lw->image, 0.0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
574 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
575
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
576 static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
577 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
578 LayoutWindow *lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
579 gint n;
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 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
582 n = GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
583
60
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
584 if (!editor_window_flag_set(n))
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
585 {
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
586 layout_image_full_screen_stop(lw);
9c0c402b0ef3 Mon Jun 13 17:31:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
587 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
588 start_editor_from_file(n, layout_image_get_path(lw));
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
591 static void li_pop_menu_wallpaper_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
594
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
595 layout_image_to_root(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
596 }
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 static void li_pop_menu_alter_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
599 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
600 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
601 AlterType type;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
602
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
603 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
604 type = (AlterType)GPOINTER_TO_INT(data);
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 image_alter(lw->image, type);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
607 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
608
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
609 static void li_pop_menu_info_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
610 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
611 LayoutWindow *lw = data;
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 info_window_new(layout_image_get_path(lw), NULL);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
616 static void li_pop_menu_new_cb(GtkWidget *widget, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
619
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
620 view_window_new(layout_image_get_path(lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
621 }
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 static GtkWidget *li_pop_menu_click_parent(GtkWidget *widget, LayoutWindow *lw)
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 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
626 GtkWidget *parent;
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 menu = gtk_widget_get_toplevel(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
629 if (!menu) return NULL;
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 parent = g_object_get_data(G_OBJECT(menu), "click_parent");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
632
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
633 if (!parent && lw->full_screen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
634 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
635 parent = lw->full_screen->imd->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
636 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
637
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
638 return parent;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
639 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
640
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
641 static void li_pop_menu_copy_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
642 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
643 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
644
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
645 file_util_copy(layout_image_get_path(lw), NULL, NULL,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
646 li_pop_menu_click_parent(widget, lw));
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
649 static void li_pop_menu_move_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
650 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
651 LayoutWindow *lw = data;
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 file_util_move(layout_image_get_path(lw), NULL, NULL,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
654 li_pop_menu_click_parent(widget, lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
655 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
656
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
657 static void li_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
658 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
659 LayoutWindow *lw = data;
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 file_util_rename(layout_image_get_path(lw), NULL,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
662 li_pop_menu_click_parent(widget, lw));
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
665 static void li_pop_menu_delete_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
666 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
667 LayoutWindow *lw = data;
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 file_util_delete(layout_image_get_path(lw), NULL,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
670 li_pop_menu_click_parent(widget, lw));
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
673 static void li_pop_menu_slide_start_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
674 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
675 LayoutWindow *lw = data;
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 layout_image_slideshow_start(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
680 static void li_pop_menu_slide_stop_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
681 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
682 LayoutWindow *lw = data;
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 layout_image_slideshow_stop(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
687 static void li_pop_menu_slide_pause_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
688 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
689 LayoutWindow *lw = data;
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 layout_image_slideshow_pause_toggle(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
694 static void li_pop_menu_full_screen_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
695 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
696 LayoutWindow *lw = data;
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 layout_image_full_screen_toggle(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
701 static void li_pop_menu_hide_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
702 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
703 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
704
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
705 layout_tools_hide_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
706 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
707
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
708 static GtkWidget *layout_image_pop_menu(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
709 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
710 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
711 GtkWidget *item;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
712 GtkWidget *submenu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
713 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
714 gint fullscreen;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
715
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
716 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
717 fullscreen = layout_image_full_screen_active(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
718
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
719 menu = popup_menu_short_lived();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
720
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
721 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
722 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
723 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
724 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
725 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
726
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
727 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
728 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
729 menu_item_add_divider(submenu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
730 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
731
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
732 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
733
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
734 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
735 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
736
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
737 item = 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
738 if (!path || fullscreen) gtk_widget_set_sensitive(item, FALSE);
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_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
741
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
742 item = menu_item_add_stock(menu, _("_Copy..."), GTK_STOCK_COPY, G_CALLBACK(li_pop_menu_copy_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
743 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
744 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
745 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
746 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
747 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
748 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
749 if (!path) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
750
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
751 menu_item_add_divider(menu);
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 if (layout_image_slideshow_active(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 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
756 if (layout_image_slideshow_paused(lw))
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(menu, _("Continue slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
759 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
760 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
761 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
762 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
763 item = menu_item_add(menu, _("Pause slides_how"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
764 G_CALLBACK(li_pop_menu_slide_pause_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
765 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
766 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
767 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
768 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
769 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
770 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
771 gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
772 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
773
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
774 if (!fullscreen)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
775 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
776 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
777 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
778 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
779 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
780 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
781 }
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 menu_item_add_divider(menu);
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 item = menu_item_add_check(menu, _("Hide file _list"), lw->tools_hidden,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
786 G_CALLBACK(li_pop_menu_hide_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
787 if (fullscreen) gtk_widget_set_sensitive(item, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
788
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
789 return menu;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
792 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
793 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
794 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
795
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
796 gdk_window_get_origin(lw->image->pr->window, x, y);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
797 popup_menu_position_clamp(menu, x, y, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
798 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
799
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
800 void layout_image_menu_popup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
801 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
802 GtkWidget *menu;
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 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
805 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
806 }
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 /*
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 * dnd
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
811 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
812 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
813
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
814 static void layout_image_dnd_receive(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
815 gint x, gint y,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
816 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
817 guint time, gpointer data)
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 LayoutWindow *lw = data;
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 if (info == TARGET_URI_LIST || info == TARGET_APP_COLLECTION_MEMBER)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
822 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
823 CollectionData *source;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
824 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
825 GList *info_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
826
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
827 if (info == TARGET_URI_LIST)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
828 {
64
04ff0df3ad2f Mon Aug 15 17:13:57 2005 John Ellis <johne@verizon.net>
gqview
parents: 60
diff changeset
829 list = uri_list_from_text((gchar *)selection_data->data, TRUE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
830 source = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
831 info_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
832 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
833 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
834 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
835 source = collection_from_dnd_data((gchar *)selection_data->data, &list, &info_list);
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 if (list)
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 gchar *path;
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 path = list->data;
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 if (isfile(path))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
845 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
846 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
847 gint row;
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 base = remove_level_from_path(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
850 if (strcmp(base, layout_get_path(lw)) != 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
851 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
852 layout_set_path(lw, base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
853 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
854 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
855
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
856 row = layout_list_get_index(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
857 if (source && info_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
858 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
859 layout_image_set_collection(lw, source, info_list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
860 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
861 else if (row == -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
862 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
863 layout_image_set_path(lw, path);
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 else
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 layout_image_set_index(lw, row);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
868 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
869 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
870 else if (isdir(path))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
871 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
872 layout_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
873 layout_image_set_path(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
874 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
875 }
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 path_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
878 g_list_free(info_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
879 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
880 }
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 static void layout_image_dnd_get(GtkWidget *widget, GdkDragContext *context,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
883 GtkSelectionData *selection_data, guint info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
884 guint time, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
885 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
886 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
887 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
888
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
889 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
890
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
891 if (path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
892 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
893 gchar *text = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
894 gint len;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
895 gint plain_text;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
896 GList *list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
897
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
898 switch (info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
899 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
900 case TARGET_URI_LIST:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
901 plain_text = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
902 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
903 case TARGET_TEXT_PLAIN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
904 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
905 plain_text = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
906 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
907 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
908 list = g_list_append(NULL, (gchar *)path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
909 text = uri_text_from_list(list, &len, plain_text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
910 g_list_free(list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
911 if (text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
912 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
913 gtk_selection_data_set (selection_data, selection_data->target,
64
04ff0df3ad2f Mon Aug 15 17:13:57 2005 John Ellis <johne@verizon.net>
gqview
parents: 60
diff changeset
914 8, (guchar *)text, len);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
915 g_free(text);
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
919 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
920 gtk_selection_data_set (selection_data, selection_data->target,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
921 8, NULL, 0);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
925 static void layout_image_dnd_end(GtkWidget *widget, GdkDragContext *context, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
926 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
927 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
928 if (context->action == GDK_ACTION_MOVE)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
929 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
930 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
931 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
932
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
933 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
934 row = layout_list_get_index(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
935 if (row < 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
936
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
937 if (!isfile(path))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
938 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
939 if (row < layout_list_count(lw, NULL) - 1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
940 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
941 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
942 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
943 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
944 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
945 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
946 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
947 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
948 layout_refresh(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
949 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
950 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
951
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
952 static void layout_image_dnd_init(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
953 {
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
954 gtk_drag_source_set(lw->image->pr, GDK_BUTTON2_MASK,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
955 dnd_file_drag_types, dnd_file_drag_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
956 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
957 g_signal_connect(G_OBJECT(lw->image->pr), "drag_data_get",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
958 G_CALLBACK(layout_image_dnd_get), lw);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
959 g_signal_connect(G_OBJECT(lw->image->pr), "drag_end",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
960 G_CALLBACK(layout_image_dnd_end), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
961
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
962 gtk_drag_dest_set(lw->image->pr,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
963 GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
964 dnd_file_drop_types, dnd_file_drop_types_count,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
965 GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents: 9
diff changeset
966 g_signal_connect(G_OBJECT(lw->image->pr), "drag_data_received",
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
967 G_CALLBACK(layout_image_dnd_receive), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
968 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
969
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
970
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
971 /*
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 * misc
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
974 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
975 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
976
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
977 void layout_image_to_root(LayoutWindow *lw)
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 image_to_root_window(lw->image, (image_zoom_get(lw->image) == 0));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
980 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
981
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
982 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
983 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
984 * manipulation + accessors
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
985 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
986 */
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 void layout_image_scroll(LayoutWindow *lw, gint x, gint y)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
989 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
990 if (!layout_valid(&lw)) 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 image_scroll(lw->image, x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
993 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
994
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
995 void layout_image_zoom_adjust(LayoutWindow *lw, gdouble increment)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
996 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
997 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
998
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
999 image_zoom_adjust(lw->image, increment);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1000 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1001
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1002 void layout_image_zoom_set(LayoutWindow *lw, gdouble zoom)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1003 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1004 if (!layout_valid(&lw)) return;
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 image_zoom_set(lw->image, zoom);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1007 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1008
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1009 void layout_image_zoom_set_fill_geometry(LayoutWindow *lw, gint vertical)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1010 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1011 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1012
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1013 image_zoom_set_fill_geometry(lw->image, vertical);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1014 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1015
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1016 void layout_image_alter(LayoutWindow *lw, AlterType type)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1017 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1018 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1019
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1020 image_alter(lw->image, type);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1021 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1022
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1023 const gchar *layout_image_get_path(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1024 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1025 if (!layout_valid(&lw)) return NULL;
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 return image_get_path(lw->image);
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 const gchar *layout_image_get_name(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return NULL;
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 return image_get_name(lw->image);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1037 CollectionData *layout_image_get_collection(LayoutWindow *lw, CollectInfo **info)
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 if (!layout_valid(&lw)) return NULL;
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 return image_get_collection(lw->image, info);
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 gint layout_image_get_index(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1045 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1046 return layout_list_get_index(lw, image_get_path(lw->image));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1047 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1048
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1049 /*
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 changers
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1052 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1053 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1054
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1055 void layout_image_set_path(LayoutWindow *lw, const gchar *path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1056 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1057 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1058
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1059 image_change_path(lw->image, path, image_zoom_get_default(lw->image, zoom_mode));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1060
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1061 layout_list_sync_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1062 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1063 layout_bars_new_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1064 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1065
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1066 void layout_image_set_with_ahead(LayoutWindow *lw, const gchar *path, const gchar *read_ahead_path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1067 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1068 if (!layout_valid(&lw)) return;
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 if (path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1071 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1072 const gchar *old_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1073
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1074 old_path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1075 if (old_path && strcmp(path, old_path) == 0) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1076 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1077
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1078 layout_image_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1079 if (enable_read_ahead) image_prebuffer_set(lw->image, read_ahead_path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1080 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1081
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1082 void layout_image_set_index(LayoutWindow *lw, gint index)
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 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1085 const gchar *read_ahead_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1086 gint old;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1087
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1088 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1089
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1090 old = layout_list_get_index(lw, layout_image_get_path(lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1091 path = layout_list_get_path(lw, index);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1092
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1093 if (old > index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1094 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1095 read_ahead_path = layout_list_get_path(lw, index - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1096 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1097 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1098 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1099 read_ahead_path = layout_list_get_path(lw, index + 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1100 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1102 layout_image_set_with_ahead(lw, path, read_ahead_path);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1105 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
1106 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1107 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1108
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1109 image_change_from_collection(lw->image, cd, info, image_zoom_get_default(lw->image, zoom_mode));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1110 if (enable_read_ahead)
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 CollectInfo *r_info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1113 if (forward)
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 r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1116 if (!r_info) r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1117 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1118 else
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 r_info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1121 if (!r_info) r_info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1122 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1123 if (r_info) image_prebuffer_set(lw->image, r_info->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1124 }
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 layout_image_slideshow_continue_check(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1127 layout_bars_new_image(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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1130 void layout_image_set_collection(LayoutWindow *lw, CollectionData *cd, CollectInfo *info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1131 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1132 layout_image_set_collection_real(lw, cd, info, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1133 layout_list_sync_path(lw, layout_image_get_path(lw));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1134 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1135
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1136 void layout_image_refresh(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return;
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 image_reload(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1141 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1142
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1143 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1144 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1145 * list walkers
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1146 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1147 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1148
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1149 void layout_image_next(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1150 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1151 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1152 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1153 CollectInfo *info;
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 if (!layout_valid(&lw)) return;
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 if (layout_image_slideshow_active(lw))
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 layout_image_slideshow_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1160 return;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1163 cd = image_get_collection(lw->image, &info);
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 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1166 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1167 info = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1168 if (info) layout_image_set_collection_real(lw, cd, info, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1169 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1170 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1171
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1172 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1173
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1174 if (current >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1175 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1176 if (current < layout_list_count(lw, NULL) - 1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1177 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1178 layout_image_set_index(lw, current + 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1179 }
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1182 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1183 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1184 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1185 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1186
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1187 void layout_image_prev(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1188 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1189 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1190 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1191 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1192
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1193 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1194
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1195 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1196 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1197 layout_image_slideshow_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1198 return;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1201 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1202
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1203 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1204 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1205 info = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1206 if (info) layout_image_set_collection_real(lw, cd, info, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1207 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1208 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1209
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1210 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1211
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1212 if (current >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1213 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1214 if (current > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1215 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1216 layout_image_set_index(lw, current - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1217 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1218 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1219 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1220 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1221 layout_image_set_index(lw, layout_list_count(lw, NULL) - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1222 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1223 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1224
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1225 void layout_image_first(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1226 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1227 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1228 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1229 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1230
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1231 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1232
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1233 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1234
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1235 if (cd && info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1236 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1237 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1238 new = collection_get_first(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1239 if (new != info) layout_image_set_collection_real(lw, cd, new, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1240 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1241 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1242
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1243 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1244 if (current != 0 && layout_list_count(lw, NULL) > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1245 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1246 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1247 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1248 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1249
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1250 void layout_image_last(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1251 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1252 gint current;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1253 gint count;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1254 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1255 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1256
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1257 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1258
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1259 cd = image_get_collection(lw->image, &info);
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 if (cd && info)
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 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1264 new = collection_get_last(cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1265 if (new != info) layout_image_set_collection_real(lw, cd, new, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1266 return;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1269 current = layout_image_get_index(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1270 count = layout_list_count(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1271 if (current != count - 1 && count > 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1272 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1273 layout_image_set_index(lw, count - 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1274 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1275 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1276
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1277 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1278 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1279 * mouse callbacks
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1283 static void layout_image_button_cb(ImageWindow *imd, gint button, guint32 time,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1284 gdouble x, gdouble y, guint state, gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1287 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1288
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1289 switch (button)
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 case 1:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1292 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1293 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1294 case 2:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1295 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1296 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1297 case 3:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1298 menu = layout_image_pop_menu(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1299 if (imd == lw->image)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1300 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1301 g_object_set_data(G_OBJECT(menu), "click_parent", imd->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1302 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1303 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, time);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1304 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1305 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1306 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1307 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1308 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1309
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1310 static void layout_image_scroll_cb(ImageWindow *imd, GdkScrollDirection direction, guint32 time,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1311 gdouble x, gdouble y, guint state, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1312 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1313 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1314
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1315 if (state & GDK_CONTROL_MASK)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1316 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1317 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1318 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1319 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1320 image_zoom_adjust_at_point(imd, get_zoom_increment(), x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1321 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1322 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1323 image_zoom_adjust_at_point(imd, -get_zoom_increment(), x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1324 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1325 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1326 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1327 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1328 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1329 else if ( (state & GDK_SHIFT_MASK) != (mousewheel_scrolls))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1330 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1331 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1332 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1333 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1334 image_scroll(imd, 0, -MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1335 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1336 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1337 image_scroll(imd, 0, MOUSEWHEEL_SCROLL_SIZE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1338 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1339 case GDK_SCROLL_LEFT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1340 image_scroll(imd, -MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1341 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1342 case GDK_SCROLL_RIGHT:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1343 image_scroll(imd, MOUSEWHEEL_SCROLL_SIZE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1344 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1345 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1346 break;
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 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1349 else
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 switch (direction)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1352 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1353 case GDK_SCROLL_UP:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1354 layout_image_prev(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1355 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1356 case GDK_SCROLL_DOWN:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1357 layout_image_next(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1358 break;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1359 default:
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1360 break;
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 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1363 }
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 static void layout_image_set_buttons(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1366 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1367 image_set_button_func(lw->image, layout_image_button_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1368 image_set_scroll_func(lw->image, layout_image_scroll_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1369 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1370
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1371 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1372 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1373 * setup
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1374 *----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1375 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1376
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1377 static void layout_image_update_cb(ImageWindow *imd, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1378 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1379 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1380 layout_status_update_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1381 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1382
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1383 GtkWidget *layout_image_new(LayoutWindow *lw, const gchar *path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1384 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1385 if (!lw->image)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1386 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1387 lw->image = image_new( (!lw->tools_float && !lw->tools_hidden) );
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1388 if (black_window_background) image_background_set_black(lw->image, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1389 image_set_update_func(lw->image, layout_image_update_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1390 layout_image_set_buttons(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1391 layout_image_dnd_init(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1392
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1393 image_attach_window(lw->image, lw->window, NULL, "GQview", FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1394
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1395 image_auto_refresh(lw->image, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1396 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1397
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1398 return lw->image->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1399 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1400
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 * maintenance (for rename, move, remove)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1404 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1405 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1406
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1407 void layout_image_maint_renamed(LayoutWindow *lw, const gchar *source, const gchar *dest)
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 const gchar *img_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1410
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1411 img_path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1412 if (img_path && strcmp(img_path, source) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1413 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1414 image_set_path(lw->image, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1415 layout_bars_maint_renamed(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1416 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1417 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1418
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1419 void layout_image_maint_removed(LayoutWindow *lw, const gchar *path)
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 const gchar *img_path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1422
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1423 img_path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1424 if (img_path && strcmp(img_path, path) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1425 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1426 CollectionData *cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1427 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1428
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1429 cd = image_get_collection(lw->image, &info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1430 if (cd && info)
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 CollectInfo *new;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1433
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1434 new = collection_next_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1435 if (!new) new = collection_prev_by_info(cd, info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1436
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1437 if (new)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1438 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1439 layout_image_set_collection(lw, cd, new);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1440 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1441 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1442 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1443
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1444 layout_image_set_path(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1445 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1446 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1447
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1448 void layout_image_maint_moved(LayoutWindow *lw, const gchar *source, const gchar *dest)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1449 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1450 layout_image_maint_renamed(lw, source, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1451 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1452