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.c File Reference
#include "config.h"
#include "ev-document-model.h"
#include "ev-view-type-builtins.h"
#include "ev-view-marshal.h"
+ Include dependency graph for ev-document-model.c:

Go to the source code of this file.

Data Structures

struct  _EvDocumentModel
 
struct  _EvDocumentModelClass
 

Macros

#define DEFAULT_MIN_SCALE   0.25
 
#define DEFAULT_MAX_SCALE   5.0
 

Enumerations

enum  {
  PROP_0, PROP_DOCUMENT, PROP_PAGE, PROP_ROTATION,
  PROP_INVERTED_COLORS, PROP_SCALE, PROP_SIZING_MODE, PROP_CONTINUOUS,
  PROP_DUAL_PAGE, PROP_DUAL_PAGE_ODD_LEFT, PROP_FULLSCREEN, PROP_MIN_SCALE,
  PROP_MAX_SCALE, PROP_PAGE_LAYOUT
}
 
enum  { PAGE_CHANGED, N_SIGNALS }
 

Functions

static void ev_document_model_finalize (GObject *object)
 
static void ev_document_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
static void ev_document_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
static void ev_document_model_class_init (EvDocumentModelClass *klass)
 
static void ev_document_model_init (EvDocumentModel *model)
 
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)
 
static void _ev_document_model_set_dual_page_internal (EvDocumentModel *model, gboolean dual_page)
 
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 (EvDocumentModel *model, gboolean dual_page)
 
gboolean ev_document_model_get_dual_page (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)
 

Variables

static guint signals [N_SIGNALS] = { 0 }
 

Macro Definition Documentation

#define DEFAULT_MAX_SCALE   5.0

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

#define DEFAULT_MIN_SCALE   0.25

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

Enumeration Type Documentation

anonymous enum
Enumerator
PROP_0 
PROP_DOCUMENT 
PROP_PAGE 
PROP_ROTATION 
PROP_INVERTED_COLORS 
PROP_SCALE 
PROP_SIZING_MODE 
PROP_CONTINUOUS 
PROP_DUAL_PAGE 
PROP_DUAL_PAGE_ODD_LEFT 
PROP_FULLSCREEN 
PROP_MIN_SCALE 
PROP_MAX_SCALE 
PROP_PAGE_LAYOUT 

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

anonymous enum
Enumerator
PAGE_CHANGED 
N_SIGNALS 

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

77 {
79  N_SIGNALS
80 };

Function Documentation

static void _ev_document_model_set_dual_page_internal ( EvDocumentModel model,
gboolean  dual_page 
)
static

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

542 {
543  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
544 
545  dual_page = dual_page != FALSE;
546 
547  if (dual_page == model->dual_page)
548  return;
549 
550  model->dual_page = dual_page;
551 
552  g_object_notify (G_OBJECT (model), "dual-page");
553 }

+ Here is the caller graph for this function:

static void ev_document_model_class_init ( EvDocumentModelClass klass)
static

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

