/* restore image window */
lw->image = fs->normal_imd;
- if (lw->slideshow)
- {
- lw->slideshow->imd = lw->image;
- }
-
lw->full_screen = NULL;
}
/* set to new image window */
lw->image = lw->full_screen->imd;
- if (lw->slideshow)
- {
- lw->slideshow->imd = lw->image;
- }
-
layout_image_set_buttons(lw);
g_signal_connect(G_OBJECT(lw->full_screen->window), "key_press_event",
if (cd && info)
{
- lw->slideshow = slideshow_start_from_collection(lw->image, cd,
+ lw->slideshow = slideshow_start_from_collection(lw, NULL, cd,
layout_image_slideshow_stop_func, lw, info);
}
else
{
- lw->slideshow = slideshow_start(lw->image, lw,
+ lw->slideshow = slideshow_start(lw,
layout_list_get_index(lw, layout_image_get_fd(lw)),
layout_image_slideshow_stop_func, lw);
}
return;
}
- lw->slideshow = slideshow_start_from_filelist(lw->image, list,
+ lw->slideshow = slideshow_start_from_filelist(lw, NULL, list,
layout_image_slideshow_stop_func, lw);
layout_status_update_info(lw, NULL);
if (ss->from_selection)
{
- list = layout_selection_list_by_index(ss->layout);
+ list = layout_selection_list_by_index(ss->lw);
}
else
{
if (!ss) return FALSE;
- imd_fd = image_get_fd(ss->imd);
+ if (ss->lw)
+ imd_fd = layout_image_get_fd(ss->lw);
+ else
+ imd_fd = image_get_fd(ss->imd);
if ( ((imd_fd == NULL) != (ss->slide_fd == NULL)) ||
(imd_fd && ss->slide_fd && imd_fd != ss->slide_fd) ) return FALSE;
return FALSE;
}
- if (!ss->layout) return FALSE;
- dir_fd = ss->layout->dir_fd;
+ dir_fd = ss->lw->dir_fd;
if (dir_fd && ss->dir_fd && dir_fd == ss->dir_fd)
{
- if (ss->from_selection && ss->slide_count == layout_selection_count(ss->layout, NULL)) return TRUE;
- if (!ss->from_selection && ss->slide_count == layout_list_count(ss->layout, NULL)) return TRUE;
+ if (ss->from_selection && ss->slide_count == layout_selection_count(ss->lw, NULL)) return TRUE;
+ if (!ss->from_selection && ss->slide_count == layout_list_count(ss->lw, NULL)) return TRUE;
}
return FALSE;
if (ss->filelist)
{
ss->slide_fd = file_data_ref((FileData *)g_list_nth_data(ss->filelist, row));
- image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd));
+ if (ss->lw)
+ layout_set_fd(ss->lw, ss->slide_fd);
+ else
+ image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd));
}
else if (ss->cd)
{
info = g_list_nth_data(ss->cd->list, row);
ss->slide_fd = file_data_ref(info->fd);
- image_change_from_collection(ss->imd, ss->cd, info, image_zoom_get_default(ss->imd));
+ if (ss->lw)
+ image_change_from_collection(ss->lw->image, ss->cd, info, image_zoom_get_default(ss->lw->image));
+ else
+ image_change_from_collection(ss->imd, ss->cd, info, image_zoom_get_default(ss->imd));
}
else
{
- ss->slide_fd = file_data_ref(layout_list_get_fd(ss->layout, row));
+ ss->slide_fd = file_data_ref(layout_list_get_fd(ss->lw, row));
if (ss->from_selection)
{
- image_change_fd(ss->imd, ss->slide_fd, image_zoom_get_default(ss->imd));
- layout_status_update_info(ss->layout, NULL);
+ layout_set_fd(ss->lw, ss->slide_fd);
+ layout_status_update_info(ss->lw, NULL);
}
else
{
- layout_image_set_index(ss->layout, row);
+ layout_image_set_index(ss->lw, row);
}
}
}
/* read ahead */
-
- if (options->image.enable_read_ahead)
+ if (options->image.enable_read_ahead && (!ss->lw || ss->from_selection))
{
gint r;
if (forward)
}
else if (ss->from_selection)
{
- image_prebuffer_set(ss->imd, layout_list_get_fd(ss->layout, r));
+ image_prebuffer_set(ss->lw->image, layout_list_get_fd(ss->lw, r));
}
}
slideshow_move(ss, FALSE);
}
-static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw,
+static SlideShowData *real_slideshow_start(LayoutWindow *target_lw, ImageWindow *imd,
GList *filelist, gint start_point,
CollectionData *cd, CollectInfo *start_info,
void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
SlideShowData *ss;
gint start_index = -1;
- if (!filelist && !cd && layout_list_count(lw, NULL) < 1) return NULL;
+ if (!filelist && !cd && layout_list_count(target_lw, NULL) < 1) return NULL;
ss = g_new0(SlideShowData, 1);
- ss->imd = imd;
+ ss->lw = target_lw;
+ ss->imd = imd; /* FIXME: ss->imd is used only for img-view.c and can be dropped with it */
ss->filelist = filelist;
ss->cd = cd;
- ss->layout = lw;
if (ss->filelist)
{
{
/* layout method */
- ss->slide_count = layout_selection_count(ss->layout, NULL);
- ss->dir_fd = file_data_ref(ss->layout->dir_fd);
+ ss->slide_count = layout_selection_count(ss->lw, NULL);
+ ss->dir_fd = file_data_ref(ss->lw->dir_fd);
if (ss->slide_count < 2)
{
- ss->slide_count = layout_list_count(ss->layout, NULL);
+ ss->slide_count = layout_list_count(ss->lw, NULL);
if (!options->slideshow.random && start_point >= 0 && (guint) start_point < ss->slide_count)
{
start_index = start_point;
}
slideshow_list_init(ss, start_index);
+
+ if (ss->lw)
+ ss->slide_fd = file_data_ref(layout_image_get_fd(ss->lw));
+ else
+ ss->slide_fd = file_data_ref(image_get_fd(ss->imd));
- ss->slide_fd = file_data_ref(image_get_fd(ss->imd));
if (slideshow_step(ss, TRUE))
{
slideshow_timer_reset(ss);
return ss;
}
-SlideShowData *slideshow_start_from_filelist(ImageWindow *imd, GList *list,
+SlideShowData *slideshow_start_from_filelist(LayoutWindow *target_lw, ImageWindow *imd, GList *list,
void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
{
- return real_slideshow_start(imd, NULL, list, -1, NULL, NULL, stop_func, stop_data);
+ return real_slideshow_start(target_lw, imd, list, -1, NULL, NULL, stop_func, stop_data);
}
-SlideShowData *slideshow_start_from_collection(ImageWindow *imd, CollectionData *cd,
+SlideShowData *slideshow_start_from_collection(LayoutWindow *target_lw, ImageWindow *imd, CollectionData *cd,
void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data,
CollectInfo *start_info)
{
- return real_slideshow_start(imd, NULL, NULL, -1, cd, start_info, stop_func, stop_data);
+ return real_slideshow_start(target_lw, imd, NULL, -1, cd, start_info, stop_func, stop_data);
}
-SlideShowData *slideshow_start(ImageWindow *imd, LayoutWindow *lw, gint start_point,
+SlideShowData *slideshow_start(LayoutWindow *lw, gint start_point,
void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
{
- return real_slideshow_start(imd, lw, NULL, start_point, NULL, NULL, stop_func, stop_data);
+ return real_slideshow_start(lw, NULL, NULL, start_point, NULL, NULL, stop_func, stop_data);
}
gboolean slideshow_paused(SlideShowData *ss)