PROP_PRESENTATION,
PROP_SIZING_MODE,
PROP_ZOOM,
+ PROP_ROTATION,
};
enum {
if (!view->document)
return FALSE;
- if (view->pressed_button == 1) {
+ /* For the Evince 0.4.x release, we limit selection to un-rotated
+ * documents only.
+ */
+ if (view->pressed_button == 1 &&
+ view->rotation == 0) {
view->selection_info.in_selection = TRUE;
view->motion_x = event->x + view->scroll_x;
view->motion_y = event->y + view->scroll_y;
return TRUE;
}
- } else if (view->pressed_button <= 0) {
+ /* For the Evince 0.4.x release, we limit links to un-rotated documents
+ * only.
+ */
+ } else if (view->pressed_button <= 0 &&
+ view->rotation == 0) {
EvLink *link;
link = get_link_at_location (view, event->x + view->scroll_x, event->y + view->scroll_y);
alpha = 0x20;
}
- ev_document_find_get_result (find, page,
- i, &rectangle);
+ ev_document_find_get_result (find, page, i, &rectangle);
doc_rect_to_view_rect (view, page, &rectangle, &view_rectangle);
draw_rubberband (GTK_WIDGET (view), GTK_WIDGET(view)->window,
&view_rectangle, alpha);
}
}
+static void
+draw_loading_text (EvView *view,
+ GdkRectangle *page_area,
+ GdkRectangle *expose_area)
+{
+ PangoLayout *layout;
+ PangoFontDescription *font_desc;
+ PangoRectangle logical_rect;
+ double real_scale;
+ int target_width;
+
+ const char *loading_text = _("Loading...");
+
+ layout = gtk_widget_create_pango_layout (GTK_WIDGET (view), loading_text);
+
+ font_desc = pango_font_description_new ();
+
+
+ /* We set the font to be 10 points, get the size, and scale appropriately */
+ pango_font_description_set_size (font_desc, 10 * PANGO_SCALE);
+ pango_layout_set_font_description (layout, font_desc);
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
+ /* Make sure we fit the middle of the page */
+ target_width = MAX (page_area->width / 2, 1);
+ real_scale = ((double)target_width / (double) logical_rect.width) * (PANGO_SCALE * 10);
+ pango_font_description_set_size (font_desc, (int)real_scale);
+ pango_layout_set_font_description (layout, font_desc);
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
+ gtk_paint_layout (GTK_WIDGET (view)->style,
+ GTK_WIDGET (view)->window,
+ GTK_WIDGET_STATE (view),
+ FALSE,
+ page_area,
+ GTK_WIDGET (view),
+ NULL,
+ page_area->x + (target_width/2),
+ page_area->y + (page_area->height - logical_rect.height) / 2,
+ layout);
+
+ pango_font_description_free (font_desc);
+ g_object_unref (layout);
+}
+
static void
draw_one_page (EvView *view,
gint page,
GDK_RGB_DITHER_NORMAL,
0, 0);
g_object_unref (scaled_image);
+ } else {
+ draw_loading_text (view,
+ &real_page_area,
+ expose_area);
}
if (scaled_selection) {
case PROP_ZOOM:
ev_view_set_zoom (view, g_value_get_double (value), FALSE);
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);
}
case PROP_ZOOM:
g_value_set_double (value, view->scale);
break;
+ case PROP_ROTATION:
+ g_value_set_int (value, view->rotation);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
MAX_SCALE,
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));
binding_set = gtk_binding_set_by_class (class);
}
if (view->page_cache) {
- g_object_unref (view->page_cache);
view->page_cache = NULL;
}
}
ev_pixbuf_cache_clear (view->pixbuf_cache);
gtk_widget_queue_resize (GTK_WIDGET (view));
}
+
+ if (rotation != 0)
+ clear_selection (view);
+
+ g_object_notify (G_OBJECT (view), "rotation");
}
int
{
int n_pages, i;
+ /* Disable selection on rotated pages for the 0.4.0 series */
+ if (view->rotation != 0)
+ return;
+
clear_selection (view);
n_pages = ev_page_cache_get_n_pages (view->page_cache);