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-document-model.h File Reference
#include <glib-object.h>
#include <evince-document.h>
+ Include dependency graph for ev-document-model.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EV_TYPE_DOCUMENT_MODEL   (ev_document_model_get_type ())
 
#define EV_DOCUMENT_MODEL(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_DOCUMENT_MODEL, EvDocumentModel))
 
#define EV_IS_DOCUMENT_MODEL(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_DOCUMENT_MODEL))
 
#define EV_DOCUMENT_MODEL_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_DOCUMENT_MODEL, EvDocumentModelClass))
 
#define EV_IS_DOCUMENT_MODEL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_DOCUMENT_MODEL))
 
#define EV_DOCUMENT_MODEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_DOCUMENT_MODEL, EvDocumentModelClass))
 

Typedefs

typedef struct _EvDocumentModel EvDocumentModel
 
typedef struct
_EvDocumentModelClass 
EvDocumentModelClass
 

Enumerations

enum  EvSizingMode {
  EV_SIZING_FIT_PAGE, EV_SIZING_BEST_FIT = EV_SIZING_FIT_PAGE, EV_SIZING_FIT_WIDTH, EV_SIZING_FREE,
  EV_SIZING_AUTOMATIC
}
 
enum  EvPageLayout { EV_PAGE_LAYOUT_SINGLE, EV_PAGE_LAYOUT_DUAL, EV_PAGE_LAYOUT_AUTOMATIC }
 

Functions

GType ev_document_model_get_type (void) G_GNUC_CONST
 
EvDocumentModelev_document_model_new (void)
 
EvDocumentModelev_document_model_new_with_document (EvDocument *document)
 
void ev_document_model_set_document (EvDocumentModel *model, EvDocument *document)
 
EvDocumentev_document_model_get_document (EvDocumentModel *model)
 
void ev_document_model_set_page (EvDocumentModel *model, gint page)
 
void ev_document_model_set_page_by_label (EvDocumentModel *model, const gchar *page_label)
 
gint ev_document_model_get_page (EvDocumentModel *model)
 
void ev_document_model_set_scale (EvDocumentModel *model, gdouble scale)
 
gdouble ev_document_model_get_scale (EvDocumentModel *model)
 
void ev_document_model_set_max_scale (EvDocumentModel *model, gdouble max_scale)
 
gdouble ev_document_model_get_max_scale (EvDocumentModel *model)
 
void ev_document_model_set_min_scale (EvDocumentModel *model, gdouble min_scale)
 
gdouble ev_document_model_get_min_scale (EvDocumentModel *model)
 
void ev_document_model_set_sizing_mode (EvDocumentModel *model, EvSizingMode mode)
 
EvSizingMode ev_document_model_get_sizing_mode (EvDocumentModel *model)
 
void ev_document_model_set_page_layout (EvDocumentModel *model, EvPageLayout layout)
 
EvPageLayout ev_document_model_get_page_layout (EvDocumentModel *model)
 
void ev_document_model_set_rotation (EvDocumentModel *model, gint rotation)
 
gint ev_document_model_get_rotation (EvDocumentModel *model)
 
void ev_document_model_set_inverted_colors (EvDocumentModel *model, gboolean inverted_colors)
 
gboolean ev_document_model_get_inverted_colors (EvDocumentModel *model)
 
void ev_document_model_set_continuous (EvDocumentModel *model, gboolean continuous)
 
gboolean ev_document_model_get_continuous (EvDocumentModel *model)
 
void ev_document_model_set_dual_page_odd_pages_left (EvDocumentModel *model, gboolean odd_left)
 
gboolean ev_document_model_get_dual_page_odd_pages_left (EvDocumentModel *model)
 
void ev_document_model_set_fullscreen (EvDocumentModel *model, gboolean fullscreen)
 
gboolean ev_document_model_get_fullscreen (EvDocumentModel *model)
 
void ev_document_model_set_dual_page (EvDocumentModel *model, gboolean dual_page)
 
gboolean ev_document_model_get_dual_page (EvDocumentModel *model)
 

Macro Definition Documentation

#define EV_DOCUMENT_MODEL (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_DOCUMENT_MODEL, EvDocumentModel))

Definition at line 33 of file ev-document-model.h.

#define EV_DOCUMENT_MODEL_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_DOCUMENT_MODEL, EvDocumentModelClass))

