Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-timeline.h File Reference
#include <glib-object.h>
+ Include dependency graph for ev-timeline.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvTimeline
 
struct  _EvTimelineClass
 

Macros

#define EV_TYPE_TIMELINE   (ev_timeline_get_type ())
 
#define EV_TIMELINE(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_TIMELINE, EvTimeline))
 
#define EV_TIMELINE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_TIMELINE, EvTimelineClass))
 
#define EV_IS_TIMELINE(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_TIMELINE))
 
#define EV_IS_TIMELINE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_TIMELINE))
 
#define EV_TIMELINE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_TIMELINE, EvTimelineClass))
 

Typedefs

typedef struct _EvTimeline EvTimeline
 
typedef struct _EvTimelineClass EvTimelineClass
 

Functions

GType ev_timeline_get_type (void) G_GNUC_CONST
 
EvTimelineev_timeline_new (guint duration)
 
void ev_timeline_start (EvTimeline *timeline)
 
void ev_timeline_pause (EvTimeline *timeline)
 
void ev_timeline_rewind (EvTimeline *timeline)
 
gboolean ev_timeline_is_running (EvTimeline *timeline)
 
guint ev_timeline_get_fps (EvTimeline *timeline)
 
void ev_timeline_set_fps (EvTimeline *timeline, guint fps)
 
gboolean ev_timeline_get_loop (EvTimeline *timeline)
 
void ev_timeline_set_loop (EvTimeline *timeline, gboolean loop)
 
guint ev_timeline_get_duration (EvTimeline *timeline)
 
void ev_timeline_set_duration (EvTimeline *timeline, guint duration)
 
gdouble ev_timeline_get_progress (EvTimeline *timeline)
 

Macro Definition Documentation

#define EV_IS_TIMELINE (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_TIMELINE))

Definition at line 36 of file ev-timeline.h.

#define EV_IS_TIMELINE_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_TIMELINE))

Definition at line 37 of file ev-timeline.h.

#define EV_TIMELINE (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_TIMELINE, EvTimeline))

Definition at line 34 of file ev-timeline.h.

#define EV_TIMELINE_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_TIMELINE, EvTimelineClass))

Definition at line 35 of file ev-timeline.h.

#define EV_TIMELINE_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_TIMELINE, EvTimelineClass))

Definition at line 38 of file ev-timeline.h.

#define EV_TYPE_TIMELINE   (ev_timeline_get_type ())

Definition at line 33 of file ev-timeline.h.

Typedef Documentation

typedef struct _EvTimeline EvTimeline

Definition at line 40 of file ev-timeline.h.

Definition at line 41 of file ev-timeline.h.

Function Documentation

guint ev_timeline_get_duration ( EvTimeline timeline)

Definition at line 424 of file ev-timeline.c.

425 {
426  EvTimelinePriv *priv;
427 
428  g_return_val_if_fail (EV_IS_TIMELINE (timeline), 0);
429 
430  priv = EV_TIMELINE_GET_PRIV (timeline);
431 
432  return priv->duration;
433 }
guint ev_timeline_get_fps ( EvTimeline timeline)

Definition at line 351 of file ev-timeline.c.

352 {
353  EvTimelinePriv *priv;
354 
355  g_return_val_if_fail (EV_IS_TIMELINE (timeline), 1);
356 
357  priv = EV_TIMELINE_GET_PRIV (timeline);
358  return priv->fps;
359 }
gboolean ev_timeline_get_loop ( EvTimeline timeline)

Definition at line 384 of file ev-timeline.c.

385 {
386  EvTimelinePriv *priv;
387 
388  g_return_val_if_fail (EV_IS_TIMELINE (timeline), FALSE);
389 
390  priv = EV_TIMELINE_GET_PRIV (timeline);
391  return priv->loop;
392 }
gdouble ev_timeline_get_progress ( EvTimeline timeline)

Definition at line 436 of file ev-timeline.c.

437 {
438  EvTimelinePriv *priv;
439  gdouble progress;
440  guint elapsed_time;
441 
442  g_return_val_if_fail (EV_IS_TIMELINE (timeline), 0.0);
443 
444  priv = EV_TIMELINE_GET_PRIV (timeline);
445 
446  if (!priv->timer)
447  return 0.;
448 
449  elapsed_time = (guint) (g_timer_elapsed (priv->timer, NULL) * 1000);
450  progress = (gdouble) elapsed_time / priv->duration;
451 
452  return CLAMP (progress, 0., 1.);
453 }

+ Here is the caller graph for this function:

GType ev_timeline_get_type ( void  )
gboolean ev_timeline_is_running ( EvTimeline timeline)

Definition at line 339 of file ev-timeline.c.

340 {
341  EvTimelinePriv *priv;
342 
343  g_return_val_if_fail (EV_IS_TIMELINE (timeline), FALSE);
344 
345  priv = EV_TIMELINE_GET_PRIV (timeline);
346 
347  return (priv->source_id != 0);
348 }

+ Here is the caller graph for this function:

EvTimeline* ev_timeline_new ( guint  duration)

Definition at line 286 of file ev-timeline.c.

287 {
288  return g_object_new (EV_TYPE_TIMELINE,
289  "duration", duration,
290  NULL);
291 }
void ev_timeline_pause ( EvTimeline timeline)

Definition at line 302 of file ev-timeline.c.

303 {
304  EvTimelinePriv *priv;
305 
306  g_return_if_fail (EV_IS_TIMELINE (timeline));
307 
308  priv = EV_TIMELINE_GET_PRIV (timeline);
309 
310  if (priv->source_id) {
311  g_source_remove (priv->source_id);
312  priv->source_id = 0;
313  g_timer_stop (priv->timer);
314  g_signal_emit (timeline, signals [PAUSED], 0);
315  }
316 }
void ev_timeline_rewind ( EvTimeline timeline)

Definition at line 319 of file ev-timeline.c.

320 {
321  EvTimelinePriv *priv;
322 
323  g_return_if_fail (EV_IS_TIMELINE (timeline));
324 
325  priv = EV_TIMELINE_GET_PRIV (timeline);
326 
327  /* destroy and re-create timer if neccesary */
328  if (priv->timer) {
329  g_timer_destroy (priv->timer);
330 
331  if (ev_timeline_is_running (timeline))
332  priv->timer = g_timer_new ();
333  else
334  priv->timer = NULL;
335  }
336 }

+ Here is the caller graph for this function:

void ev_timeline_set_duration ( EvTimeline timeline,
guint  duration 
)

Definition at line 409 of file ev-timeline.c.

411 {
412  EvTimelinePriv *priv;
413 
414  g_return_if_fail (EV_IS_TIMELINE (timeline));
415 
416  priv = EV_TIMELINE_GET_PRIV (timeline);
417 
418  priv->duration = duration;
419 
420  g_object_notify (G_OBJECT (timeline), "duration");
421 }

+ Here is the caller graph for this function:

void ev_timeline_set_fps ( EvTimeline timeline,
guint  fps 
)

Definition at line 362 of file ev-timeline.c.

364 {
365  EvTimelinePriv *priv;
366 
367  g_return_if_fail (EV_IS_TIMELINE (timeline));
368 
369  priv = EV_TIMELINE_GET_PRIV (timeline);
370 
371  priv->fps = fps;
372 
373  if (ev_timeline_is_running (timeline)) {
374  g_source_remove (priv->source_id);
375  priv->source_id = g_timeout_add (FRAME_INTERVAL (priv->fps),
376  (GSourceFunc) ev_timeline_run_frame,
377  timeline);
378  }
379 
380  g_object_notify (G_OBJECT (timeline), "fps");
381 }

+ Here is the caller graph for this function:

void ev_timeline_set_loop ( EvTimeline timeline,
gboolean  loop 
)

Definition at line 395 of file ev-timeline.c.

397 {
398  EvTimelinePriv *priv;
399 
400  g_return_if_fail (EV_IS_TIMELINE (timeline));
401 
402  priv = EV_TIMELINE_GET_PRIV (timeline);
403  priv->loop = loop;
404 
405  g_object_notify (G_OBJECT (timeline), "loop");
406 }

+ Here is the caller graph for this function:

void ev_timeline_start ( EvTimeline timeline)

Definition at line 294 of file ev-timeline.c.

295 {
296  g_return_if_fail (EV_IS_TIMELINE (timeline));
297 
298  EV_TIMELINE_GET_CLASS (timeline)->start (timeline);
299 }

+ Here is the caller graph for this function: