Example #1
0
void slideshow_prev(SlideShowData *ss)
{
	if (!ss) return;

	if (!slideshow_step(ss, FALSE))
		{
		slideshow_free(ss);
		return;
		}

	slideshow_timer_reset(ss, TRUE);
}
Example #2
0
static gint slideshow_loop_cb(gpointer data)
{
	SlideShowData *ss = data;

	if (ss->paused) return TRUE;

	if (!slideshow_step(ss, TRUE))
		{
		ss->timeout_id = -1;
		slideshow_free(ss);
		return FALSE;
		}

	return TRUE;
}
Example #3
0
static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw,
					   GList *path_list, gint start_point,
					   CollectionData *cd, CollectInfo *start_info,
					   void (*stop_func)(SlideShowData *, gpointer), gpointer stop_data)
{
	SlideShowData *ss;
	gint start_index = -1;

	if (!path_list && !cd && layout_list_count(lw, NULL) < 1) return NULL;

	ss = g_new0(SlideShowData, 1);

	ss->imd = imd;

	ss->path_list = path_list;
	ss->cd = cd;
	ss->layout = lw;
	ss->layout_path = NULL;

	ss->list = NULL;
	ss->list_done = NULL;

	ss->from_selection = FALSE;

	ss->stop_func = NULL;

	ss->timeout_id = -1;
	ss->paused = FALSE;

	if (ss->path_list)
		{
		ss->slide_count = g_list_length(ss->path_list);
		}
	else if (ss->cd)
		{
		collection_ref(ss->cd);
		ss->slide_count = g_list_length(ss->cd->list);
		if (!slideshow_random && start_info)
			{
			start_index = g_list_index(ss->cd->list, start_info);
			}
		}
	else
		{
		/* layout method */

		ss->slide_count = layout_selection_count(ss->layout, NULL);
		ss->layout_path = g_strdup(layout_get_path(ss->layout));
		if (ss->slide_count < 2)
			{
			ss->slide_count = layout_list_count(ss->layout, NULL);
			if (!slideshow_random && start_point >= 0 && start_point < ss->slide_count)
				{
				start_index = start_point;
				}
			}
		else
			{
			ss->from_selection = TRUE;
			}
		}

	slideshow_list_init(ss, start_index);

	ss->slide_path = g_strdup(image_get_path(ss->imd));
	if (slideshow_step(ss, TRUE))
		{
		slideshow_timer_reset(ss, TRUE);

		ss->stop_func = stop_func;
		ss->stop_data = stop_data;
		}
	else
		{
		slideshow_free(ss);
		ss = NULL;
		}

	return ss;
}
Example #4
0
static void view_slideshow_stop(ViewWindow *vw)
{
	if (vw->ss) slideshow_free(vw->ss);
}