24 #include "ev-view-type-builtins.h"
25 #include "ev-view-marshal.h"
86 #define DEFAULT_MIN_SCALE 0.25
87 #define DEFAULT_MAX_SCALE 5.0
99 G_OBJECT_CLASS (ev_document_model_parent_class)->finalize (
object);
151 G_OBJECT_WARN_INVALID_PROPERTY_ID (
object, prop_id, pspec);
165 g_value_set_object (value, model->
document);
168 g_value_set_int (value, model->
page);
171 g_value_set_int (value, model->
rotation);
177 g_value_set_double (value, model->
scale);
180 g_value_set_double (value, model->
min_scale);
183 g_value_set_double (value, model->
max_scale);
204 G_OBJECT_WARN_INVALID_PROPERTY_ID (
object, prop_id, pspec);
211 GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
218 g_object_class_install_property (g_object_class,
220 g_param_spec_object (
"document",
222 "The current document",
225 G_PARAM_STATIC_STRINGS));
226 g_object_class_install_property (g_object_class,
228 g_param_spec_int (
"page",
233 G_PARAM_STATIC_STRINGS));
234 g_object_class_install_property (g_object_class,
236 g_param_spec_int (
"rotation",
238 "Current rotation angle",
241 G_PARAM_STATIC_STRINGS));
242 g_object_class_install_property (g_object_class,
244 g_param_spec_boolean (
"inverted-colors",
246 "Whether document is displayed with inverted colors",
249 G_PARAM_STATIC_STRINGS));
250 g_object_class_install_property (g_object_class,
252 g_param_spec_double (
"scale",
254 "Current scale factor",
257 G_PARAM_STATIC_STRINGS));
258 g_object_class_install_property (g_object_class,
260 g_param_spec_double (
"min-scale",
262 "Minium scale factor",
265 G_PARAM_STATIC_STRINGS));
266 g_object_class_install_property (g_object_class,
268 g_param_spec_double (
"max-scale",
270 "Maximum scale factor",
273 G_PARAM_STATIC_STRINGS));
274 g_object_class_install_property (g_object_class,
276 g_param_spec_enum (
"sizing-mode",
278 "Current sizing mode",
282 G_PARAM_STATIC_STRINGS));
283 g_object_class_install_property (g_object_class,
285 g_param_spec_enum (
"page-layout",
287 "Current page layout",
291 G_PARAM_STATIC_STRINGS));
292 g_object_class_install_property (g_object_class,
294 g_param_spec_boolean (
"continuous",
296 "Whether document is displayed in continuous mode",
299 G_PARAM_STATIC_STRINGS));
300 g_object_class_install_property (g_object_class,
302 g_param_spec_boolean (
"dual-page",
304 "Whether document is displayed in dual page mode",
307 G_PARAM_STATIC_STRINGS));
308 g_object_class_install_property (g_object_class,
310 g_param_spec_boolean (
"dual-odd-left",
312 "Whether odd pages are displayed on left side in dual mode",
315 G_PARAM_STATIC_STRINGS));
316 g_object_class_install_property (g_object_class,
318 g_param_spec_boolean (
"fullscreen",
320 "Whether document is displayed in fullscreen mode",
323 G_PARAM_STATIC_STRINGS));
327 g_signal_new (
"page-changed",
332 ev_view_marshal_VOID__INT_INT,
334 G_TYPE_INT, G_TYPE_INT);
375 model->
document = g_object_ref (document);
381 g_object_notify (G_OBJECT (model),
"document");
408 if (model->
page == page)
413 old_page = model->
page;
417 g_object_notify (G_OBJECT (model),
"page");
422 const gchar *page_label)
427 g_return_if_fail (model->
document != NULL);
447 scale = CLAMP (scale,
451 if (scale == model->
scale)
454 model->
scale = scale;
456 g_object_notify (G_OBJECT (model),
"scale");
478 if (model->
scale > max_scale)
481 g_object_notify (G_OBJECT (model),
"max-scale");
503 if (model->
scale < min_scale)
506 g_object_notify (G_OBJECT (model),
"min-scale");
528 g_object_notify (G_OBJECT (model),
"sizing-mode");
545 dual_page = dual_page !=
FALSE;
552 g_object_notify (G_OBJECT (model),
"dual-page");
575 g_object_notify (G_OBJECT (model),
"page-layout");
605 else if (rotation < 0)
613 g_object_notify (G_OBJECT (model),
"rotation");
626 gboolean inverted_colors)
635 g_object_notify (G_OBJECT (model),
"inverted-colors");
652 continuous = continuous !=
FALSE;
659 g_object_notify (G_OBJECT (model),
"continuous");
715 odd_left = odd_left !=
FALSE;
722 g_object_notify (G_OBJECT (model),
"dual-odd-left");
739 fullscreen = fullscreen !=
FALSE;
746 g_object_notify (G_OBJECT (model),
"fullscreen");