Definition at line 35 of file ev-document-model.h.

#define EV_DOCUMENT_MODEL_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_DOCUMENT_MODEL, EvDocumentModelClass))

Definition at line 37 of file ev-document-model.h.

#define EV_IS_DOCUMENT_MODEL (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_DOCUMENT_MODEL))

Definition at line 34 of file ev-document-model.h.

#define EV_IS_DOCUMENT_MODEL_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_DOCUMENT_MODEL))

Definition at line 36 of file ev-document-model.h.

#define EV_TYPE_DOCUMENT_MODEL   (ev_document_model_get_type ())

Definition at line 32 of file ev-document-model.h.

Typedef Documentation

Definition at line 61 of file ev-document-model.h.

Definition at line 62 of file ev-document-model.h.

Enumeration Type Documentation

Enumerator
EV_PAGE_LAYOUT_SINGLE 
EV_PAGE_LAYOUT_DUAL 
EV_PAGE_LAYOUT_AUTOMATIC 

Definition at line 55 of file ev-document-model.h.

EvSizingMode: : Since: 3.8 : Same as EV_SIZING_FIT_PAGE. Deprecated: : : : Since: 3.8

Enumerator
EV_SIZING_FIT_PAGE 
EV_SIZING_BEST_FIT 
EV_SIZING_FIT_WIDTH 
EV_SIZING_FREE 
EV_SIZING_AUTOMATIC 

Definition at line 47 of file ev-document-model.h.

Function Documentation

gboolean ev_document_model_get_continuous ( EvDocumentModel model)

Definition at line 663 of file ev-document-model.c.

664 {
665  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), TRUE);
666 
667  return model->continuous;
668 }

+ Here is the caller graph for this function:

EvDocument* ev_document_model_get_document ( EvDocumentModel model)

ev_document_model_get_document: : a EvDocumentModel

Returns the EvDocument referenced by the model.

Returns: (transfer none): a EvDocument

Definition at line 393 of file ev-document-model.c.

394 {
395  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), NULL);
396 
397  return model->document;
398 }

+ Here is the caller graph for this function:

gboolean ev_document_model_get_dual_page ( EvDocumentModel model)

ev_document_model_get_dual_page: : a EvDocumentModel

Returns: whether the document model's page layout is set to EV_PAGE_LAYOUT_DUAL.

Deprecated: 3.8: Use ev_document_model_get_page_layout() instead

Definition at line 702 of file ev-document-model.c.

703 {
704  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);
705 
706  return model->dual_page;
707 }

+ Here is the caller graph for this function:

gboolean ev_document_model_get_dual_page_odd_pages_left ( EvDocumentModel model)

Definition at line 726 of file ev-document-model.c.

727 {
728  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);
729 
730  return model->dual_page_odd_left;
731 }

+ Here is the caller graph for this function:

gboolean ev_document_model_get_fullscreen ( EvDocumentModel model)

Definition at line 750 of file ev-document-model.c.

751 {
752  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);
753 
754  return model->fullscreen;
755 }

+ Here is the caller graph for this function:

gboolean ev_document_model_get_inverted_colors ( EvDocumentModel model)

Definition at line 639 of file ev-document-model.c.

640 {
641  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);
642 
643  return model->inverted_colors;
644 }

+ Here is the caller graph for this function:

gdouble ev_document_model_get_max_scale ( EvDocumentModel model)

Definition at line 485 of file ev-document-model.c.

486 {
487  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 1.0);
488 
489  return model->max_scale;
490 }

+ Here is the caller graph for this function:

gdouble ev_document_model_get_min_scale ( EvDocumentModel model)

Definition at line 510 of file ev-document-model.c.

511 {
512  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 0.);
513 
514  return model->min_scale;
515 }

+ Here is the caller graph for this function:

gint ev_document_model_get_page ( EvDocumentModel model)

Definition at line 434 of file ev-document-model.c.

435 {
436  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), -1);
437 
438  return model->page;
439 }

+ Here is the caller graph for this function:

EvPageLayout ev_document_model_get_page_layout ( EvDocumentModel model)

ev_document_model_get_page_layout: : a EvDocumentModel

Returns: the document model's page layout

Since: 3.8

Definition at line 590 of file ev-document-model.c.

591 {
592  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), EV_PAGE_LAYOUT_SINGLE);
593 
594  return model->page_layout;
595 }

