annotate src/layout.c @ 21:56866f205a68

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Sat Mar 5 16:23:32 2005 John Ellis <johne@verizon.net> * README: Updates. * configure.in: Release 2.1.0 Sat Mar 5 16:02:52 2005 John Ellis <johne@verizon.net> * main.c: Enable the beta message at startup. * po/fr.po: Update French translation (from stable branch), submitted by Eric Lassauge.
author gqview
date Sat, 05 Mar 2005 21:40:12 +0000
parents d907d608745f
children 17acca639a86
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.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 "image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 #include "layout_config.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include "layout_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 #include "menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include "pixbuf_util.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include "view_dir_list.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "view_dir_tree.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 #include "view_file_list.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 #include "view_file_icon.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 #include "ui_bookmark.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #include "ui_fileops.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 #include "ui_menu.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #include "ui_misc.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 #include "ui_tabcomp.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 #include "icons/tools.xpm"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 #define MAINWINDOW_DEF_WIDTH 620
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 #define MAINWINDOW_DEF_HEIGHT 400
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 #define MAIN_WINDOW_DIV_HPOS -1
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 #define MAIN_WINDOW_DIV_VPOS 200
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 #define TOOLWINDOW_DEF_WIDTH 260
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 #define TOOLWINDOW_DEF_HEIGHT 450
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 #define PROGRESS_WIDTH 150
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42 #define ZOOM_LABEL_WIDTH 64
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 #define PANE_DIVIDER_SIZE 10
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 GList *layout_window_list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48
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 static void layout_list_scroll_to_subpart(LayoutWindow *lw, const gchar *needle);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 * misc
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 */
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 gint layout_valid(LayoutWindow **lw)
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 == NULL)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 if (layout_window_list) *lw = layout_window_list->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 return (*lw != NULL);
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 return (g_list_find(layout_window_list, *lw) != NULL);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 LayoutWindow *layout_find_by_image(ImageWindow *imd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 GList *work;
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 work = layout_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 while (work)
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 LayoutWindow *lw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 work = work->next;
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 if (lw->image == imd) return lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 return NULL;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 * menu, toolbar, and dir view
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 static void layout_path_entry_changed_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95 gchar *buf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) return;
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 buf = g_strdup(gtk_entry_get_text(GTK_ENTRY(lw->path_entry)));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100 if (!buf || (lw->path && strcmp(buf, lw->path) == 0))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
102 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106 layout_set_path(lw, buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
108 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
111 static void layout_path_entry_tab_cb(const gchar *path, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
113 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 gchar *buf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
115 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 buf = g_strdup(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 parse_out_relatives(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
119 base = remove_level_from_path(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121 if (isdir(buf))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
123 if ((!lw->path || strcmp(lw->path, buf) != 0) && layout_set_path(lw, buf))
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 gint pos = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
126 /* put the '/' back, if we are in tab completion for a dir and result was path change */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 gtk_editable_insert_text(GTK_EDITABLE(lw->path_entry), "/", -1, &pos);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128 gtk_editable_set_position(GTK_EDITABLE(lw->path_entry),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129 strlen(gtk_entry_get_text(GTK_ENTRY(lw->path_entry))));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
130 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132 else if (lw->path && strcmp(lw->path, base) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 layout_list_scroll_to_subpart(lw, filename_from_path(buf));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
136
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
138 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
139 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 static void layout_path_entry_cb(const gchar *path, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
143 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144 gchar *buf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
145
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 buf = g_strdup(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147 parse_out_relatives(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
148
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 layout_set_path(lw, buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
151 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
152 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
154 static void layout_vdlist_select_cb(ViewDirList *vdl, const gchar *path, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
155 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
157
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 layout_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
159 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 static void layout_vdtree_select_cb(ViewDirTree *vdt, const gchar *path, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
162 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
163 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
164
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
165 layout_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
166 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
167
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
168 static GtkWidget *layout_tool_setup(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
169 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170 GtkWidget *box;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
171 GtkWidget *menu_bar;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
172 GtkWidget *tabcomp;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
173 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
174 GtkWidget *popwin;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
175 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
177 box = gtk_vbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
179 menu_bar = layout_actions_menu_bar(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
180 gtk_box_pack_start(GTK_BOX(box), menu_bar, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
181 gtk_widget_show(menu_bar);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
182
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
183 lw->toolbar = layout_button_bar(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
184 gtk_box_pack_start(GTK_BOX(box), lw->toolbar, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
185 if (!lw->toolbar_hidden) gtk_widget_show(lw->toolbar);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
186
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
187 tabcomp = tab_completion_new_with_history(&lw->path_entry, NULL, "path_list", -1,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
188 layout_path_entry_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
189 tab_completion_add_tab_func(lw->path_entry, layout_path_entry_tab_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
190 gtk_box_pack_start(GTK_BOX(box), tabcomp, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191 gtk_widget_show(tabcomp);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
192
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
193 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
194 popwin = gtk_widget_get_toplevel(GTK_COMBO(tabcomp)->list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
195 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
196 g_signal_connect(G_OBJECT(lw->path_entry->parent), "changed",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
197 G_CALLBACK(layout_path_entry_changed_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
198
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
199 if (lw->tree_view)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
200 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
201 lw->vdt = vdtree_new(lw->path, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
202 vdtree_set_layout(lw->vdt, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
203 vdtree_set_select_func(lw->vdt, layout_vdtree_select_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
204
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
205 lw->dir_view = lw->vdt->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
206 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
207 else
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 lw->vdl = vdlist_new(lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
210 vdlist_set_layout(lw->vdl, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
211 vdlist_set_select_func(lw->vdl, layout_vdlist_select_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
212
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
213 lw->dir_view = lw->vdl->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
214 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
215
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
216 gtk_box_pack_start(GTK_BOX(box), lw->dir_view, TRUE, TRUE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
217 gtk_widget_show(lw->dir_view);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
218
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
219 gtk_widget_show(box);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
220
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
221 return box;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
222 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
223
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
224 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
225 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
226 * sort button (and menu)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
227 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
228 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
229
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
230 static void layout_sort_menu_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
231 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
232 LayoutWindow *lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
233 SortType type;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
234
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
235 lw = submenu_item_get_data(widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
236 if (!lw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
237
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
238 type = (SortType)GPOINTER_TO_INT(data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
239
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
240 layout_sort_set(lw, type, lw->sort_ascend);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
241 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
242
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
243 static void layout_sort_menu_ascend_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
244 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
245 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
246
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
247 layout_sort_set(lw, lw->sort_method, !lw->sort_ascend);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
248 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
249
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
250 static void layout_sort_menu_hide_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
251 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
252 /* destroy the menu */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
253 gtk_widget_unref(GTK_WIDGET(widget));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
254 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
255
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
256 static void layout_sort_button_press_cb(GtkWidget *widget, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
257 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
258 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
259 GtkWidget *menu;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
260 GdkEvent *event;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
261 guint32 etime;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
262
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
263 menu = submenu_add_sort(NULL, G_CALLBACK(layout_sort_menu_cb), lw, FALSE, FALSE, TRUE, lw->sort_method);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
264
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
265 /* apparently the menu is never sunk, even on a popup */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
266 g_object_ref(G_OBJECT(menu));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
267 gtk_object_sink(GTK_OBJECT(menu));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
268
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
269 /* ascending option */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
270 menu_item_add_divider(menu);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
271 menu_item_add_check(menu, _("Ascending"), lw->sort_ascend, G_CALLBACK(layout_sort_menu_ascend_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
272
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
273 g_signal_connect(G_OBJECT(menu), "selection_done",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
274 G_CALLBACK(layout_sort_menu_hide_cb), NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
275
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
276 event = gtk_get_current_event();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
277 if (event)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
278 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
279 etime = gdk_event_get_time(event);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
280 gdk_event_free(event);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
281 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
282 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
283 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
284 etime = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
285 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
286
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
287 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, etime);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
288 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
289
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
290 static GtkWidget *layout_sort_button(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
291 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
292 GtkWidget *button;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
293
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
294 button = gtk_button_new_with_label(sort_type_get_text(lw->sort_method));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
295 g_signal_connect(G_OBJECT(button), "clicked",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
296 G_CALLBACK(layout_sort_button_press_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
297 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
298
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
299 return button;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
300 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
301
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
302 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
303 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
304 * status bar
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
305 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
306 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
307
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
308 void layout_status_update_progress(LayoutWindow *lw, gdouble val, const gchar *text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
309 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
310 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
311 if (!lw->info_progress_bar) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
312
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
313 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(lw->info_progress_bar), val);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
314 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(lw->info_progress_bar), (text) ? text : " ");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
315 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
316
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
317 void layout_status_update_info(LayoutWindow *lw, const gchar *text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
318 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
319 gchar *buf = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
320
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
321 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
322
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
323 if (!text)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
325 gint n;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
326 gint64 n_bytes = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
327 gint s;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
328 gint64 s_bytes = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
329 const gchar *ss;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
330 gchar *b;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331 gchar *sb;
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 if (layout_image_slideshow_active(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
334 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
335 if (!layout_image_slideshow_paused(lw))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
336 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
337 ss = _(" Slideshow");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
338 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
339 else
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 ss = _(" Paused");
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 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
344 else
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 ss = "";
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
347 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
348
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
349 n = layout_list_count(lw, &n_bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
350 s = layout_selection_count(lw, &s_bytes);
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 layout_bars_new_selection(lw, s);
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 (s > 0)
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 b = text_from_size_abrev(n_bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
357 sb = text_from_size_abrev(s_bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358 buf = g_strdup_printf(_("%s, %d files (%s, %d)%s"), b, n, sb, s, ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359 g_free(b);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
360 g_free(sb);
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 else if (n > 0)
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 b = text_from_size_abrev(n_bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
365 buf = g_strdup_printf(_("%s, %d files%s"), b, n, ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
366 g_free(b);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
367 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
368 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
369 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
370 buf = g_strdup_printf(_("%d files%s"), n, ss);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
373 text = buf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
374
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
375 layout_image_overlay_update(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
378 gtk_label_set_text(GTK_LABEL(lw->info_status), text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
379 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
380 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382 void layout_status_update_image(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
384 gchar *text;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385 gchar *b;
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 (!layout_valid(&lw) || !lw->image) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
389 text = image_zoom_get_as_text(lw->image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 gtk_label_set_text(GTK_LABEL(lw->info_zoom), text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
391 g_free(text);
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 b = text_from_size(lw->image->size);
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 (lw->image->unknown)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
396 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
397 if (image_get_path(lw->image) && !access_file(image_get_path(lw->image), R_OK))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
398 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
399 text = g_strdup_printf(_("(no read permission) %s bytes"), b);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
400 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
401 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
402 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
403 text = g_strdup_printf(_("( ? x ? ) %s bytes"), b);
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 else
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 text = g_strdup_printf(_("( %d x %d ) %s bytes"),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
409 lw->image->image_width, lw->image->image_height, b);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
410 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
411
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
412 gtk_label_set_text(GTK_LABEL(lw->info_details), text);
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 g_free(b);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
415 g_free(text);
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 void layout_status_update_all(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
419 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
420 layout_status_update_progress(lw, 0.0, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
421 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
422 layout_status_update_image(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
423 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
424
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
425 static GtkWidget *layout_status_label(gchar *text, GtkWidget *box, gint start, gint size, gint expand)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
426 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
427 GtkWidget *label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
428 GtkWidget *frame;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
429
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
430 frame = gtk_frame_new(NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
431 if (size) gtk_widget_set_size_request(frame, size, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
432 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
433 if (start)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
434 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
435 gtk_box_pack_start(GTK_BOX(box), frame, expand, expand, 0);
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 else
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 gtk_box_pack_end(GTK_BOX(box), frame, expand, expand, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
440 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
441 gtk_widget_show(frame);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
442
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
443 label = gtk_label_new(text ? text : "");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
444 gtk_container_add(GTK_CONTAINER(frame), label);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
445 gtk_widget_show(label);
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 return label;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
450 static void layout_status_setup(LayoutWindow *lw, GtkWidget *box, gint small_format)
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 GtkWidget *hbox;
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 if (lw->info_box) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
455
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
456 if (small_format)
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 lw->info_box = gtk_vbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
459 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
460 else
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 lw->info_box = gtk_hbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
463 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
464 gtk_box_pack_end(GTK_BOX(box), lw->info_box, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
465 gtk_widget_show(lw->info_box);
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 (small_format)
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 hbox = gtk_hbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
470 gtk_box_pack_start(GTK_BOX(lw->info_box), hbox, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
471 gtk_widget_show(hbox);
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
474 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
475 hbox = lw->info_box;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
476 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
477 lw->info_progress_bar = gtk_progress_bar_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
478 gtk_widget_set_size_request(lw->info_progress_bar, PROGRESS_WIDTH, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
479 gtk_box_pack_start(GTK_BOX(hbox), lw->info_progress_bar, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
480 gtk_widget_show(lw->info_progress_bar);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
481
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
482 lw->info_sort = layout_sort_button(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
483 gtk_box_pack_start(GTK_BOX(hbox), lw->info_sort, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
484 gtk_widget_show(lw->info_sort);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
485
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
486 lw->info_status = layout_status_label(NULL, lw->info_box, TRUE, 0, (!small_format));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
487
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
488 if (small_format)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
489 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
490 hbox = gtk_hbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
491 gtk_box_pack_start(GTK_BOX(lw->info_box), hbox, FALSE, FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
492 gtk_widget_show(hbox);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
493 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
494 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
495 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
496 hbox = lw->info_box;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
497 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
498 lw->info_details = layout_status_label(NULL, hbox, TRUE, 0, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
499 lw->info_zoom = layout_status_label(NULL, hbox, FALSE, ZOOM_LABEL_WIDTH, FALSE);
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 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
504 * views
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
505 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
506 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
507
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
508 static GtkWidget *layout_tools_new(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
509 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
510 lw->dir_view = layout_tool_setup(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
511 return lw->dir_view;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
512 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
513
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
514 static void layout_list_status_cb(ViewFileList *vfl, gpointer data)
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 LayoutWindow *lw = data;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
521 static void layout_list_thumb_cb(ViewFileList *vfl, gdouble val, const gchar *text, gpointer data)
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 LayoutWindow *lw = data;
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 layout_status_update_progress(lw, val, text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
526 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
527
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
528 static void layout_icon_status_cb(ViewFileIcon *vfi, gpointer data)
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 LayoutWindow *lw = data;
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 layout_status_update_info(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
533 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
534
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
535 static void layout_icon_thumb_cb(ViewFileIcon *vfi, gdouble val, const gchar *text, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
536 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
537 LayoutWindow *lw = data;
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 layout_status_update_progress(lw, val, text);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
540 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
541
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
542 static GtkWidget *layout_list_new(LayoutWindow *lw)
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 if (lw->icon_view)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
545 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
546 lw->vfi = vficon_new(NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
547 vficon_set_layout(lw->vfi, lw);
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 vficon_set_status_func(lw->vfi, layout_icon_status_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
550 vficon_set_thumb_status_func(lw->vfi, layout_icon_thumb_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
551
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
552 return lw->vfi->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
553 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
554
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
555 lw->vfl = vflist_new(NULL, lw->thumbs_enabled);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
556 vflist_set_layout(lw->vfl, lw);
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 vflist_set_status_func(lw->vfl, layout_list_status_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
559 vflist_set_thumb_status_func(lw->vfl, layout_list_thumb_cb, lw);
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 return lw->vfl->widget;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
562 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
563
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
564 static void layout_list_sync_thumb(LayoutWindow *lw)
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 if (lw->vfl) vflist_thumb_set(lw->vfl, lw->thumbs_enabled);
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 layout_list_scroll_to_subpart(LayoutWindow *lw, const gchar *needle)
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 if (!lw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
572 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
573 if (lw->vfl) vflist_scroll_to_subpart(lw->vfl, needle);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
574 if (lw->vfi) vficon_scroll_to_subpart(lw->vfi, needle);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
575 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
576 }
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 GList *layout_list(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
579 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
580 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
581
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
582 if (lw->vfl) return vflist_get_list(lw->vfl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
583 if (lw->vfi) return vficon_get_list(lw->vfi);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
584
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
585 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
586 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
587
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
588 gint layout_list_count(LayoutWindow *lw, gint64 *bytes)
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 if (!layout_valid(&lw)) return 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
591
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
592 if (lw->vfl) return vflist_count(lw->vfl, bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
593 if (lw->vfi) return vficon_count(lw->vfi, bytes);
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 return 0;
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 const gchar *layout_list_get_path(LayoutWindow *lw, gint index)
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 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
601
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
602 if (lw->vfl) return vflist_index_get_path(lw->vfl, index);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
603 if (lw->vfi) return vficon_index_get_path(lw->vfi, index);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
604
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
605 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
606 }
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 gint layout_list_get_index(LayoutWindow *lw, const gchar *path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
609 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
610 if (!layout_valid(&lw)) return -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
611
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
612 if (lw->vfl) return vflist_index_by_path(lw->vfl, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
613 if (lw->vfi) return vficon_index_by_path(lw->vfi, path);
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 return -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
616 }
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 void layout_list_sync_path(LayoutWindow *lw, const gchar *path)
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 if (!layout_valid(&lw)) return;
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 if (lw->vfl) vflist_select_by_path(lw->vfl, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
623 if (lw->vfi) vficon_select_by_path(lw->vfi, path);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
626 static void layout_list_sync_sort(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
629
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
630 if (lw->vfl) vflist_sort_set(lw->vfl, lw->sort_method, lw->sort_ascend);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
631 if (lw->vfi) vficon_sort_set(lw->vfi, lw->sort_method, lw->sort_ascend);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
634 GList *layout_selection_list(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
635 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
636 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
637
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
638 if (layout_image_get_collection(lw, NULL))
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 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
641
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
642 path = layout_image_get_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
643 if (path) return g_list_append(NULL, g_strdup(path));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
644 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
645 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
646
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
647 if (lw->vfl) return vflist_selection_get_list(lw->vfl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
648 if (lw->vfi) return vficon_selection_get_list(lw->vfi);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
649
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
650 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
651 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
652
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
653 GList *layout_selection_list_by_index(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
654 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
655 if (!layout_valid(&lw)) return NULL;
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 if (lw->vfl) return vflist_selection_get_list_by_index(lw->vfl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
658 if (lw->vfi) return vficon_selection_get_list_by_index(lw->vfi);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
659
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
660 return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
661 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
662
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
663 gint layout_selection_count(LayoutWindow *lw, gint64 *bytes)
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 if (!layout_valid(&lw)) return 0;
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 if (lw->vfl) return vflist_selection_count(lw->vfl, bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
668 if (lw->vfi) return vficon_selection_count(lw->vfi, bytes);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
669
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
670 return 0;
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 void layout_select_all(LayoutWindow *lw)
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 if (!layout_valid(&lw)) return;
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 if (lw->vfl) vflist_select_all(lw->vfl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
678 if (lw->vfi) vficon_select_all(lw->vfi);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
681 void layout_select_none(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
682 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
683 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
684
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
685 if (lw->vfl) vflist_select_none(lw->vfl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
686 if (lw->vfi) vficon_select_none(lw->vfi);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
687 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
688
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
689 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
690 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
691 * access
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
695 const gchar *layout_get_path(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
696 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
697 if (!layout_valid(&lw)) return NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
698 return lw->path;
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 layout_sync_path(LayoutWindow *lw)
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 if (!lw->path) return;
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 lw->last_time = filetime(lw->path);
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 gtk_entry_set_text(GTK_ENTRY(lw->path_entry), lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
708 if (lw->vdl) vdlist_set_path(lw->vdl, lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
709 if (lw->vdt) vdtree_set_path(lw->vdt, lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
710
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
711 if (lw->vfl) vflist_set_path(lw->vfl, lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
712 if (lw->vfi) vficon_set_path(lw->vfi, lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
713 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
714
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
715 gint layout_set_path(LayoutWindow *lw, const gchar *path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
716 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
717 gint have_file = FALSE;
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 if (!layout_valid(&lw)) return FALSE;
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 if (!path || !isname(path)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
722 if (lw->path && path && strcmp(path, lw->path) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
723 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
724 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
725 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
726
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
727 if (isdir(path))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
728 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
729 g_free(lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
730 lw->path = g_strdup(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
731 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
732 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
733 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
734 gchar *base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
735
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
736 base = remove_level_from_path(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
737 if (lw->path && strcmp(lw->path, base) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
738 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
739 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
740 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
741 else if (isdir(base))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
742 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
743 g_free(lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
744 lw->path = base;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
745 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
746 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
747 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
748 g_free(base);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
749 return 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 if (isfile(path)) have_file = TRUE;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
754 if (lw->path_entry) tab_completion_append_to_history(lw->path_entry, lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
755 layout_sync_path(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
756
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
757 if (have_file)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
758 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
759 gint row;
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 row = layout_list_get_index(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
762 if (row >= 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
763 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
764 layout_image_set_index(lw, row);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
765 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
766 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
767 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
768 layout_image_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
769 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
770 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
771 else if (!lazy_image_sync)
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 layout_image_set_index(lw, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
774 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
775
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
776 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
777 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
778
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
779 static void layout_refresh_lists(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
780 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
781 if (lw->path) lw->last_time = filetime(lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
782
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
783 if (lw->vdl) vdlist_refresh(lw->vdl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
784 if (lw->vdt) vdtree_refresh(lw->vdt);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
785
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
786 if (lw->vfl) vflist_refresh(lw->vfl);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
787 if (lw->vfi) vficon_refresh(lw->vfi);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
790 static void layout_refresh_by_time(LayoutWindow *lw)
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 layout_refresh_lists(lw);
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 if (lw->image && filetime(layout_image_get_path(lw)) >= lw->last_time)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
795 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
796 layout_image_refresh(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
797 }
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_refresh(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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
803
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
804 if (debug) printf("layout refresh\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
805
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
806 layout_refresh_lists(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
807
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
808 if (lw->image) layout_image_refresh(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
811 static gint layout_check_for_update_cb(gpointer data)
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 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
814
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
815 if (!update_on_time_change) return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
816
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
817 if (lw->path)
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 time_t new_time;
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 new_time = filetime(lw->path);
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 if (new_time > 0 && new_time > lw->last_time)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
824 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
825 if (debug) printf("layout path time changed, refreshing...\n");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
826 layout_refresh_by_time(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
827 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
828 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
829
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
830 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
831 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
832
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
833 void layout_thumb_set(LayoutWindow *lw, gint enable)
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 if (!layout_valid(&lw)) return;
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 if (lw->thumbs_enabled == enable) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
838
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
839 lw->thumbs_enabled = enable;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
840
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
841 layout_util_sync_thumb(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
842 layout_list_sync_thumb(lw);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
845 gint layout_thumb_get(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
846 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
847 if (!layout_valid(&lw)) return FALSE;
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 return lw->thumbs_enabled;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
850 }
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 void layout_sort_set(LayoutWindow *lw, SortType type, gint ascend)
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 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
855 if (lw->sort_method == type && lw->sort_ascend == ascend) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
856
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
857 lw->sort_method = type;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
858 lw->sort_ascend = ascend;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
859
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
860 if (lw->info_sort) gtk_label_set_text(GTK_LABEL(GTK_BIN(lw->info_sort)->child),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
861 sort_type_get_text(type));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
862 layout_list_sync_sort(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
863 }
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 gint layout_sort_get(LayoutWindow *lw, SortType *type, gint *ascend)
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 if (!layout_valid(&lw)) return FALSE;
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 if (type) *type = lw->sort_method;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
870 if (ascend) *ascend = lw->sort_ascend;
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 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
873 }
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 gint layout_geometry_get(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h)
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 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
878
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
879 gdk_window_get_root_origin(lw->window->window, x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
880 gdk_drawable_get_size(lw->window->window, w, h);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
881
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
882 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
883 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
884
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
885 gint layout_geometry_get_dividers(LayoutWindow *lw, gint *h, gint *v)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
886 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
887 if (!layout_valid(&lw)) return FALSE;
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 if (lw->h_pane && GTK_PANED(lw->h_pane)->child1->allocation.x >= 0)
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 *h = GTK_PANED(lw->h_pane)->child1->allocation.width;
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 else if (h != &lw->div_h)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
894 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
895 *h = lw->div_h;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
896 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
897
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
898 if (lw->v_pane && GTK_PANED(lw->v_pane)->child1->allocation.x >= 0)
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 *v = GTK_PANED(lw->v_pane)->child1->allocation.height;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
901 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
902 else if (v != &lw->div_v)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
903 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
904 *v = lw->div_v;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
905 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
906
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
907 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
908 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
909
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
910 void layout_views_set(LayoutWindow *lw, gint tree, gint icons)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
911 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
912 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
913
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
914 if (lw->tree_view == tree && lw->icon_view == icons) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
915
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
916 lw->tree_view = tree;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
917 lw->icon_view = icons;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
918
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
919 layout_style_set(lw, -1, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
920 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
921
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
922 gint layout_views_get(LayoutWindow *lw, gint *tree, gint *icons)
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 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
925
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
926 *tree = lw->tree_view;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
927 *icons = lw->icon_view;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
928
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
929 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
930 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
931
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 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
934 * location utils
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
935 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
936 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
937
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
938 static gint layout_location_single(LayoutLocation l)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
939 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
940 return (l == LAYOUT_LEFT ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
941 l == LAYOUT_RIGHT ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
942 l == LAYOUT_TOP ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
943 l == LAYOUT_BOTTOM);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
944 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
945
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
946 static gint layout_location_vertical(LayoutLocation l)
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 return (l & LAYOUT_TOP ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
949 l & LAYOUT_BOTTOM);
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 gint layout_location_first(LayoutLocation l)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
953 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
954 return (l & LAYOUT_TOP ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
955 l & LAYOUT_LEFT);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
956 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
957
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
958 static LayoutLocation layout_grid_compass(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
959 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
960 if (layout_location_single(lw->dir_location)) return lw->dir_location;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
961 if (layout_location_single(lw->file_location)) return lw->file_location;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
962 return lw->image_location;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
963 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
964
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
965 static void layout_location_compute(LayoutLocation l1, LayoutLocation l2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
966 GtkWidget *s1, GtkWidget *s2,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
967 GtkWidget **d1, GtkWidget **d2)
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 LayoutLocation l;
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 l = l1 & l2; /* get common compass direction */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
972 l = l1 - l; /* remove it */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
973
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
974 if (layout_location_first(l))
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 *d1 = s1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
977 *d2 = s2;
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 else
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 *d1 = s2;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
982 *d2 = s1;
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 }
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 * tools window (for floating/hidden)
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 */
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 gint layout_geometry_get_tools(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h, gint *divider_pos)
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 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
995
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
996 if (!lw->tools || !GTK_WIDGET_VISIBLE(lw->tools))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
997 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
998 /* use the stored values (sort of breaks success return value) */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
999
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1000 *divider_pos = lw->div_float;
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 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1003 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1004
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1005 gdk_window_get_root_origin(lw->tools->window, x, y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1006 gdk_drawable_get_size(lw->tools->window, w, h);
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 if (GTK_IS_VPANED(lw->tools_pane))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1009 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1010 *divider_pos = GTK_PANED(lw->tools_pane)->child1->allocation.height;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1011 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1012 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1013 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1014 *divider_pos = GTK_PANED(lw->tools_pane)->child1->allocation.width;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1017 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1018 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1019
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1020 static void layout_tools_geometry_sync(LayoutWindow *lw)
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 layout_geometry_get_tools(lw, &float_window_x, &float_window_x,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1023 &float_window_w, &float_window_h, &lw->div_float);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1026 static void layout_tools_hide(LayoutWindow *lw, gint hide)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1027 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1028 if (!lw->tools) return;
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 if (hide)
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 (GTK_WIDGET_VISIBLE(lw->tools))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1033 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1034 layout_tools_geometry_sync(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1035 gtk_widget_hide(lw->tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1036 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1037 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1038 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1039 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1040 if (!GTK_WIDGET_VISIBLE(lw->tools))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1041 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1042 gtk_widget_show(lw->tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1043 if (lw->vfi) vficon_refresh(lw->vfi);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1044 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1045 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1046
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1047 lw->tools_hidden = hide;
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 static gint layout_tools_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1051 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1052 LayoutWindow *lw = data;
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 layout_tools_float_toggle(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1055
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1056 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1057 }
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 static void layout_tools_setup(LayoutWindow *lw, GtkWidget *tools, GtkWidget *files)
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 GtkWidget *vbox;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1062 GtkWidget *w1, *w2;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1063 gint vertical;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1064 gint new_window = FALSE;
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 vertical = (layout_location_single(lw->image_location) && !layout_location_vertical(lw->image_location)) ||
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1067 (!layout_location_single(lw->image_location) && layout_location_vertical(layout_grid_compass(lw)));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1068 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1069 layout_location_compute(lw->dir_location, lw->file_location,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1070 tools, files, &w1, &w2);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1071 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1072 /* for now, tools/dir are always first in order */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1073 w1 = tools;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1074 w2 = files;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1075
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1076 if (!lw->tools)
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 GdkGeometry geometry;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1079 GdkWindowHints hints;
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 lw->tools = gtk_window_new(GTK_WINDOW_TOPLEVEL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1082 g_signal_connect(G_OBJECT(lw->tools), "delete_event",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1083 G_CALLBACK(layout_tools_delete_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1084 layout_keyboard_init(lw, lw->tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1085
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1086 if (save_window_positions)
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 hints = GDK_HINT_USER_POS | GDK_HINT_USER_SIZE;
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1091 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1092 hints = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1093 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1094
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1095 geometry.min_width = 32;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1096 geometry.min_height = 32;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1097 geometry.base_width = TOOLWINDOW_DEF_WIDTH;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1098 geometry.base_height = TOOLWINDOW_DEF_HEIGHT;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1099 gtk_window_set_geometry_hints(GTK_WINDOW(lw->tools), NULL, &geometry,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1100 GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1102
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1103 gtk_window_set_resizable(GTK_WINDOW(lw->tools), TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1104 gtk_window_set_title(GTK_WINDOW(lw->tools), _("GQview Tools"));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1105 gtk_window_set_wmclass(GTK_WINDOW(lw->tools), "tools", "GQview");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1106 gtk_container_set_border_width(GTK_CONTAINER(lw->tools), 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1107
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1108 window_set_icon(lw->tools, (const gchar **)tools_xpm, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1109
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1110 new_window = TRUE;
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1113 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1114 layout_tools_geometry_sync(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1115 /* dump the contents */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1116 gtk_widget_destroy(GTK_BIN(lw->tools)->child);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1119 layout_actions_add_window(lw, lw->tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1120
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1121 vbox = gtk_vbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1122 gtk_container_add(GTK_CONTAINER(lw->tools), vbox);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1123 gtk_widget_show(vbox);
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 layout_status_setup(lw, vbox, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1126
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1127 if (vertical)
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 lw->tools_pane = gtk_vpaned_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1130 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1131 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1132 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1133 lw->tools_pane = gtk_hpaned_new();
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 gtk_box_pack_start(GTK_BOX(vbox), lw->tools_pane, TRUE, TRUE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1136 gtk_widget_show(lw->tools_pane);
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 gtk_paned_pack1(GTK_PANED(lw->tools_pane), w1, FALSE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1139 gtk_paned_pack2(GTK_PANED(lw->tools_pane), w2, TRUE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1140
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1141 gtk_widget_show(tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1142 gtk_widget_show(files);
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 if (new_window)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1145 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1146 if (save_window_positions)
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 gtk_window_set_default_size(GTK_WINDOW(lw->tools), float_window_w, float_window_h);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1149 gtk_window_move(GTK_WINDOW(lw->tools), float_window_x, float_window_y);
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1152 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1153 if (vertical)
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 gtk_window_set_default_size(GTK_WINDOW(lw->tools),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1156 TOOLWINDOW_DEF_WIDTH, TOOLWINDOW_DEF_HEIGHT);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1157 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1158 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1159 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1160 gtk_window_set_default_size(GTK_WINDOW(lw->tools),
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1161 TOOLWINDOW_DEF_HEIGHT, TOOLWINDOW_DEF_WIDTH);
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 }
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1166 if (!save_window_positions)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1167 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1168 if (vertical)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1169 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1170 lw->div_float = MAIN_WINDOW_DIV_VPOS;
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 else
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 lw->div_float = MAIN_WINDOW_DIV_HPOS;
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 }
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 gtk_paned_set_position(GTK_PANED(lw->tools_pane), lw->div_float);
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 /*
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 * glue (layout arrangement)
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 static void layout_grid_compute(LayoutWindow *lw,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1188 GtkWidget *image, GtkWidget *tools, GtkWidget *files,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1189 GtkWidget **w1, GtkWidget **w2, GtkWidget **w3)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1190 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1191 /* heh, this was fun */
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_location_single(lw->dir_location))
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_location_first(lw->dir_location))
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 *w1 = tools;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1198 layout_location_compute(lw->file_location, lw->image_location, files, image, w2, w3);
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1201 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1202 *w3 = tools;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1203 layout_location_compute(lw->file_location, lw->image_location, files, image, w1, w2);
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 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1206 else if (layout_location_single(lw->file_location))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1207 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1208 if (layout_location_first(lw->file_location))
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 *w1 = files;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1211 layout_location_compute(lw->dir_location, lw->image_location, tools, image, w2, w3);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1212 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1213 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1214 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1215 *w3 = files;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1216 layout_location_compute(lw->dir_location, lw->image_location, tools, image, w1, w2);
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 /* image */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1222 if (layout_location_first(lw->image_location))
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 *w1 = image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1225 layout_location_compute(lw->file_location, lw->dir_location, files, tools, w2, w3);
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1228 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1229 *w3 = image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1230 layout_location_compute(lw->file_location, lw->dir_location, files, tools, w1, w2);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1231 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1232 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1233 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1234
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1235 static void layout_grid_setup(LayoutWindow *lw)
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 gint priority_location;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1238 GtkWidget *h;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1239 GtkWidget *v;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1240 GtkWidget *w1, *w2, *w3;
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 GtkWidget *image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1243 GtkWidget *tools;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1244 GtkWidget *files;
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_actions_setup(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1247 layout_actions_add_window(lw, lw->window);
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 lw->group_box = gtk_vbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1250 gtk_box_pack_start(GTK_BOX(lw->main_box), lw->group_box, TRUE, TRUE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1251 gtk_widget_show(lw->group_box);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1252
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1253 priority_location = layout_grid_compass(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1254
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1255 image = layout_image_new(lw, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1256 tools = layout_tools_new(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1257 files = layout_list_new(lw);
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 image = layout_bars_prepare(lw, image);
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 (lw->tools_float || lw->tools_hidden)
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 gtk_box_pack_start(GTK_BOX(lw->group_box), image, TRUE, TRUE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1264 gtk_widget_show(image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1265
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1266 layout_tools_setup(lw, tools, files);
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 gtk_widget_grab_focus(lw->image->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1269
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1270 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1271 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1272 else if (lw->tools)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1273 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1274 layout_tools_geometry_sync(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1275 gtk_widget_destroy(lw->tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1276 lw->tools = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1277 lw->tools_pane = NULL;
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1280 layout_status_setup(lw, lw->group_box, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1281
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1282 layout_grid_compute(lw, image, tools, files, &w1, &w2, &w3);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1283
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1284 v = lw->v_pane = gtk_vpaned_new();
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 h = lw->h_pane = gtk_hpaned_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1287
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1288 if (!layout_location_vertical(priority_location))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1289 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1290 GtkWidget *tmp;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1291
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1292 tmp = v;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1293 v = h;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1294 h = tmp;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1295 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1296
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1297 gtk_box_pack_start(GTK_BOX(lw->group_box), v, TRUE, TRUE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1298
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1299 if (!layout_location_first(priority_location))
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 gtk_paned_pack1(GTK_PANED(v), h, FALSE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1302 gtk_paned_pack2(GTK_PANED(v), w3, TRUE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1303
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1304 gtk_paned_pack1(GTK_PANED(h), w1, FALSE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1305 gtk_paned_pack2(GTK_PANED(h), w2, TRUE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1306 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1307 else
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 gtk_paned_pack1(GTK_PANED(v), w1, FALSE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1310 gtk_paned_pack2(GTK_PANED(v), h, TRUE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1311
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1312 gtk_paned_pack1(GTK_PANED(h), w2, FALSE, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1313 gtk_paned_pack2(GTK_PANED(h), w3, TRUE, TRUE);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1316 gtk_widget_show(image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1317 gtk_widget_show(tools);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1318 gtk_widget_show(files);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1319
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1320 gtk_widget_show(v);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1321 gtk_widget_show(h);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1322
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1323 /* fix to have image pane visible when it is left and priority widget */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1324 if (lw->div_h == -1 &&
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1325 w1 == image &&
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1326 !layout_location_vertical(priority_location) &&
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1327 layout_location_first(priority_location))
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 gtk_widget_set_size_request(image, 200, -1);
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1332 gtk_paned_set_position(GTK_PANED(lw->h_pane), lw->div_h);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1333 gtk_paned_set_position(GTK_PANED(lw->v_pane), lw->div_v);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1334
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1335 gtk_widget_grab_focus(lw->image->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1336 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1337
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1338 void layout_style_set(LayoutWindow *lw, gint style, const gchar *order)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1339 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1340 gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1341 ImageWindow *old_image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1342
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1343 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1344
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1345 if (style != -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1346 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1347 LayoutLocation d, f, i;
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 layout_config_parse(style, order, &d, &f, &i);
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 if (lw->dir_location == d &&
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1352 lw->file_location == f &&
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1353 lw->image_location == i) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1354
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1355 lw->dir_location = d;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1356 lw->file_location = f;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1357 lw->image_location = i;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1358 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1359
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1360 /* remember state */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1361
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1362 layout_image_slideshow_stop(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1363 layout_image_full_screen_stop(lw);
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 path = lw->path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1366 lw->path = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1367 old_image = lw->image;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1368 lw->image = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1369 lw->utility_box = NULL;
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 layout_geometry_get_dividers(lw, &lw->div_h, &lw->div_v);
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 /* clear it all */
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 gtk_widget_hide(old_image->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1376 gtk_widget_ref(old_image->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1377 gtk_container_remove(GTK_CONTAINER(old_image->widget->parent), old_image->widget);
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 lw->h_pane = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1380 lw->v_pane = NULL;
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 lw->toolbar = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1383 lw->thumb_button = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1384 lw->path_entry = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1385 lw->dir_view = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1386 lw->vdl = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1387 lw->vdt = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1388
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1389 lw->file_view = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1390 lw->vfl = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1391 lw->vfi = NULL;
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 lw->info_box = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1394 lw->info_progress_bar = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1395 lw->info_sort = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1396 lw->info_status = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1397 lw->info_details = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1398 lw->info_zoom = NULL;
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 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1401 if (lw->menu_fact) g_object_unref(G_OBJECT(lw->menu_fact));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1402 lw->menu_fact = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1403 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1404 if (lw->ui_manager) g_object_unref(lw->ui_manager);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1405 lw->ui_manager = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1406 lw->action_group = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1407
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1408 gtk_container_remove(GTK_CONTAINER(lw->main_box), lw->group_box);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1409 lw->group_box = NULL;
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 /* re-fill */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1412
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1413 layout_grid_setup(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1414 layout_tools_hide(lw, lw->tools_hidden);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1415
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1416 layout_list_sync_sort(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1417 layout_util_sync(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1418 layout_status_update_all(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1419
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1420 /* sync */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1421
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1422 if (image_get_path(old_image))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1423 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1424 layout_set_path(lw, image_get_path(old_image));
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 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1427 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1428 layout_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1429 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1430 image_change_from_image(lw->image, old_image);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1431 image_top_window_set_sync(lw->image, (lw->tools_float || lw->tools_hidden));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1432
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1433 /* clean up */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1434
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1435 gtk_widget_unref(old_image->widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1436 g_free(path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1437 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1438
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1439 void layout_styles_update(void)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1440 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1441 GList *work;
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 work = layout_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1444 while (work)
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 LayoutWindow *lw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1447 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1448
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1449 layout_style_set(lw, layout_style, layout_order);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1450 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1451 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1452
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1453 void layout_colors_update(void)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1454 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1455 GList *work;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1456
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1457 work = layout_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1458 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1459 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1460 LayoutWindow *lw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1461 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1462
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1463 if (lw->image) image_background_set_black(lw->image, black_window_background);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1464 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1465 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1466
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1467 void layout_tools_float_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1468 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1469 gint popped;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1470
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1471 if (!lw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1472
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1473 if (!lw->tools_hidden)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1474 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1475 popped = !lw->tools_float;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1476 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1477 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1478 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1479 popped = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1480 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1481
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1482 if (lw->tools_float == popped)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1483 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1484 if (popped && lw->tools_hidden)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1485 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1486 layout_tools_float_set(lw, popped, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1487 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1488 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1489 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1490 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1491 if (lw->tools_float)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1492 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1493 layout_tools_float_set(lw, FALSE, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1494 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1495 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1496 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1497 layout_tools_float_set(lw, TRUE, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1498 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1499 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1500 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1501
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1502 void layout_tools_hide_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1503 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1504 if (!lw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1505
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1506 layout_tools_float_set(lw, lw->tools_float, !lw->tools_hidden);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1507 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1508
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1509 void layout_tools_float_set(LayoutWindow *lw, gint popped, gint hidden)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1510 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1511 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1512
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1513 if (lw->tools_float == popped && lw->tools_hidden == hidden) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1514
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1515 if (lw->tools_float == popped && lw->tools_float && lw->tools)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1516 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1517 layout_tools_hide(lw, hidden);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1518 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1519 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1520
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1521 lw->tools_float = popped;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1522 lw->tools_hidden = hidden;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1523
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1524 layout_style_set(lw, -1, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1525 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1526
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1527 gint layout_tools_float_get(LayoutWindow *lw, gint *popped, gint *hidden)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1528 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1529 if (!layout_valid(&lw)) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1530
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1531 *popped = lw->tools_float;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1532 *hidden = lw->tools_hidden;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1533
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1534 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1535 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1536
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1537 void layout_toolbar_toggle(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1538 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1539 if (!layout_valid(&lw)) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1540 if (!lw->toolbar) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1541
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1542 lw->toolbar_hidden = !lw->toolbar_hidden;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1543
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1544 if (lw->toolbar_hidden)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1545 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1546 if (GTK_WIDGET_VISIBLE(lw->toolbar)) gtk_widget_hide(lw->toolbar);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1547 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1548 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1549 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1550 if (!GTK_WIDGET_VISIBLE(lw->toolbar)) gtk_widget_show(lw->toolbar);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1551 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1552 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1553
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1554 gint layout_toolbar_hidden(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1555 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1556 if (!layout_valid(&lw)) return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1557
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1558 return lw->toolbar_hidden;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1559 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1560
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1561 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1562 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1563 * base
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1564 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1565 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1566
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1567 void layout_close(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1568 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1569 if (layout_window_list && layout_window_list->next)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1570 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1571 layout_free(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1572 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1573 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1574 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1575 exit_gqview();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1576 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1577 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1578
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1579 void layout_free(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1580 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1581 if (!lw) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1582
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1583 layout_window_list = g_list_remove(layout_window_list, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1584
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1585 if (lw->last_time_id != -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1586 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1587 g_source_remove(lw->last_time_id);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1588 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1589
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1590 layout_bars_close(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1591
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1592 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1593 if (lw->menu_fact) g_object_unref(G_OBJECT(lw->menu_fact));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1594 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1595 if (lw->tooltips) g_object_unref(G_OBJECT(lw->tooltips));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1596 gtk_widget_destroy(lw->window);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1597
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1598 g_free(lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1599
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1600 g_free(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1601 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1602
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1603 static gint layout_delete_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1604 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1605 LayoutWindow *lw = data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1606
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1607 layout_close(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1608 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1609 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1610
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1611 LayoutWindow *layout_new(const gchar *path, gint popped, gint hidden)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1612 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1613 LayoutWindow *lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1614 GdkGeometry geometry;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1615 GdkWindowHints hints;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1616
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1617 lw = g_new0(LayoutWindow, 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1618
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1619 lw->thumbs_enabled = thumbnails_enabled;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1620 lw->sort_method = SORT_NAME;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1621 lw->sort_ascend = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1622
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1623 lw->tools_float = popped;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1624 lw->tools_hidden = hidden;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1625
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1626 lw->toolbar_hidden = toolbar_hidden;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1627
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1628 lw->utility_box = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1629 lw->bar_sort = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1630 lw->bar_sort_enabled = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1631 lw->bar_exif = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1632 lw->bar_exif_enabled = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1633 lw->bar_exif_size = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1634 lw->bar_exif_advanced = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1635
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1636 lw->full_screen_overlay_id = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1637 lw->full_screen_overlay_on = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1638
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1639 /* default layout */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1640
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1641 layout_config_parse(layout_style, layout_order,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1642 &lw->dir_location, &lw->file_location, &lw->image_location);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1643 lw->tree_view = layout_view_tree;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1644 lw->icon_view = layout_view_icons;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1645
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1646 /* divider positions */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1647
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1648 if (save_window_positions)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1649 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1650 lw->div_h = window_hdivider_pos;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1651 lw->div_v = window_vdivider_pos;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1652 lw->div_float = float_window_divider;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1653 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1654 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1655 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1656 lw->div_h = MAIN_WINDOW_DIV_HPOS;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1657 lw->div_v = MAIN_WINDOW_DIV_VPOS;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1658 lw->div_float = MAIN_WINDOW_DIV_VPOS;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1659 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1660
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1661 /* window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1662
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1663 lw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1664 gtk_window_set_resizable(GTK_WINDOW(lw->window), TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1665
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1666 gtk_window_set_title(GTK_WINDOW(lw->window), "GQview");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1667 gtk_window_set_wmclass(GTK_WINDOW(lw->window), "gqview", "GQview");
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1668 gtk_container_set_border_width(GTK_CONTAINER(lw->window), 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1669
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1670 window_set_icon(lw->window, NULL, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1671
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1672 if (save_window_positions)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1673 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1674 hints = GDK_HINT_USER_POS | GDK_HINT_USER_SIZE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1675 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1676 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1677 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1678 hints = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1679 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1680
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1681 geometry.min_width = 32;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1682 geometry.min_height = 32;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1683 geometry.base_width = MAINWINDOW_DEF_WIDTH;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1684 geometry.base_height = MAINWINDOW_DEF_HEIGHT;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1685 gtk_window_set_geometry_hints(GTK_WINDOW(lw->window), NULL, &geometry,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1686 GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | hints);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1687
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1688 if (save_window_positions)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1689 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1690 gtk_window_set_default_size(GTK_WINDOW(lw->window), main_window_w, main_window_h);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1691 if (!layout_window_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1692 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1693 gtk_window_move(GTK_WINDOW(lw->window), main_window_x, main_window_y);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1694 if (main_window_maximized) gtk_window_maximize(GTK_WINDOW(lw->window));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1695 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1696 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1697 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1698 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1699 gtk_window_set_default_size(GTK_WINDOW(lw->window), MAINWINDOW_DEF_WIDTH, MAINWINDOW_DEF_HEIGHT);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1700 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1701
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1702 g_signal_connect(G_OBJECT(lw->window), "delete_event",
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1703 G_CALLBACK(layout_delete_cb), lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1704
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1705 layout_keyboard_init(lw, lw->window);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1706
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1707 #if 0
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1708 gtk_widget_realize(lw->window);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1709 #endif
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1710
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1711 lw->tooltips = gtk_tooltips_new();
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1712 g_object_ref(G_OBJECT(lw->tooltips));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1713 gtk_object_sink(GTK_OBJECT(lw->tooltips));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1714
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1715 lw->main_box = gtk_vbox_new(FALSE, 0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1716 gtk_container_add(GTK_CONTAINER(lw->window), lw->main_box);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1717 gtk_widget_show(lw->main_box);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1718
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1719 layout_grid_setup(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1720 image_top_window_set_sync(lw->image, (lw->tools_float || lw->tools_hidden));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1721
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1722 layout_util_sync(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1723 layout_status_update_all(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1724
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1725 if (path)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1726 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1727 layout_set_path(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1728 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1729 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1730 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1731 GdkPixbuf *pixbuf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1732
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1733 pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1734 image_change_pixbuf(lw->image, pixbuf, 1.0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1735 gdk_pixbuf_unref(pixbuf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1736 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1737
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1738 /* set up the time stat timeout */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1739 lw->last_time = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1740 lw->last_time_id = g_timeout_add(5000, layout_check_for_update_cb, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1741
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1742 gtk_widget_show(lw->window);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1743 layout_tools_hide(lw, lw->tools_hidden);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1744
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1745 layout_window_list = g_list_append(layout_window_list, lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1746
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1747 return lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1748 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1749
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1750 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1751 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1752 * maintenance (for rename, move, remove)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1753 *-----------------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1754 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1755
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1756 static void layout_real_time_update(LayoutWindow *lw)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1757 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1758 /* this resets the last time stamp of path so that a refresh does not occur
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1759 * from an internal file operation.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1760 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1761
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1762 if (lw->path) lw->last_time = filetime(lw->path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1763 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1764
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1765 static void layout_real_renamed(LayoutWindow *lw, const gchar *source, const gchar *dest)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1766 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1767 gint update = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1768
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1769 if (lw->image) layout_image_maint_renamed(lw, source, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1770
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1771 if (lw->vfl) update |= vflist_maint_renamed(lw->vfl, source, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1772 if (lw->vfi) update |= vficon_maint_renamed(lw->vfi, source, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1773
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1774 if (update) layout_real_time_update(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1775 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1776
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1777 static void layout_real_removed(LayoutWindow *lw, const gchar *path, GList *ignore_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1778 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1779 gint update = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1780
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1781 if (lw->image) layout_image_maint_removed(lw, path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1782
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1783 if (lw->vfl) update |= vflist_maint_removed(lw->vfl, path, ignore_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1784 if (lw->vfi) update |= vficon_maint_removed(lw->vfi, path, ignore_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1785
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1786 if (update) layout_real_time_update(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1787 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1788
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1789 static void layout_real_moved(LayoutWindow *lw, const gchar *source, const gchar *dest, GList *ignore_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1790 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1791 gint update = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1792
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1793 if (lw->image) layout_image_maint_moved(lw, source, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1794
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1795 if (lw->vfl) update |= vflist_maint_moved(lw->vfl, source, dest, ignore_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1796 if (lw->vfi) update |= vficon_maint_moved(lw->vfi, source, dest, ignore_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1797
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1798 if (update) layout_real_time_update(lw);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1799 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1800
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1801 void layout_maint_renamed(const gchar *source, const gchar *dest)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1802 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1803 GList *work = layout_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1804 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1805 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1806 LayoutWindow *lw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1807 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1808
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1809 layout_real_renamed(lw, source, dest);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1810 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1811 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1812
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1813 void layout_maint_removed(const gchar *path, GList *ignore_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1814 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1815 GList *work = layout_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1816 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1817 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1818 LayoutWindow *lw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1819 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1820
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1821 layout_real_removed(lw, path, ignore_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1822 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1823 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1824
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1825 void layout_maint_moved(const gchar *source, const gchar *dest, GList *ignore_list)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1826 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1827 GList *work = layout_window_list;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1828 while (work)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1829 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1830 LayoutWindow *lw = work->data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1831 work = work->next;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1832
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1833 layout_real_moved(lw, source, dest, ignore_list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1834 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1835 }