enum {
PROP_0,
- PROP_CONTINUOUS,
- PROP_DUAL_PAGE,
- PROP_FULLSCREEN,
PROP_PRESENTATION,
- PROP_SIZING_MODE,
- PROP_ZOOM,
- PROP_ROTATION,
- PROP_HAS_SELECTION,
+ PROP_HAS_SELECTION
};
enum {
EvView *view = EV_VIEW (object);
switch (prop_id) {
- case PROP_CONTINUOUS:
- ev_view_set_continuous (view, g_value_get_boolean (value));
- break;
- case PROP_DUAL_PAGE:
- ev_view_set_dual_page (view, g_value_get_boolean (value));
- break;
- case PROP_FULLSCREEN:
- ev_view_set_fullscreen (view, g_value_get_boolean (value));
- break;
case PROP_PRESENTATION:
ev_view_set_presentation (view, g_value_get_boolean (value));
break;
- case PROP_SIZING_MODE:
- ev_view_set_sizing_mode (view, g_value_get_enum (value));
- break;
- case PROP_ZOOM:
- ev_view_set_zoom (view, g_value_get_double (value));
- break;
- case PROP_ROTATION:
- ev_view_set_rotation (view, g_value_get_int (value));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
EvView *view = EV_VIEW (object);
switch (prop_id) {
- case PROP_CONTINUOUS:
- g_value_set_boolean (value, view->continuous);
- break;
- case PROP_DUAL_PAGE:
- g_value_set_boolean (value, view->dual_page);
- break;
- case PROP_FULLSCREEN:
- g_value_set_boolean (value, view->fullscreen);
- break;
case PROP_PRESENTATION:
g_value_set_boolean (value, view->presentation);
break;
- case PROP_SIZING_MODE:
- g_value_set_enum (value, view->sizing_mode);
- break;
- case PROP_ZOOM:
- g_value_set_double (value, view->scale);
- break;
- case PROP_ROTATION:
- g_value_set_int (value, view->rotation);
- break;
case PROP_HAS_SELECTION:
g_value_set_boolean (value,
view->selection_info.selections != NULL);
G_TYPE_OBJECT);
- g_object_class_install_property (object_class,
- PROP_CONTINUOUS,
- g_param_spec_boolean ("continuous",
- "Continuous",
- "Continuous scrolling mode",
- TRUE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class,
- PROP_DUAL_PAGE,
- g_param_spec_boolean ("dual-page",
- "Dual Page",
- "Two pages visible at once",
- FALSE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_FULLSCREEN,
- g_param_spec_boolean ("fullscreen",
- "Full Screen",
- "Draw page in a fullscreen fashion",
- FALSE,
- G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_PRESENTATION,
g_param_spec_boolean ("presentation",
"Draw page in presentation mode",
TRUE,
G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class,
- PROP_SIZING_MODE,
- g_param_spec_enum ("sizing-mode",
- "Sizing Mode",
- "Sizing Mode",
- EV_TYPE_SIZING_MODE,
- EV_SIZING_FIT_WIDTH,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class,
- PROP_ZOOM,
- g_param_spec_double ("zoom",
- "Zoom factor",
- "Zoom factor",
- 0,
- G_MAXDOUBLE,
- 1.0,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_ROTATION,
- g_param_spec_double ("rotation",
- "Rotation",
- "Rotation",
- 0,
- 360,
- 0,
- G_PARAM_READWRITE));
-
g_object_class_install_property (object_class,
PROP_HAS_SELECTION,
g_param_spec_boolean ("has-selection",
{
gint rotation = ev_document_model_get_rotation (model);
- ev_view_set_rotation (view, rotation);
+ view->rotation = rotation;
if (view->pixbuf_cache) {
ev_pixbuf_cache_clear (view->pixbuf_cache);
{
EvSizingMode mode = ev_document_model_get_sizing_mode (model);
- ev_view_set_sizing_mode (view, mode);
-
+ view->sizing_mode = mode;
if (mode != EV_SIZING_FREE)
gtk_widget_queue_resize (GTK_WIDGET (view));
}
view->loading_text = NULL;
}
- ev_view_set_zoom (view, scale);
+ view->scale = scale;
view->pending_resize = TRUE;
if (view->sizing_mode == EV_SIZING_FREE)
{
gboolean continuous = ev_document_model_get_continuous (model);
- ev_view_set_continuous (view, continuous);
+ view->continuous = continuous;
view->pending_scroll = SCROLL_TO_PAGE_POSITION;
gtk_widget_queue_resize (GTK_WIDGET (view));
}
{
gboolean dual_page = ev_document_model_get_dual_page (model);
- ev_view_set_dual_page (view, dual_page);
+ view->dual_page = dual_page;
view->pending_scroll = SCROLL_TO_PAGE_POSITION;
/* FIXME: if we're keeping the pixbuf cache around, we should extend the
* preload_cache_size to be 2 if dual_page is set.
{
gboolean fullscreen = ev_document_model_get_fullscreen (model);
- ev_view_set_fullscreen (view, fullscreen);
+ view->fullscreen = fullscreen;
gtk_widget_queue_resize (GTK_WIDGET (view));
}
view_update_range_and_current_page (view);
}
-/*** Zoom and sizing mode ***/
-
-void
-ev_view_set_zoom (EvView *view,
- double scale)
-{
- view->scale = scale;
-
- g_object_notify (G_OBJECT (view), "zoom");
-}
-
-double
-ev_view_get_zoom (EvView *view)
-{
- return view->scale;
-}
-
-gboolean
-ev_view_get_continuous (EvView *view)
-{
- g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
-
- return view->continuous;
-}
-
-void
-ev_view_set_continuous (EvView *view,
- gboolean continuous)
-{
- g_return_if_fail (EV_IS_VIEW (view));
-
- view->continuous = continuous;
-
- g_object_notify (G_OBJECT (view), "continuous");
-}
-
-gboolean
-ev_view_get_dual_page (EvView *view)
-{
- g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
-
- return view->dual_page;
-}
-
-void
-ev_view_set_dual_page (EvView *view,
- gboolean dual_page)
-{
- g_return_if_fail (EV_IS_VIEW (view));
-
- view->dual_page = dual_page;
-
- g_object_notify (G_OBJECT (view), "dual-page");
-}
-
-void
-ev_view_set_fullscreen (EvView *view,
- gboolean fullscreen)
-{
- g_return_if_fail (EV_IS_VIEW (view));
-
- view->fullscreen = fullscreen;
-
- g_object_notify (G_OBJECT (view), "fullscreen");
-}
-
-gboolean
-ev_view_get_fullscreen (EvView *view)
-{
- g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
-
- return view->fullscreen;
-}
-
void
ev_view_set_presentation (EvView *view,
gboolean presentation)
}
}
-void
-ev_view_set_sizing_mode (EvView *view,
- EvSizingMode sizing_mode)
-{
- view->sizing_mode = sizing_mode;
-
- g_object_notify (G_OBJECT (view), "sizing-mode");
-}
-
-EvSizingMode
-ev_view_get_sizing_mode (EvView *view)
-{
- g_return_val_if_fail (EV_IS_VIEW (view), EV_SIZING_FREE);
-
- return view->sizing_mode;
-}
+/*** Zoom and sizing mode ***/
gboolean
ev_view_can_zoom_in (EvView *view)
ev_document_model_set_scale (view->model, scale);
}
-void
-ev_view_set_rotation (EvView *view, int rotation)
-{
- view->rotation = rotation;
-
- g_object_notify (G_OBJECT (view), "rotation");
-}
-
-int
-ev_view_get_rotation (EvView *view)
-{
- return view->rotation;
-}
-
static double
zoom_for_size_fit_width (gdouble doc_width,
gdouble doc_height,
if (page >= 0) {
ev_document_model_set_page (view->model, page);
return TRUE;
- } else if (ev_view_get_dual_page (view) && page == -1) {
+ } else if (view->dual_page && page == -1) {
ev_document_model_set_page (view->model, 0);
return TRUE;
} else {