ev-document-model.c 18.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* this file is part of evince, a gnome document viewer
 *
 *  Copyright (C) 2009 Carlos Garcia Campos
 *  Copyright (C) 2005 Red Hat, Inc
 *
 * Evince is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Evince is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
 */

#include "config.h"

#include "ev-document-model.h"
#include "ev-view-type-builtins.h"
#include "ev-view-marshal.h"

struct _EvDocumentModel
{
	GObject base;

	EvDocument *document;
	gint n_pages;

	gint page;
	gint rotation;
	gdouble scale;
	EvSizingMode sizing_mode;
38
	EvPageLayout page_layout;
39 40
	guint continuous : 1;
	guint dual_page  : 1;
41
	guint dual_page_odd_left : 1;
42
	guint fullscreen : 1;
43
	guint inverted_colors : 1;
44 45 46 47 48 49 50 51 52 53

	gdouble max_scale;
	gdouble min_scale;
};

enum {
	PROP_0,
	PROP_DOCUMENT,
	PROP_PAGE,
	PROP_ROTATION,
54
	PROP_INVERTED_COLORS,
55
	PROP_SCALE,
56 57 58
	PROP_SIZING_MODE,
	PROP_CONTINUOUS,
	PROP_DUAL_PAGE,
59
	PROP_DUAL_PAGE_ODD_LEFT,
60 61
	PROP_FULLSCREEN,
	PROP_MIN_SCALE,
62 63
	PROP_MAX_SCALE,
	PROP_PAGE_LAYOUT
64 65 66 67 68 69 70 71 72 73 74 75
};

enum
{
	PAGE_CHANGED,
	N_SIGNALS
};

static guint signals[N_SIGNALS] = { 0 };

G_DEFINE_TYPE (EvDocumentModel, ev_document_model, G_TYPE_OBJECT)

76 77 78
#define DEFAULT_MIN_SCALE 0.25
#define DEFAULT_MAX_SCALE 5.0

79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
static void
ev_document_model_finalize (GObject *object)
{
	EvDocumentModel *model = EV_DOCUMENT_MODEL (object);

	if (model->document) {
		g_object_unref (model->document);
		model->document = NULL;
	}

	G_OBJECT_CLASS (ev_document_model_parent_class)->finalize (object);
}