210 {
211  GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
212 
213  g_object_class->get_property = ev_document_model_get_property;
214  g_object_class->set_property = ev_document_model_set_property;
215  g_object_class->finalize = ev_document_model_finalize;
216 
217  /* Properties */
218  g_object_class_install_property (g_object_class,
220  g_param_spec_object ("document",
221  "Document",
222  "The current document",
224  G_PARAM_READWRITE |
225  G_PARAM_STATIC_STRINGS));
226  g_object_class_install_property (g_object_class,
227  PROP_PAGE,
228  g_param_spec_int ("page",
229  "Page",
230  "Current page",
231  -1, G_MAXINT, -1,
232  G_PARAM_READWRITE |
233  G_PARAM_STATIC_STRINGS));
234  g_object_class_install_property (g_object_class,
236  g_param_spec_int ("rotation",
237  "Rotation",
238  "Current rotation angle",
239  0, 360, 0,
240  G_PARAM_READWRITE |
241  G_PARAM_STATIC_STRINGS));
242  g_object_class_install_property (g_object_class,
244  g_param_spec_boolean ("inverted-colors",
245  "Inverted Colors",
246  "Whether document is displayed with inverted colors",
247  FALSE,
248  G_PARAM_READWRITE |
249  G_PARAM_STATIC_STRINGS));
250  g_object_class_install_property (g_object_class,
251  PROP_SCALE,
252  g_param_spec_double ("scale",
253  "Scale",
254  "Current scale factor",
255  0., G_MAXDOUBLE, 1.,
256  G_PARAM_READWRITE |
257  G_PARAM_STATIC_STRINGS));
258  g_object_class_install_property (g_object_class,
259  PROP_SCALE,
260  g_param_spec_double ("min-scale",
261  "Minimum Scale",
262  "Minium scale factor",
263  0., G_MAXDOUBLE, DEFAULT_MIN_SCALE,
264  G_PARAM_READWRITE |
265  G_PARAM_STATIC_STRINGS));
266  g_object_class_install_property (g_object_class,
267  PROP_SCALE,
268  g_param_spec_double ("max-scale",
269  "Maximum Scale",
270  "Maximum scale factor",
271  0., G_MAXDOUBLE, DEFAULT_MAX_SCALE,
272  G_PARAM_READWRITE |
273  G_PARAM_STATIC_STRINGS));
274  g_object_class_install_property (g_object_class,
276  g_param_spec_enum ("sizing-mode",
277  "Sizing Mode",
278  "Current sizing mode",
279  EV_TYPE_SIZING_MODE,
281  G_PARAM_READWRITE |
282  G_PARAM_STATIC_STRINGS));
283  g_object_class_install_property (g_object_class,
285  g_param_spec_enum ("page-layout",
286  "Page Layout",
287  "Current page layout",
288  EV_TYPE_PAGE_LAYOUT,
290  G_PARAM_READWRITE |
291  G_PARAM_STATIC_STRINGS));
292  g_object_class_install_property (g_object_class,
294  g_param_spec_boolean ("continuous",
295  "Continuous",
296  "Whether document is displayed in continuous mode",
297  TRUE,
298  G_PARAM_READWRITE |
299  G_PARAM_STATIC_STRINGS));
300  g_object_class_install_property (g_object_class,
302  g_param_spec_boolean ("dual-page",
303  "Dual Page",
304  "Whether document is displayed in dual page mode",
305  FALSE,
306  G_PARAM_READWRITE |
307  G_PARAM_STATIC_STRINGS));
308  g_object_class_install_property (g_object_class,
310  g_param_spec_boolean ("dual-odd-left",
311  "Odd Pages Left",
312  "Whether odd pages are displayed on left side in dual mode",
313  FALSE,
314  G_PARAM_READWRITE |
315  G_PARAM_STATIC_STRINGS));
316  g_object_class_install_property (g_object_class,
318  g_param_spec_boolean ("fullscreen",
319  "Fullscreen",
320  "Whether document is displayed in fullscreen mode",
321  FALSE,
322  G_PARAM_READWRITE |
323  G_PARAM_STATIC_STRINGS));
324 
325  /* Signals */
327  g_signal_new ("page-changed",
329  G_SIGNAL_RUN_LAST,
330  G_STRUCT_OFFSET (EvDocumentModelClass, page_changed),
331  NULL, NULL,
332  ev_view_marshal_VOID__INT_INT,
333  G_TYPE_NONE, 2,
334  G_TYPE_INT, G_TYPE_INT);
335 }
static void ev_document_model_finalize ( GObject *  object)
static

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

91 {
92  EvDocumentModel *model = EV_DOCUMENT_MODEL (object);
93 
94  if (model->document) {
95  g_object_unref (model->document);
96  model->document = NULL;
97  }
98 
99  G_OBJECT_CLASS (ev_document_model_parent_class)->finalize (object);
100 }

