Go to the source code of this file.
|
void | _get_page_size_for_scale_and_rotation (EvDocument *document, gint page, gdouble scale, gint rotation, gint *page_width, gint *page_height) |
|
void | _ev_view_transform_view_point_to_doc_point (EvView *view, GdkPoint *view_point, GdkRectangle *page_area, GtkBorder *border, double *doc_point_x, double *doc_point_y) |
|
void | _ev_view_transform_view_rect_to_doc_rect (EvView *view, GdkRectangle *view_rect, GdkRectangle *page_area, GtkBorder *border, EvRectangle *doc_rect) |
|
void | _ev_view_transform_doc_point_to_view_point (EvView *view, int page, EvPoint *doc_point, GdkPoint *view_point) |
|
void | _ev_view_transform_doc_rect_to_view_rect (EvView *view, int page, EvRectangle *doc_rect, GdkRectangle *view_rect) |
|
void | _ev_view_get_selection_colors (EvView *view, GdkRGBA *bg_color, GdkRGBA *fg_color) |
|
gint | _ev_view_get_caret_cursor_offset_at_doc_point (EvView *view, gint page, gdouble doc_x, gdouble doc_y) |
|
void | _ev_view_clear_selection (EvView *view) |
|
void | _ev_view_set_selection (EvView *view, GdkPoint *start_point, GdkPoint *end_point) |
|
void | _ev_view_set_focused_element (EvView *view, EvMapping *element_mapping, gint page) |
|
void | _ev_view_focus_form_field (EvView *view, EvFormField *field) |
|
Enumerator |
---|
EV_PAN_ACTION_NONE |
|
EV_PAN_ACTION_NEXT |
|
EV_PAN_ACTION_PREV |
|
Definition at line 75 of file ev-view-private.h.
Enumerator |
---|
SCROLL_TO_KEEP_POSITION |
|
SCROLL_TO_PAGE_POSITION |
|
SCROLL_TO_CENTER |
|
SCROLL_TO_FIND_LOCATION |
|
Definition at line 102 of file ev-view-private.h.
void _ev_view_clear_selection |
( |
EvView * |
view) | |
|
Definition at line 2739 of file ev-view.c.
2742 GtkWidget *field_widget = NULL;
2762 if (!field_widget) {
2763 if (!gtk_widget_has_focus (GTK_WIDGET (view)))
2764 gtk_widget_grab_focus (GTK_WIDGET (view));
2768 g_object_set_data_full (G_OBJECT (field_widget),
"form-field",
2769 g_object_ref (field),
2770 (GDestroyNotify)g_object_unref);
2777 gtk_widget_show (field_widget);
2778 gtk_widget_grab_focus (field_widget);
gint _ev_view_get_caret_cursor_offset_at_doc_point |
( |
EvView * |
view, |
|
|
gint |
page, |
|
|
gdouble |
doc_x, |
|
|
gdouble |
doc_y |
|
) |
| |
Definition at line 4820 of file ev-view.c.
4828 gint first_line_offset;
4829 gint last_line_offset = -1;
4838 while (i < n_areas && offset == -1) {
4841 first_line_offset = -1;
4842 while (doc_y >= rect->
y1 && doc_y <= rect->y2) {
4843 if (first_line_offset == -1) {
4844 if (doc_x <= rect->x1) {
4846 if (last_line_offset != -1) {
4852 dx1 = doc_x - last->
x2;
4853 dx2 = rect->
x1 - doc_x;
4856 offset = last_line_offset;
4863 last_line_offset = i + 1;
4866 first_line_offset = i;
4868 last_line_offset = i + 1;
4870 if (doc_x >= rect->
x1 && doc_x <= rect->x2) {
4875 if (doc_x <= rect->x1 + (rect->
x2 - rect->
x1) / 2)
4886 if (first_line_offset == -1)
4890 if (last_line_offset == -1)
4894 offset = last_line_offset;
void _ev_view_get_selection_colors |
( |
EvView * |
view, |
|
|
GdkRGBA * |
bg_color, |
|
|
GdkRGBA * |
fg_color |
|
) |
| |
Definition at line 6677 of file ev-view.c.
6681 GtkWidget *widget = GTK_WIDGET (view);
6682 GtkStateFlags state;
6683 GtkStyleContext *context;
6685 context = gtk_widget_get_style_context (widget);
6686 gtk_style_context_save (context);
6687 state = gtk_style_context_get_state (context) |
6688 (gtk_widget_has_focus (widget) ? GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE);
6689 gtk_style_context_set_state (context, state);
6692 gtk_style_context_get_background_color (context, state, bg_color);
6695 gtk_style_context_get_color (context, state, fg_color);
6697 gtk_style_context_restore (context);
void _ev_view_set_focused_element |
( |
EvView * |
view, |
|
|
EvMapping * |
element_mapping, |
|
|
gint |
page |
|
) |
| |
Definition at line 2216 of file ev-view.c.
2220 GdkRectangle view_rect;
2221 cairo_region_t *region = NULL;
2230 region = cairo_region_create_rectangle (&view_rect);
2237 region = cairo_region_create_rectangle (&view_rect);
2239 cairo_region_union_rectangle (region, &view_rect);
2248 gdk_window_invalidate_region (gtk_widget_get_window (GTK_WIDGET (view)),
2250 cairo_region_destroy (region);
void _ev_view_set_selection |
( |
EvView * |
view, |
|
|
GdkPoint * |
start_point, |
|
|
GdkPoint * |
end_point |
|
) |
| |
void _ev_view_transform_doc_point_to_view_point |
( |
EvView * |
view, |
|
|
int |
page, |
|
|
EvPoint * |
doc_point, |
|
|
GdkPoint * |
view_point |
|
) |
| |
Definition at line 1391 of file ev-view.c.
1396 GdkRectangle page_area;
1398 double x, y, view_x, view_y;
1410 x = width - doc_point->
y;
1415 gdouble width, height;
1418 x = width - doc_point->
x;
1419 y = height - doc_point->
y;
1427 y = height - doc_point->
x;
1431 g_assert_not_reached ();
1436 view_x = CLAMP ((gint)(x * view->
scale + 0.5), 0, page_area.width);
1437 view_y = CLAMP ((gint)(y * view->
scale + 0.5), 0, page_area.height);
1438 view_point->x = view_x + page_area.x + border.left;
1439 view_point->y = view_y + page_area.y + border.top;
void _ev_view_transform_doc_rect_to_view_rect |
( |
EvView * |
view, |
|
|
int |
page, |
|
|
EvRectangle * |
doc_rect, |
|
|
GdkRectangle * |
view_rect |
|
) |
| |
Definition at line 1443 of file ev-view.c.
1448 GdkRectangle page_area;
1456 w = doc_rect->
x2 - doc_rect->
x1;
1457 h = doc_rect->
y2 - doc_rect->
y1;
1464 x = width - doc_rect->
y2;
1466 w = doc_rect->
y2 - doc_rect->
y1;
1467 h = doc_rect->
x2 - doc_rect->
x1;
1471 gdouble width, height;
1474 x = width - doc_rect->
x2;
1475 y = height - doc_rect->
y2;
1476 w = doc_rect->
x2 - doc_rect->
x1;
1477 h = doc_rect->
y2 - doc_rect->
y1;
1485 y = height - doc_rect->
x2;
1486 w = doc_rect->
y2 - doc_rect->
y1;
1487 h = doc_rect->
x2 - doc_rect->
x1;
1491 g_assert_not_reached ();
1496 view_rect->x = (gint)(x * view->
scale + 0.5) + page_area.x + border.left;
1497 view_rect->y = (gint)(y * view->
scale + 0.5) + page_area.y + border.top;
1498 view_rect->width = (gint)(w * view->
scale + 0.5);
1499 view_rect->height = (gint)(h * view->
scale + 0.5);
void _ev_view_transform_view_point_to_doc_point |
( |
EvView * |
view, |
|
|
GdkPoint * |
view_point, |
|
|
GdkRectangle * |
page_area, |
|
|
GtkBorder * |
border, |
|
|
double * |
doc_point_x, |
|
|
double * |
doc_point_y |
|
) |
| |
Definition at line 1366 of file ev-view.c.
1373 *doc_point_x = MAX ((
double) (view_point->x - page_area->x - border->left) / view->
scale, 0);
1374 *doc_point_y = MAX ((
double) (view_point->y - page_area->y - border->right) / view->
scale, 0);
void _ev_view_transform_view_rect_to_doc_rect |
( |
EvView * |
view, |
|
|
GdkRectangle * |
view_rect, |
|
|
GdkRectangle * |
page_area, |
|
|
GtkBorder * |
border, |
|
|
EvRectangle * |
doc_rect |
|
) |
| |
Definition at line 1378 of file ev-view.c.
1384 doc_rect->
x1 = MAX ((
double) (view_rect->x - page_area->x - border->left) / view->
scale, 0);
1385 doc_rect->
y1 = MAX ((
double) (view_rect->y - page_area->y - border->right) / view->
scale, 0);
1386 doc_rect->
x2 = doc_rect->
x1 + (double) view_rect->width / view->
scale;
1387 doc_rect->
y2 = doc_rect->
y1 + (
double) view_rect->height / view->
scale;
void _get_page_size_for_scale_and_rotation |
( |
EvDocument * |
document, |
|
|
gint |
page, |
|
|
gdouble |
scale, |
|
|
gint |
rotation, |
|
|
gint * |
page_width, |
|
|
gint * |
page_height |
|
) |
| |
Definition at line 1171 of file ev-view.c.
1183 width = (gint)(w * scale + 0.5);
1184 height = (gint)(h * scale + 0.5);
1187 *page_width = (rotation == 0 || rotation == 180) ? width : height;
1189 *page_height = (rotation == 0 || rotation == 180) ? height : width;