+ Here is the caller graph for this function:

gint ev_document_model_get_rotation ( EvDocumentModel model)

Definition at line 617 of file ev-document-model.c.

618 {
619  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 0);
620 
621  return model->rotation;
622 }

+ Here is the caller graph for this function:

gdouble ev_document_model_get_scale ( EvDocumentModel model)

Definition at line 460 of file ev-document-model.c.

461 {
462  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 1.0);
463 
464  return model->scale;
465 }

+ Here is the caller graph for this function:

EvSizingMode ev_document_model_get_sizing_mode ( EvDocumentModel model)

Definition at line 532 of file ev-document-model.c.

533 {
534  g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), EV_SIZING_FIT_WIDTH);
535 
536  return model->sizing_mode;
537 }

+ Here is the caller graph for this function:

GType ev_document_model_get_type ( void  )
EvDocumentModel* ev_document_model_new ( void  )

Definition at line 350 of file ev-document-model.c.

351 {
352  return g_object_new (EV_TYPE_DOCUMENT_MODEL, NULL);
353 }

+ Here is the caller graph for this function:

EvDocumentModel* ev_document_model_new_with_document ( EvDocument document)

Definition at line 356 of file ev-document-model.c.

357 {
358  g_return_val_if_fail (EV_IS_DOCUMENT (document), NULL);
359 
360  return g_object_new (EV_TYPE_DOCUMENT_MODEL, "document", document, NULL);
361 }
void ev_document_model_set_continuous ( EvDocumentModel model,
gboolean  continuous 
)

Definition at line 647 of file ev-document-model.c.

649 {
650  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
651 
652  continuous = continuous != FALSE;
653 
654  if (continuous == model->continuous)
655  return;
656 
657  model->continuous = continuous;
658 
659  g_object_notify (G_OBJECT (model), "continuous");
660 }

+ Here is the caller graph for this function:

void ev_document_model_set_document ( EvDocumentModel model,
EvDocument document 
)

Definition at line 364 of file ev-document-model.c.

366 {
367  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
368  g_return_if_fail (EV_IS_DOCUMENT (document));
369 
370  if (document == model->document)
371  return;
372 
373  if (model->document)
374  g_object_unref (model->document);
375  model->document = g_object_ref (document);
376 
377  model->n_pages = ev_document_get_n_pages (document);
378  ev_document_model_set_page (model, CLAMP (model->page, 0,
379  model->n_pages - 1));
380 
381  g_object_notify (G_OBJECT (model), "document");
382 }

+ Here is the caller graph for this function:

void ev_document_model_set_dual_page ( EvDocumentModel model,
gboolean  dual_page 
)

ev_document_model_set_dual_page: : a EvDocumentModel : whether to enable dual page mode

Sets the document model's page layout to EV_PAGE_LAYOUT_SINGLE or EV_PAGE_LAYOUT_DUAL.

Deprecated: 3.8: Use ev_document_model_set_page_layout() instead

Definition at line 681 of file ev-document-model.c.

683 {
684  EvPageLayout layout;
685 
686  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
687 
688  layout = dual_page ? EV_PAGE_LAYOUT_DUAL : EV_PAGE_LAYOUT_SINGLE;
689  ev_document_model_set_page_layout (model, layout);
690 }

+ Here is the caller graph for this function:

void ev_document_model_set_dual_page_odd_pages_left ( EvDocumentModel model,
gboolean  odd_left 
)

Definition at line 710 of file ev-document-model.c.

712 {
713  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
714 
715  odd_left = odd_left != FALSE;
716 
717  if (odd_left == model->dual_page_odd_left)
718  return;
719 
720  model->dual_page_odd_left = odd_left;
721 
722  g_object_notify (G_OBJECT (model), "dual-odd-left");
723 }

+ Here is the caller graph for this function:

void ev_document_model_set_fullscreen ( EvDocumentModel model,
gboolean  fullscreen 
)

Definition at line 734 of file ev-document-model.c.

736 {
737  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
738 
739  fullscreen = fullscreen != FALSE;
740 
741  if (fullscreen == model->fullscreen)
742  return;
743 
744  model->fullscreen = fullscreen;
745 
746  g_object_notify (G_OBJECT (model), "fullscreen");
747 }

+ Here is the caller graph for this function:

void ev_document_model_set_inverted_colors ( EvDocumentModel model,
gboolean  inverted_colors 
)