+ Here is the caller graph for this function:

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:

static void ev_document_model_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static

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

160 {
161  EvDocumentModel *model = EV_DOCUMENT_MODEL (object);
162 
163  switch (prop_id) {
164  case PROP_DOCUMENT:
165  g_value_set_object (value, model->document);
166  break;
167  case PROP_PAGE:
168  g_value_set_int (value, model->page);
169  break;
170  case PROP_ROTATION:
171  g_value_set_int (value, model->rotation);
172  break;
174  g_value_set_boolean (value, model->inverted_colors);
175  break;
176  case PROP_SCALE:
177  g_value_set_double (value, model->scale);
178  break;
179  case PROP_MIN_SCALE:
180  g_value_set_double (value, model->min_scale);
181  break;
182  case PROP_MAX_SCALE:
183  g_value_set_double (value, model->max_scale);
184  break;
185  case PROP_SIZING_MODE:
186  g_value_set_enum (value, model->sizing_mode);
187  break;
188  case PROP_CONTINUOUS:
189  g_value_set_boolean (value, ev_document_model_get_continuous (model));
190  break;
191  case PROP_PAGE_LAYOUT:
192  g_value_set_enum (value, model->page_layout);
193  break;
194  case PROP_DUAL_PAGE:
195  g_value_set_boolean (value, ev_document_model_get_dual_page (model));
196  break;
198  g_value_set_boolean (value, ev_document_model_get_dual_page_odd_pages_left (model));
199  break;
200  case PROP_FULLSCREEN:
201  g_value_set_boolean (value, ev_document_model_get_fullscreen (model));
202  break;
203  default:
204  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
205  }
206 }

+ 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:

static void ev_document_model_init ( EvDocumentModel model)
static

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

339 {
340  model->page = -1;
341  model->scale = 1.;
343  model->continuous = TRUE;
344  model->inverted_colors = FALSE;
345  model->min_scale = DEFAULT_MIN_SCALE;
346  model->max_scale = DEFAULT_MAX_SCALE;
347 }
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:

static void ev_document_model_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

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

107 {
108  EvDocumentModel *model = EV_DOCUMENT_MODEL (object);
109 
110  switch (prop_id) {
111  case PROP_DOCUMENT:
112  ev_document_model_set_document (model, (EvDocument *)g_value_get_object (value));
113  break;
114  case PROP_PAGE:
115  ev_document_model_set_page (model, g_value_get_int (value));
116  break;
117  case PROP_ROTATION:
118  ev_document_model_set_rotation (model, g_value_get_int (value));
119  break;
121  ev_document_model_set_inverted_colors (model, g_value_get_boolean (value));
122  break;
123  case PROP_SCALE:
124  ev_document_model_set_scale (model, g_value_get_double (value));
125  break;
126  case PROP_MIN_SCALE:
127  ev_document_model_set_min_scale (model, g_value_get_double (value));
128  break;
129  case PROP_MAX_SCALE:
130  ev_document_model_set_max_scale (model, g_value_get_double (value));
131  break;
132  case PROP_SIZING_MODE:
133  ev_document_model_set_sizing_mode (model, g_value_get_enum (value));
134  break;
135  case PROP_CONTINUOUS:
136  ev_document_model_set_continuous (model, g_value_get_boolean (value));
137  break;
138  case PROP_PAGE_LAYOUT:
139  ev_document_model_set_page_layout (model, g_value_get_enum (value));
140  break;
141  case PROP_DUAL_PAGE:
142  ev_document_model_set_dual_page (model, g_value_get_boolean (value));
143  break;
145  ev_document_model_set_dual_page_odd_pages_left (model, g_value_get_boolean (value));
146  break;
147  case PROP_FULLSCREEN:
148  ev_document_model_set_fullscreen (model, g_value_get_boolean (value));
149  break;
150  default:
151  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
152  }
153 }

+ 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:

Variable Documentation

guint signals[N_SIGNALS] = { 0 }
static

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