static void
ev_document_model_set_property (GObject      *object,
				guint         prop_id,
				const GValue *value,
				GParamSpec   *pspec)
{
	EvDocumentModel *model = EV_DOCUMENT_MODEL (object);

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

static void
ev_document_model_get_property (GObject    *object,
				guint       prop_id,
				GValue     *value,
				GParamSpec *pspec)
{
	EvDocumentModel *model = EV_DOCUMENT_MODEL (object);

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

static void
ev_document_model_class_init (EvDocumentModelClass *klass)
{
	GObjectClass *g_object_class = G_OBJECT_CLASS (klass);

	g_object_class->get_property = ev_document_model_get_property;
	g_object_class->set_property = ev_document_model_set_property;
	g_object_class->finalize = ev_document_model_finalize;

	/* Properties */
	g_object_class_install_property (g_object_class,
					 PROP_DOCUMENT,
					 g_param_spec_object ("document",
							      "Document",
							      "The current document",
							      EV_TYPE_DOCUMENT,
214 215
							      G_PARAM_READWRITE |
                                                              G_PARAM_STATIC_STRINGS));
216 217 218 219 220 221
	g_object_class_install_property (g_object_class,
					 PROP_PAGE,
					 g_param_spec_int ("page",
							   "Page",
							   "Current page",
							   -1, G_MAXINT, -1,
222 223
							   G_PARAM_READWRITE |
                                                           G_PARAM_STATIC_STRINGS));
224 225 226 227 228 229
	g_object_class_install_property (g_object_class,
					 PROP_ROTATION,
					 g_param_spec_int ("rotation",
							   "Rotation",
							   "Current rotation angle",
							   0, 360, 0,
230 231
							   G_PARAM_READWRITE |
                                                           G_PARAM_STATIC_STRINGS));
232 233 234 235 236 237
	g_object_class_install_property (g_object_class,
					 PROP_INVERTED_COLORS,
					 g_param_spec_boolean ("inverted-colors",
							       "Inverted Colors",
							       "Whether document is displayed with inverted colors",
							       FALSE,
238 239
							       G_PARAM_READWRITE |
                                                               G_PARAM_STATIC_STRINGS));
240 241 242 243 244 245
	g_object_class_install_property (g_object_class,
					 PROP_SCALE,
					 g_param_spec_double ("scale",
							      "Scale",
							      "Current scale factor",
							      0., G_MAXDOUBLE, 1.,
246 247
							      G_PARAM_READWRITE |
                                                              G_PARAM_STATIC_STRINGS));
248
	g_object_class_install_property (g_object_class,
249
					 PROP_MIN_SCALE,
250 251 252 253 254 255 256
					 g_param_spec_double ("min-scale",
							      "Minimum Scale",
							      "Minium scale factor",
							      0., G_MAXDOUBLE, DEFAULT_MIN_SCALE,
							      G_PARAM_READWRITE |
                                                              G_PARAM_STATIC_STRINGS));
	g_object_class_install_property (g_object_class,
257
					 PROP_MAX_SCALE,
258 259 260 261 262 263
					 g_param_spec_double ("max-scale",
							      "Maximum Scale",
							      "Maximum scale factor",
							      0., G_MAXDOUBLE, DEFAULT_MAX_SCALE,
							      G_PARAM_READWRITE |
                                                              G_PARAM_STATIC_STRINGS));
264 265 266 267 268 269 270
	g_object_class_install_property (g_object_class,
					 PROP_SIZING_MODE,
					 g_param_spec_enum ("sizing-mode",
							    "Sizing Mode",
							    "Current sizing mode",
							    EV_TYPE_SIZING_MODE,
							    EV_SIZING_FIT_WIDTH,
271 272
							    G_PARAM_READWRITE |
                                                            G_PARAM_STATIC_STRINGS));
273 274 275 276 277 278 279 280 281
	g_object_class_install_property (g_object_class,
					 PROP_PAGE_LAYOUT,
					 g_param_spec_enum ("page-layout",
							    "Page Layout",
							    "Current page layout",
							    EV_TYPE_PAGE_LAYOUT,
							    EV_PAGE_LAYOUT_SINGLE,
							    G_PARAM_READWRITE |
							    G_PARAM_STATIC_STRINGS));
282 283 284 285 286 287
	g_object_class_install_property (g_object_class,
					 PROP_CONTINUOUS,
					 g_param_spec_boolean ("continuous",
							       "Continuous",
							       "Whether document is displayed in continuous mode",
							       TRUE,
288 289
							       G_PARAM_READWRITE |
                                                               G_PARAM_STATIC_STRINGS));
290 291 292 293 294 295
	g_object_class_install_property (g_object_class,
					 PROP_DUAL_PAGE,
					 g_param_spec_boolean ("dual-page",
							       "Dual Page",
							       "Whether document is displayed in dual page mode",
							       FALSE,
296 297
							       G_PARAM_READWRITE |
                                                               G_PARAM_STATIC_STRINGS));
298 299 300 301 302 303
	g_object_class_install_property (g_object_class,
					 PROP_DUAL_PAGE_ODD_LEFT,
					 g_param_spec_boolean ("dual-odd-left",
							       "Odd Pages Left",
							       "Whether odd pages are displayed on left side in dual mode",
							       FALSE,
304 305
							       G_PARAM_READWRITE |
                                                               G_PARAM_STATIC_STRINGS));
306 307 308 309 310 311
	g_object_class_install_property (g_object_class,
					 PROP_FULLSCREEN,
					 g_param_spec_boolean ("fullscreen",
							       "Fullscreen",
							       "Whether document is displayed in fullscreen mode",
							       FALSE,
312 313
							       G_PARAM_READWRITE |
                                                               G_PARAM_STATIC_STRINGS));
314 315 316 317 318 319

	/* Signals */
	signals [PAGE_CHANGED] =
		g_signal_new ("page-changed",
			      EV_TYPE_DOCUMENT_MODEL,
			      G_SIGNAL_RUN_LAST,
320
			      0,
321 322 323 324 325 326 327 328 329 330 331 332
			      NULL, NULL,
			      ev_view_marshal_VOID__INT_INT,
			      G_TYPE_NONE, 2,
			      G_TYPE_INT, G_TYPE_INT);
}

static void
ev_document_model_init (EvDocumentModel *model)
{
	model->page = -1;
	model->scale = 1.;
	model->sizing_mode = EV_SIZING_FIT_WIDTH;
333
	model->continuous = TRUE;
334
	model->inverted_colors = FALSE;
335 336
	model->min_scale = DEFAULT_MIN_SCALE;
	model->max_scale = DEFAULT_MAX_SCALE;
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
}

EvDocumentModel *
ev_document_model_new (void)
{
	return g_object_new (EV_TYPE_DOCUMENT_MODEL, NULL);
}

EvDocumentModel *
ev_document_model_new_with_document (EvDocument *document)
{
	g_return_val_if_fail (EV_IS_DOCUMENT (document), NULL);

	return g_object_new (EV_TYPE_DOCUMENT_MODEL, "document", document, NULL);
}

void
ev_document_model_set_document (EvDocumentModel *model,
				EvDocument      *document)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
	g_return_if_fail (EV_IS_DOCUMENT (document));

	if (document == model->document)
		return;

	if (model->document)
		g_object_unref (model->document);
	model->document = g_object_ref (document);

	model->n_pages = ev_document_get_n_pages (document);
	ev_document_model_set_page (model, CLAMP (model->page, 0,
						  model->n_pages - 1));

	g_object_notify (G_OBJECT (model), "document");
}

374 375 376 377 378 379 380 381
/**
 * ev_document_model_get_document:
 * @model: a #EvDocumentModel
 *
 * Returns the #EvDocument referenced by the model.
 *
 * Returns: (transfer none): a #EvDocument
 */
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
EvDocument *
ev_document_model_get_document (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), NULL);

	return model->document;
}