Definition at line 625 of file ev-document-model.c.

627 {
628  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
629 
630  if (inverted_colors == model->inverted_colors)
631  return;
632 
633  model->inverted_colors = inverted_colors;
634 
635  g_object_notify (G_OBJECT (model), "inverted-colors");
636 }

+ Here is the caller graph for this function:

void ev_document_model_set_max_scale ( EvDocumentModel model,
gdouble  max_scale 
)

Definition at line 468 of file ev-document-model.c.

470 {
471  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
472 
473  if (max_scale == model->max_scale)
474  return;
475 
476  model->max_scale = max_scale;
477 
478  if (model->scale > max_scale)
479  ev_document_model_set_scale (model, max_scale);
480 
481  g_object_notify (G_OBJECT (model), "max-scale");
482 }

+ Here is the caller graph for this function:

void ev_document_model_set_min_scale ( EvDocumentModel model,
gdouble  min_scale 
)

Definition at line 493 of file ev-document-model.c.

495 {
496  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
497 
498  if (min_scale == model->min_scale)
499  return;
500 
501  model->min_scale = min_scale;
502 
503  if (model->scale < min_scale)
504  ev_document_model_set_scale (model, min_scale);
505 
506  g_object_notify (G_OBJECT (model), "min-scale");
507 }

+ Here is the caller graph for this function:

void ev_document_model_set_page ( EvDocumentModel model,
gint  page 
)

Definition at line 401 of file ev-document-model.c.

403 {
404  gint old_page;
405 
406  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
407 
408  if (model->page == page)
409  return;
410  if (page < 0 || (model->document && page >= model->n_pages))
411  return;
412 
413  old_page = model->page;
414  model->page = page;
415  g_signal_emit (model, signals[PAGE_CHANGED], 0, old_page, page);
416 
417  g_object_notify (G_OBJECT (model), "page");
418 }

+ Here is the caller graph for this function:

void ev_document_model_set_page_by_label ( EvDocumentModel model,
const gchar *  page_label 
)

Definition at line 421 of file ev-document-model.c.

423 {
424  gint page;
425 
426  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
427  g_return_if_fail (model->document != NULL);
428 
429  if (ev_document_find_page_by_label (model->document, page_label, &page))
430  ev_document_model_set_page (model, page);
431 }

+ Here is the caller graph for this function:

void ev_document_model_set_page_layout ( EvDocumentModel model,
EvPageLayout  layout 
)

ev_document_model_set_page_layout: : a EvDocumentModel : a EvPageLayout

Sets the document model's page layout to .

Since: 3.8

Definition at line 565 of file ev-document-model.c.

567 {
568  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
569 
570  if (layout == model->page_layout)
571  return;
572 
573  model->page_layout = layout;
574 
575  g_object_notify (G_OBJECT (model), "page-layout");
576 
577  /* set deprecated property as well */
579 }

+ Here is the caller graph for this function:

void ev_document_model_set_rotation ( EvDocumentModel model,
gint  rotation 
)

Definition at line 598 of file ev-document-model.c.

600 {
601  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
602 
603  if (rotation >= 360)
604  rotation -= 360;
605  else if (rotation < 0)
606  rotation += 360;
607 
608  if (rotation == model->rotation)
609  return;
610 
611  model->rotation = rotation;
612 
613  g_object_notify (G_OBJECT (model), "rotation");
614 }

+ Here is the caller graph for this function:

void ev_document_model_set_scale ( EvDocumentModel model,
gdouble  scale 
)

Definition at line 442 of file ev-document-model.c.

444 {
445  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
446 
447  scale = CLAMP (scale,
448  model->sizing_mode == EV_SIZING_FREE ?
449  model->min_scale : 0, model->max_scale);
450 
451  if (scale == model->scale)
452  return;
453 
454  model->scale = scale;
455 
456  g_object_notify (G_OBJECT (model), "scale");
457 }

+ Here is the caller graph for this function:

void ev_document_model_set_sizing_mode ( EvDocumentModel model,
EvSizingMode  mode 
)

Definition at line 518 of file ev-document-model.c.

520 {
521  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
522 
523  if (mode == model->sizing_mode)
524  return;
525 
526  model->sizing_mode = mode;
527 
528  g_object_notify (G_OBJECT (model), "sizing-mode");
529 }

+ Here is the caller graph for this function: