annotate src/slideshow.c @ 327:049d6b00cc14

Rename color profile options.
author zas_
date Sat, 12 Apr 2008 08:05:44 +0000
parents 509b84801d66
children df868b947aa0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 138
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
3 * (C) 2004 John Ellis
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
4 *
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
5 * Author: John Ellis
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
6 *
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
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: 3
diff changeset
8 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
9 * This software comes with no warranty of any kind, use at your own risk!
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
10 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
11
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
12
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 196
diff changeset
13 #include "main.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
14 #include "collect.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
15 #include "image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
16 #include "slideshow.h"
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
17 #include "filelist.h"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
18
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
19 #include "layout.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
20 #include "layout_image.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
21 #include "ui_fileops.h"
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
22
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
23
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
24 static void slideshow_timer_reset(SlideShowData *ss, gint reset);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
25
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
26
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
27 void slideshow_free(SlideShowData *ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
28 {
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
29 if (!ss) return;
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
30
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
31 slideshow_timer_reset(ss, FALSE);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
32
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
33 if (ss->stop_func) ss->stop_func(ss, ss->stop_data);
3
gqview
parents: 1
diff changeset
34
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
35 if (ss->filelist) filelist_free(ss->filelist);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
36 if (ss->cd) collection_unref(ss->cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
37 g_free(ss->layout_path);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
38
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
39 g_list_free(ss->list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
40 g_list_free(ss->list_done);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
41
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
42 file_data_unref(ss->slide_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
43
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
44 g_free(ss);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
45 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
46
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
47 static GList *generate_list(SlideShowData *ss)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
48 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
49 GList *list = NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
50
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
51 if (ss->from_selection)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
52 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
53 list = layout_selection_list_by_index(ss->layout);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
54 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
55 else
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
56 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
57 gint i;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
58 for(i = 0; i < ss->slide_count; i++)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
59 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
60 list = g_list_prepend(list, GINT_TO_POINTER(i));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
61 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
62 list = g_list_reverse(list);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
63 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
64
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
65 return list;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
66 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
67
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
68 static GList *generate_random_list(SlideShowData *ss)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
69 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
70 GList *src_list = NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
71 GList *list = NULL;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
72 GList *work;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
73
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
74 src_list = generate_list(ss);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
75
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
76 while(src_list)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
77 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
78 gint p = (double)rand() / ((double)RAND_MAX + 1.0) * g_list_length(src_list);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
79 work = g_list_nth(src_list, p);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
80 list = g_list_prepend(list, work->data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
81 src_list = g_list_remove(src_list, work->data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
82 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
83
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
84 return list;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
85 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
86
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
87 static void slideshow_list_init(SlideShowData *ss, gint start_index)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
88 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
89 if (ss->list_done)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
90 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
91 g_list_free(ss->list_done);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
92 ss->list_done = NULL;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
93 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
94
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
95 if (ss->list) g_list_free(ss->list);
3
gqview
parents: 1
diff changeset
96
326
509b84801d66 Rename slideshow options.
zas_
parents: 318
diff changeset
97 if (options->slideshow.random)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
98 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
99 ss->list = generate_random_list(ss);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
100 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
101 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
102 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
103 ss->list = generate_list(ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
104 if (start_index >= 0)
3
gqview
parents: 1
diff changeset
105 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
106 /* start with specified image by skipping to it */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
107 gint i = 0;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
108
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
109 while(ss->list && i < start_index)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
110 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
111 ss->list_done = g_list_prepend (ss->list_done, ss->list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
112 ss->list = g_list_remove(ss->list, ss->list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
113 i++;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
114 }
3
gqview
parents: 1
diff changeset
115 }
gqview
parents: 1
diff changeset
116 }
gqview
parents: 1
diff changeset
117 }
gqview
parents: 1
diff changeset
118
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
119 gint slideshow_should_continue(SlideShowData *ss)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
120 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
121 FileData *imd_fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
122 const gchar *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
123
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
124 if (!ss) return FALSE;
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
125
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
126 imd_fd = image_get_fd(ss->imd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
127
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
128 if ( ((imd_fd == NULL) != (ss->slide_fd == NULL)) ||
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
129 (imd_fd && ss->slide_fd && imd_fd != ss->slide_fd) ) return FALSE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
130
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
131 if (ss->filelist) return TRUE;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
132
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
133 if (ss->cd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
134 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
135 if (g_list_length(ss->cd->list) == ss->slide_count)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
136 return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
137 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
138 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
139 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
140
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
141 if (!ss->layout) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
142 path = layout_get_path(ss->layout);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
143
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
144 if (path && ss->layout_path &&
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
145 strcmp(path, ss->layout_path) == 0)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
146 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
147 if (ss->from_selection && ss->slide_count == layout_selection_count(ss->layout, NULL)) return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
148 if (!ss->from_selection && ss->slide_count == layout_list_count(ss->layout, NULL)) return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
149 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
150
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
151 return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
152 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
153
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
154 static gint slideshow_step(SlideShowData *ss, gint forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
155 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
156 gint row;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
157
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
158 if (!slideshow_should_continue(ss))
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
159 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
160 return FALSE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
161 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
162
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
163 if (forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
164 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
165 if (!ss->list) return TRUE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
166
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
167 row = GPOINTER_TO_INT(ss->list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
168 ss->list_done = g_list_prepend (ss->list_done, ss->list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
169 ss->list = g_list_remove(ss->list, ss->list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
170 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
171 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
172 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
173 if (!ss->list_done || !ss->list_done->next) return TRUE;
3
gqview
parents: 1
diff changeset
174
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
175 ss->list = g_list_prepend(ss->list, ss->list_done->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
176 ss->list_done = g_list_remove(ss->list_done, ss->list_done->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
177 row = GPOINTER_TO_INT(ss->list_done->data);
3
gqview
parents: 1
diff changeset
178 }
gqview
parents: 1
diff changeset
179
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
180 file_data_unref(ss->slide_fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
181 ss->slide_fd = NULL;
3
gqview
parents: 1
diff changeset
182
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
183 if (ss->filelist)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
184 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
185 ss->slide_fd = file_data_ref((FileData *)g_list_nth_data(ss->filelist, row));
318
b16b9b8979e5 Add a new struct ConfOptions to handle options.
zas_
parents: 281
diff changeset
186 image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd, options->zoom_mode));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
187 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
188 else if (ss->cd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
189 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
190 CollectInfo *info;
3
gqview
parents: 1
diff changeset
191
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
192 info = g_list_nth_data(ss->cd->list, row);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
193 ss->slide_fd = file_data_ref(info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
194
318
b16b9b8979e5 Add a new struct ConfOptions to handle options.
zas_
parents: 281
diff changeset
195 image_change_from_collection(ss->imd, ss->cd, info, image_zoom_get_default(ss->imd, options->zoom_mode));
3
gqview
parents: 1
diff changeset
196 }
gqview
parents: 1
diff changeset
197 else
gqview
parents: 1
diff changeset
198 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
199 ss->slide_fd = file_data_ref(layout_list_get_fd(ss->layout, row));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
200
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
201 if (ss->from_selection)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
202 {
318
b16b9b8979e5 Add a new struct ConfOptions to handle options.
zas_
parents: 281
diff changeset
203 image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd, options->zoom_mode));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
204 layout_status_update_info(ss->layout, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
205 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
206 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
207 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
208 layout_image_set_index(ss->layout, row);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
209 }
3
gqview
parents: 1
diff changeset
210 }
gqview
parents: 1
diff changeset
211
326
509b84801d66 Rename slideshow options.
zas_
parents: 318
diff changeset
212 if (!ss->list && options->slideshow.repeat)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
213 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
214 slideshow_list_init(ss, -1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
215 }
3
gqview
parents: 1
diff changeset
216
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
217 if (!ss->list)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
218 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
219 return FALSE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
220 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
221
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
222 /* read ahead */
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
223
318
b16b9b8979e5 Add a new struct ConfOptions to handle options.
zas_
parents: 281
diff changeset
224 if (options->enable_read_ahead)
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
225 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
226 gint r;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
227 if (forward)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
228 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
229 if (!ss->list) return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
230 r = GPOINTER_TO_INT(ss->list->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
231 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
232 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
233 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
234 if (!ss->list_done || !ss->list_done->next) return TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
235 r = GPOINTER_TO_INT(ss->list_done->next->data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
236 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
237
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
238 if (ss->filelist)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
239 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
240 image_prebuffer_set(ss->imd, g_list_nth_data(ss->filelist, r));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
241 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
242 else if (ss->cd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
243 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
244 CollectInfo *info;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
245 info = g_list_nth_data(ss->cd->list, r);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
246 if (info) image_prebuffer_set(ss->imd, info->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
247 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
248 else if (ss->from_selection)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
249 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
250 image_prebuffer_set(ss->imd, layout_list_get_fd(ss->layout, r));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
251 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
252 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
253
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
254 return TRUE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
255 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
256
3
gqview
parents: 1
diff changeset
257 static gint slideshow_loop_cb(gpointer data)
gqview
parents: 1
diff changeset
258 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
259 SlideShowData *ss = data;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
260
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
261 if (ss->paused) return TRUE;
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
262
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
263 if (!slideshow_step(ss, TRUE))
3
gqview
parents: 1
diff changeset
264 {
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
265 ss->timeout_id = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
266 slideshow_free(ss);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
267 return FALSE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
268 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
269
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
270 return TRUE;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
271 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
272
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
273 static void slideshow_timer_reset(SlideShowData *ss, gint reset)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
274 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
275 if (reset)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
276 {
326
509b84801d66 Rename slideshow options.
zas_
parents: 318
diff changeset
277 if (options->slideshow.delay < 1) options->slideshow.delay = 1;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
278
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
279 if (ss->timeout_id != -1) g_source_remove(ss->timeout_id);
326
509b84801d66 Rename slideshow options.
zas_
parents: 318
diff changeset
280 ss->timeout_id = g_timeout_add(options->slideshow.delay * 1000 / SLIDESHOW_SUBSECOND_PRECISION,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
281 slideshow_loop_cb, ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
282 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
283 else if (ss->timeout_id != -1)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
284 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
285 g_source_remove(ss->timeout_id);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
286 ss->timeout_id = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
287 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
288 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
289
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
290 void slideshow_next(SlideShowData *ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
291 {
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
292 if (!ss) return;
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
293
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
294 if (!slideshow_step(ss, TRUE))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
295 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
296 slideshow_free(ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
297 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
298 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
299
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
300 slideshow_timer_reset(ss, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
301 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
302
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
303 void slideshow_prev(SlideShowData *ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
304 {
89
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
305 if (!ss) return;
b3149a34d0dd Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
306
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
307 if (!slideshow_step(ss, FALSE))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
308 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
309 slideshow_free(ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
310 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
311 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
312
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
313 slideshow_timer_reset(ss, TRUE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
314 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
315
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
316 static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw,
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
317 GList *filelist, gint start_point,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
318 CollectionData *cd, CollectInfo *start_info,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
319 void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
320 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
321 SlideShowData *ss;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
322 gint start_index = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
323
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
324 if (!filelist && !cd && layout_list_count(lw, NULL) < 1) return NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
325
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
326 ss = g_new0(SlideShowData, 1);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
327
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
328 ss->imd = imd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
329
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
330 ss->filelist = filelist;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
331 ss->cd = cd;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
332 ss->layout = lw;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
333 ss->layout_path = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
334
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
335 ss->list = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
336 ss->list_done = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
337
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
338 ss->from_selection = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
339
119
197b8d2e52ce Thu Nov 30 09:55:42 2006 John Ellis <johne@verizon.net>
gqview
parents: 89
diff changeset
340 ss->stop_func = NULL;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
341
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
342 ss->timeout_id = -1;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
343 ss->paused = FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
344
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
345 if (ss->filelist)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
346 {
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
347 ss->slide_count = g_list_length(ss->filelist);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
348 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
349 else if (ss->cd)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
350 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
351 collection_ref(ss->cd);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
352 ss->slide_count = g_list_length(ss->cd->list);
326
509b84801d66 Rename slideshow options.
zas_
parents: 318
diff changeset
353 if (!options->slideshow.random && start_info)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
354 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
355 start_index = g_list_index(ss->cd->list, start_info);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
356 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
357 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
358 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
359 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
360 /* layout method */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
361
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
362 ss->slide_count = layout_selection_count(ss->layout, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
363 ss->layout_path = g_strdup(layout_get_path(ss->layout));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
364 if (ss->slide_count < 2)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
365 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
366 ss->slide_count = layout_list_count(ss->layout, NULL);
326
509b84801d66 Rename slideshow options.
zas_
parents: 318
diff changeset
367 if (!options->slideshow.random && start_point >= 0 && start_point < ss->slide_count)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
368 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
369 start_index = start_point;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
370 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
371 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
372 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
373 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
374 ss->from_selection = TRUE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
375 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
376 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
377
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
378 slideshow_list_init(ss, start_index);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
379
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
380 ss->slide_fd = file_data_ref(image_get_fd(ss->imd));
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
381 if (slideshow_step(ss, TRUE))
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
382 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
383 slideshow_timer_reset(ss, TRUE);
119
197b8d2e52ce Thu Nov 30 09:55:42 2006 John Ellis <johne@verizon.net>
gqview
parents: 89
diff changeset
384
197b8d2e52ce Thu Nov 30 09:55:42 2006 John Ellis <johne@verizon.net>
gqview
parents: 89
diff changeset
385 ss->stop_func = stop_func;
197b8d2e52ce Thu Nov 30 09:55:42 2006 John Ellis <johne@verizon.net>
gqview
parents: 89
diff changeset
386 ss->stop_data = stop_data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
387 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
388 else
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
389 {
119
197b8d2e52ce Thu Nov 30 09:55:42 2006 John Ellis <johne@verizon.net>
gqview
parents: 89
diff changeset
390 slideshow_free(ss);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
391 ss = NULL;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
392 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
393
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
394 return ss;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
395 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
396
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 119
diff changeset
397 SlideShowData *slideshow_start_from_filelist(ImageWindow *imd, GList *list,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
398 void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
399 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
400 return real_slideshow_start(imd, NULL, list, -1, NULL, NULL, stop_func, stop_data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
401 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
402
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
403 SlideShowData *slideshow_start_from_collection(ImageWindow *imd, CollectionData *cd,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
404 void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
405 CollectInfo *start_info)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
406 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
407 return real_slideshow_start(imd, NULL, NULL, -1, cd, start_info, stop_func, stop_data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
408 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
409
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
410 SlideShowData *slideshow_start(ImageWindow *imd, LayoutWindow *lw, gint start_point,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
411 void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
412 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
413 return real_slideshow_start(imd, lw, NULL, start_point, NULL, NULL, stop_func, stop_data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
414 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
415
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
416 gint slideshow_paused(SlideShowData *ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
417 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
418 if (!ss) return FALSE;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
419
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
420 return ss->paused;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
421 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
422
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
423 void slideshow_pause_set(SlideShowData *ss, gint paused)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
424 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
425 if (!ss) return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
426
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
427 ss->paused = paused;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
428 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
429
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
430 gint slideshow_pause_toggle(SlideShowData *ss)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
431 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
432 slideshow_pause_set(ss, !slideshow_paused(ss));
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
433 return slideshow_paused(ss);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
434 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
435
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents: 3
diff changeset
436