void
ev_document_model_set_page (EvDocumentModel *model,
			    gint             page)
{
	gint old_page;

	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (model->page == page)
		return;
	if (page < 0 || (model->document && page >= model->n_pages))
		return;

	old_page = model->page;
	model->page = page;
	g_signal_emit (model, signals[PAGE_CHANGED], 0, old_page, page);

	g_object_notify (G_OBJECT (model), "page");
}

void
ev_document_model_set_page_by_label (EvDocumentModel *model,
				     const gchar     *page_label)
{
	gint page;

	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
	g_return_if_fail (model->document != NULL);

	if (ev_document_find_page_by_label (model->document, page_label, &page))
		ev_document_model_set_page (model, page);
}

gint
ev_document_model_get_page (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), -1);

	return model->page;
}

void
ev_document_model_set_scale (EvDocumentModel *model,
			     gdouble          scale)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	scale = CLAMP (scale,
		       model->sizing_mode == EV_SIZING_FREE ?
		       model->min_scale : 0, model->max_scale);

	if (scale == model->scale)
		return;

	model->scale = scale;

	g_object_notify (G_OBJECT (model), "scale");
}

gdouble
ev_document_model_get_scale (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 1.0);

	return model->scale;
}

void
ev_document_model_set_max_scale (EvDocumentModel *model,
				 gdouble          max_scale)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (max_scale == model->max_scale)
		return;

	model->max_scale = max_scale;

	if (model->scale > max_scale)
		ev_document_model_set_scale (model, max_scale);
470 471

	g_object_notify (G_OBJECT (model), "max-scale");
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494
}

gdouble
ev_document_model_get_max_scale (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 1.0);

	return model->max_scale;
}

void
ev_document_model_set_min_scale (EvDocumentModel *model,
				 gdouble          min_scale)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (min_scale == model->min_scale)
		return;

	model->min_scale = min_scale;

	if (model->scale < min_scale)
		ev_document_model_set_scale (model, min_scale);
495 496

	g_object_notify (G_OBJECT (model), "min-scale");
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
}

gdouble
ev_document_model_get_min_scale (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 0.);

	return model->min_scale;
}

void
ev_document_model_set_sizing_mode (EvDocumentModel *model,
				   EvSizingMode     mode)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (mode == model->sizing_mode)
		return;

	model->sizing_mode = mode;

	g_object_notify (G_OBJECT (model), "sizing-mode");
}

EvSizingMode
ev_document_model_get_sizing_mode (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), EV_SIZING_FIT_WIDTH);

	return model->sizing_mode;
}

529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
static void
_ev_document_model_set_dual_page_internal (EvDocumentModel *model,
                                           gboolean         dual_page)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	dual_page = dual_page != FALSE;

	if (dual_page == model->dual_page)
		return;

	model->dual_page = dual_page;

	g_object_notify (G_OBJECT (model), "dual-page");
}

545 546 547 548 549 550 551 552 553
/**
 * ev_document_model_set_page_layout:
 * @model: a #EvDocumentModel
 * @layout: a #EvPageLayout
 *
 * Sets the document model's page layout to @layout.
 *
 * Since: 3.8
 */
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570
void
ev_document_model_set_page_layout (EvDocumentModel *model,
				   EvPageLayout	    layout)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (layout == model->page_layout)
		return;

	model->page_layout = layout;

	g_object_notify (G_OBJECT (model), "page-layout");

	/* set deprecated property as well */
	_ev_document_model_set_dual_page_internal (model, layout == EV_PAGE_LAYOUT_DUAL);
}

571 572 573 574 575 576 577 578
/**
 * ev_document_model_get_page_layout:
 * @model: a #EvDocumentModel
 *
 * Returns: the document model's page layout
 *
 * Since: 3.8
 */
579 580 581 582 583 584 585 586
EvPageLayout
ev_document_model_get_page_layout (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), EV_PAGE_LAYOUT_SINGLE);

	return model->page_layout;
}

587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613
void
ev_document_model_set_rotation (EvDocumentModel *model,
				gint             rotation)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (rotation >= 360)
		rotation -= 360;
	else if (rotation < 0)
		rotation += 360;

	if (rotation == model->rotation)
		return;

	model->rotation = rotation;

	g_object_notify (G_OBJECT (model), "rotation");
}

gint
ev_document_model_get_rotation (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), 0);

	return model->rotation;
}

614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635
void
ev_document_model_set_inverted_colors (EvDocumentModel *model,
				       gboolean         inverted_colors)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	if (inverted_colors == model->inverted_colors)
		return;

	model->inverted_colors = inverted_colors;

	g_object_notify (G_OBJECT (model), "inverted-colors");
}

gboolean
ev_document_model_get_inverted_colors (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);

	return model->inverted_colors;
}

636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659
void
ev_document_model_set_continuous (EvDocumentModel *model,
				  gboolean         continuous)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	continuous = continuous != FALSE;

	if (continuous == model->continuous)
		return;

	model->continuous = continuous;

	g_object_notify (G_OBJECT (model), "continuous");
}

gboolean
ev_document_model_get_continuous (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), TRUE);

	return model->continuous;
}

660 661 662 663 664 665 666 667 668 669
/**
 * ev_document_model_set_dual_page:
 * @model: a #EvDocumentModel
 * @dual_page: 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
 */
670 671 672 673
void
ev_document_model_set_dual_page (EvDocumentModel *model,
				 gboolean         dual_page)
{
674
	EvPageLayout layout;
675

676
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
677

678 679
	layout = dual_page ? EV_PAGE_LAYOUT_DUAL : EV_PAGE_LAYOUT_SINGLE;
	ev_document_model_set_page_layout (model, layout);
680 681
}

682 683 684 685 686 687 688 689 690
/**
 * ev_document_model_get_dual_page:
 * @model: 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
 */
691 692 693 694 695 696 697 698
gboolean
ev_document_model_get_dual_page (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);

	return model->dual_page;
}

699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722
void
ev_document_model_set_dual_page_odd_pages_left (EvDocumentModel *model,
						gboolean         odd_left)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	odd_left = odd_left != FALSE;

	if (odd_left == model->dual_page_odd_left)
		return;

	model->dual_page_odd_left = odd_left;

	g_object_notify (G_OBJECT (model), "dual-odd-left");
}

gboolean
ev_document_model_get_dual_page_odd_pages_left (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);

	return model->dual_page_odd_left;
}

723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745
void
ev_document_model_set_fullscreen (EvDocumentModel *model,
				  gboolean         fullscreen)
{
	g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));

	fullscreen = fullscreen != FALSE;

	if (fullscreen == model->fullscreen)
		return;

	model->fullscreen = fullscreen;

	g_object_notify (G_OBJECT (model), "fullscreen");
}

gboolean
ev_document_model_get_fullscreen (EvDocumentModel *model)
{
	g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);

	return model->fullscreen;
}