File: pps-document-transition.c

package info (click to toggle)
papers 49.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 21,044 kB
  • sloc: ansic: 37,728; sh: 197; xml: 127; makefile: 113
file content (51 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: GPL-2.0-or-later
/* pps-document-transition.c
 *  this file is part of papers, a gnome document viewer
 *
 * Copyright (C) 2006 Carlos Garcia Campos <carlosgc@gnome.org>
 */

#include "pps-document-transition.h"
#include <config.h>

G_DEFINE_INTERFACE (PpsDocumentTransition, pps_document_transition, 0)

static void
pps_document_transition_default_init (PpsDocumentTransitionInterface *klass)
{
}

gdouble
pps_document_transition_get_page_duration (PpsDocumentTransition *document_trans,
                                           gint page)
{
	PpsDocumentTransitionInterface *iface = PPS_DOCUMENT_TRANSITION_GET_IFACE (document_trans);

	if (iface->get_page_duration)
		return iface->get_page_duration (document_trans, page);

	return -1;
}

/**
 * pps_document_transition_get_effect:
 * @document_trans: an #PpsDocumentTransition
 * @page: a page index
 *
 * Returns: (transfer full): an #PpsTransitionEffect
 */
PpsTransitionEffect *
pps_document_transition_get_effect (PpsDocumentTransition *document_trans,
                                    gint page)
{
	PpsDocumentTransitionInterface *iface = PPS_DOCUMENT_TRANSITION_GET_IFACE (document_trans);
	PpsTransitionEffect *effect = NULL;

	if (iface->get_effect)
		effect = iface->get_effect (document_trans, page);

	if (!effect)
		return pps_transition_effect_new (PPS_TRANSITION_EFFECT_REPLACE, NULL);

	return effect;
}