Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-view.h File Reference
#include <gtk/gtk.h>
#include <evince-document.h>
#include "ev-document-model.h"
#include "ev-jobs.h"
+ Include dependency graph for ev-view.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EV_TYPE_VIEW   (ev_view_get_type ())
 
#define EV_VIEW(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_VIEW, EvView))
 
#define EV_IS_VIEW(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_VIEW))
 
#define EV_VIEW_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_VIEW, EvViewClass))
 
#define EV_IS_VIEW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_VIEW))
 
#define EV_VIEW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_VIEW, EvViewClass))
 

Typedefs

typedef struct _EvView EvView
 
typedef struct _EvViewClass EvViewClass
 

Functions

GType ev_view_get_type (void) G_GNUC_CONST
 
GtkWidget * ev_view_new (void)
 
void ev_view_set_model (EvView *view, EvDocumentModel *model)
 
EV_DEPRECATED void ev_view_set_loading (EvView *view, gboolean loading)
 
gboolean ev_view_is_loading (EvView *view)
 
void ev_view_reload (EvView *view)
 
void ev_view_set_page_cache_size (EvView *view, gsize cache_size)
 
void ev_view_set_allow_links_change_zoom (EvView *view, gboolean allowed)
 
gboolean ev_view_get_allow_links_change_zoom (EvView *view)
 
void ev_view_copy (EvView *view)
 
void ev_view_copy_link_address (EvView *view, EvLinkAction *action)
 
void ev_view_select_all (EvView *view)
 
gboolean ev_view_get_has_selection (EvView *view)
 
gboolean ev_view_can_zoom_in (EvView *view)
 
void ev_view_zoom_in (EvView *view)
 
gboolean ev_view_can_zoom_out (EvView *view)
 
void ev_view_zoom_out (EvView *view)
 
void ev_view_find_started (EvView *view, EvJobFind *job)
 
void ev_view_find_restart (EvView *view, gint page)
 
void ev_view_find_next (EvView *view)
 
void ev_view_find_previous (EvView *view)
 
void ev_view_find_set_result (EvView *view, gint page, gint result)
 
void ev_view_find_search_changed (EvView *view)
 
void ev_view_find_set_highlight_search (EvView *view, gboolean value)
 
void ev_view_find_changed (EvView *view, GList **results, gint page)
 
void ev_view_find_cancel (EvView *view)
 
void ev_view_highlight_forward_search (EvView *view, EvSourceLink *link)
 
void ev_view_hide_cursor (EvView *view)
 
void ev_view_show_cursor (EvView *view)
 
void ev_view_scroll (EvView *view, GtkScrollType scroll, gboolean horizontal)
 
void ev_view_handle_link (EvView *view, EvLink *link)
 
gboolean ev_view_next_page (EvView *view)
 
gboolean ev_view_previous_page (EvView *view)
 
void ev_view_autoscroll_start (EvView *view)
 
void ev_view_autoscroll_stop (EvView *view)
 
gboolean ev_view_get_page_extents (EvView *view, gint page, GdkRectangle *page_area, GtkBorder *border)
 
void ev_view_focus_annotation (EvView *view, EvMapping *annot_mapping)
 
void ev_view_begin_add_annotation (EvView *view, EvAnnotationType annot_type)
 
void ev_view_cancel_add_annotation (EvView *view)
 
void ev_view_remove_annotation (EvView *view, EvAnnotation *annot)
 
gboolean ev_view_supports_caret_navigation (EvView *view)
 
gboolean ev_view_is_caret_navigation_enabled (EvView *view)
 
void ev_view_set_caret_navigation_enabled (EvView *view, gboolean enabled)
 
void ev_view_set_caret_cursor_position (EvView *view, guint page, guint offset)
 

Macro Definition Documentation

#define EV_IS_VIEW (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_VIEW))

Definition at line 38 of file ev-view.h.

#define EV_IS_VIEW_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_VIEW))

Definition at line 40 of file ev-view.h.

#define EV_TYPE_VIEW   (ev_view_get_type ())

Definition at line 36 of file ev-view.h.

#define EV_VIEW (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_VIEW, EvView))

Definition at line 37 of file ev-view.h.

#define EV_VIEW_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_VIEW, EvViewClass))

Definition at line 39 of file ev-view.h.

#define EV_VIEW_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_VIEW, EvViewClass))

Definition at line 41 of file ev-view.h.

Typedef Documentation

typedef struct _EvView EvView

Definition at line 43 of file ev-view.h.

typedef struct _EvViewClass EvViewClass

Definition at line 44 of file ev-view.h.

Function Documentation

void ev_view_autoscroll_start ( EvView view)

Definition at line 7962 of file ev-view.c.

7963 {
7964  gint x, y;
7965 
7966  g_return_if_fail (EV_IS_VIEW (view));
7967 
7968  if (view->scroll_info.autoscrolling)
7969  return;
7970 
7971  view->scroll_info.autoscrolling = TRUE;
7973 
7974  ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
7975  ev_view_handle_cursor_over_xy (view, x, y);
7976 }

+ Here is the caller graph for this function:

void ev_view_autoscroll_stop ( EvView view)

Definition at line 7979 of file ev-view.c.

7980 {
7981  gint x, y;
7982 
7983  g_return_if_fail (EV_IS_VIEW (view));
7984 
7985  if (!view->scroll_info.autoscrolling)
7986  return;
7987 
7989  ev_view_autoscroll_pause (view);
7990 
7991  ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
7992  ev_view_handle_cursor_over_xy (view, x, y);
7993 }

+ Here is the caller graph for this function:

void ev_view_begin_add_annotation ( EvView view,
EvAnnotationType  annot_type 
)

Definition at line 3429 of file ev-view.c.

3431 {
3432  if (annot_type == EV_ANNOTATION_TYPE_UNKNOWN)
3433  return;
3434 
3435  if (view->adding_annot_info.adding_annot)
3436  return;
3437 
3439  view->adding_annot_info.type = annot_type;
3441 }

+ Here is the caller graph for this function:

gboolean ev_view_can_zoom_in ( EvView view)

Definition at line 8301 of file ev-view.c.

8302 {
8303  return view->can_zoom_in;
8304 }

+ Here is the caller graph for this function:

gboolean ev_view_can_zoom_out ( EvView view)

Definition at line 8307 of file ev-view.c.

8308 {
8309  return view->can_zoom_out;
8310 }

+ Here is the caller graph for this function:

void ev_view_cancel_add_annotation ( EvView view)

Definition at line 3444 of file ev-view.c.

3445 {
3446  gint x, y;
3447 
3448  if (!view->adding_annot_info.adding_annot)
3449  return;
3450 
3452  g_assert(!view->adding_annot_info.annot);
3453  ev_document_misc_get_pointer_position (GTK_WIDGET (view), &x, &y);
3454  ev_view_handle_cursor_over_xy (view, x, y);
3455 }

+ Here is the caller graph for this function:

void ev_view_copy ( EvView view)

Definition at line 9298 of file ev-view.c.

9299 {
9300  char *text;
9301 
9302  if (!EV_IS_SELECTION (ev_view->document))
9303  return;
9304 
9305  text = get_selected_text (ev_view);
9306  ev_view_clipboard_copy (ev_view, text);
9307  g_free (text);
9308 }

+ Here is the caller graph for this function:

void ev_view_copy_link_address ( EvView view,
EvLinkAction action 
)

Definition at line 9385 of file ev-view.c.

9387 {
9388  clear_link_selected (view);
9389 
9391 
9392  view->link_selected = g_object_ref (action);
9394 }

+ Here is the caller graph for this function:

void ev_view_find_cancel ( EvView view)

Definition at line 8866 of file ev-view.c.

8867 {
8868  view->find_pages = NULL;
8869  view->find_page = -1;
8870  view->find_result = 0;
8871 
8872  if (!view->find_job)
8873  return;
8874 
8875  g_signal_handlers_disconnect_by_func (view->find_job, find_job_updated_cb, view);
8876  g_object_unref (view->find_job);
8877  view->find_job = NULL;
8878 }

+ Here is the caller graph for this function:

void ev_view_find_changed ( EvView view,
GList **  results,
gint  page 
)

Definition at line 8755 of file ev-view.c.

8756 {
8757  g_return_if_fail (view->current_page >= 0);
8758 
8759  view->find_pages = results;
8760  if (view->find_page == -1)
8761  view->find_page = view->current_page;
8762 
8763  if (view->jump_to_find_result == TRUE) {
8765  jump_to_find_result (view);
8766  }
8767 
8768  if (view->find_page == page)
8769  gtk_widget_queue_draw (GTK_WIDGET (view));
8770 }

+ Here is the caller graph for this function:

void ev_view_find_next ( EvView view)

Definition at line 8796 of file ev-view.c.

8797 {
8798  gint n_results;
8799 
8800  n_results = ev_view_find_get_n_results (view, view->find_page);
8801  view->find_result++;
8802 
8803  if (view->find_result >= n_results) {
8804  view->find_result = 0;
8806  } else if (view->find_page != view->current_page) {
8808  }
8809 
8810  jump_to_find_result (view);
8811  gtk_widget_queue_draw (GTK_WIDGET (view));
8812 }

+ Here is the caller graph for this function:

void ev_view_find_previous ( EvView view)

Definition at line 8815 of file ev-view.c.

8816 {
8817  view->find_result--;
8818 
8819  if (view->find_result < 0) {
8821  view->find_result = MAX (0, ev_view_find_get_n_results (view, view->find_page) - 1);
8822  } else if (view->find_page != view->current_page) {
8824  }
8825 
8826  jump_to_find_result (view);
8827  gtk_widget_queue_draw (GTK_WIDGET (view));
8828 }

+ Here is the caller graph for this function:

void ev_view_find_restart ( EvView view,
gint  page 
)

Definition at line 8782 of file ev-view.c.

8784 {
8785  if (!view->find_job)
8786  return;
8787 
8788  view->find_page = page;
8789  view->find_result = 0;
8791  jump_to_find_result (view);
8792  gtk_widget_queue_draw (GTK_WIDGET (view));
8793 }

+ Here is the caller graph for this function:

void ev_view_find_search_changed ( EvView view)

Definition at line 8851 of file ev-view.c.

8852 {
8853  /* search string has changed, focus on new search result */
8854  view->jump_to_find_result = TRUE;
8855  ev_view_find_cancel (view);
8856 }

+ Here is the caller graph for this function:

void ev_view_find_set_highlight_search ( EvView view,
gboolean  value 
)

Definition at line 8859 of file ev-view.c.

8860 {
8861  view->highlight_find_results = value;
8862  gtk_widget_queue_draw (GTK_WIDGET (view));
8863 }

+ Here is the caller graph for this function:

void ev_view_find_set_result ( EvView view,
gint  page,
gint  result 
)

Definition at line 8841 of file ev-view.c.

8842 {
8843  view->find_page = page;
8844  view->find_result = result;
8846  jump_to_find_result (view);
8847  gtk_widget_queue_draw (GTK_WIDGET (view));
8848 }

+ Here is the caller graph for this function:

void ev_view_find_started ( EvView view,
EvJobFind job 
)

ev_view_find_started: : :

Since: 3.6

Definition at line 8733 of file ev-view.c.

8734 {
8735  if (view->find_job == job)
8736  return;
8737 
8738  ev_view_find_cancel (view);
8739  view->find_job = g_object_ref (job);
8740  view->find_page = view->current_page;
8741  view->find_result = 0;
8742 
8743  g_signal_connect (job, "updated", G_CALLBACK (find_job_updated_cb), view);
8744 }

+ Here is the caller graph for this function:

void ev_view_focus_annotation ( EvView view,
EvMapping annot_mapping 
)

Definition at line 3417 of file ev-view.c.

3419 {
3420 
3421  if (!EV_IS_DOCUMENT_ANNOTATIONS (view->document))
3422  return;
3423 
3424  _ev_view_set_focused_element (view, annot_mapping,
3425  ev_annotation_get_page_index (EV_ANNOTATION (annot_mapping->data)));
3426 }

+ Here is the caller graph for this function:

gboolean ev_view_get_allow_links_change_zoom ( EvView view)

Definition at line 9472 of file ev-view.c.

9473 {
9474  g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
9475 
9476  return view->allow_links_change_zoom;
9477 }
gboolean ev_view_get_has_selection ( EvView view)

Definition at line 9235 of file ev-view.c.

9236 {
9237  return view->selection_info.selections != NULL;
9238 }

+ Here is the caller graph for this function:

gboolean ev_view_get_page_extents ( EvView view,
gint  page,
GdkRectangle *  page_area,
GtkBorder *  border 
)

Definition at line 1250 of file ev-view.c.

1254 {
1255  GtkWidget *widget;
1256  int width, height;
1257  GtkAllocation allocation;
1258 
1259  widget = GTK_WIDGET (view);
1260  gtk_widget_get_allocation (widget, &allocation);
1261 
1262  /* Get the size of the page */
1263  ev_view_get_page_size (view, page, &width, &height);
1264  compute_border (view, border);
1265  page_area->width = width + border->left + border->right;
1266  page_area->height = height + border->top + border->bottom;
1267 
1268  if (view->continuous) {
1269  gint max_width;
1270  gint x, y;
1271  gboolean odd_left;
1272 
1273  ev_view_get_max_page_size (view, &max_width, NULL);
1274  max_width = max_width + border->left + border->right;
1275  /* Get the location of the bounding box */
1276  if (is_dual_page (view, &odd_left)) {
1277  x = view->spacing + ((page % 2 == !odd_left) ? 0 : 1) * (max_width + view->spacing);
1278  x = x + MAX (0, allocation.width - (max_width * 2 + view->spacing * 3)) / 2;
1279  if (page % 2 == !odd_left)
1280  x = x + (max_width - width - border->left - border->right);
1281  } else {
1282  x = view->spacing;
1283  x = x + MAX (0, allocation.width - (width + border->left + border->right + view->spacing * 2)) / 2;
1284  }
1285 
1286  get_page_y_offset (view, page, &y);
1287 
1288  page_area->x = x;
1289  page_area->y = y;
1290  } else {
1291  gint x, y;
1292  gboolean odd_left;
1293 
1294  if (is_dual_page (view, &odd_left)) {
1295  gint width_2, height_2;
1296  gint max_width = width;
1297  gint max_height = height;
1298  GtkBorder overall_border;
1299  gint other_page;
1300 
1301  other_page = (page % 2 == !odd_left) ? page + 1: page - 1;
1302 
1303  /* First, we get the bounding box of the two pages */
1304  if (other_page < ev_document_get_n_pages (view->document)
1305  && (0 <= other_page)) {
1306  ev_view_get_page_size (view, other_page,
1307  &width_2, &height_2);
1308  if (width_2 > width)
1309  max_width = width_2;
1310  if (height_2 > height)
1311  max_height = height_2;
1312  }
1313  compute_border (view, &overall_border);
1314 
1315  /* Find the offsets */
1316  x = view->spacing;
1317  y = view->spacing;
1318 
1319  /* Adjust for being the left or right page */
1320  if (page % 2 == !odd_left)
1321  x = x + max_width - width;
1322  else
1323  x = x + (max_width + overall_border.left + overall_border.right) + view->spacing;
1324 
1325  y = y + (max_height - height)/2;
1326 
1327  /* Adjust for extra allocation */
1328  x = x + MAX (0, allocation.width -
1329  ((max_width + overall_border.left + overall_border.right) * 2 + view->spacing * 3))/2;
1330  y = y + MAX (0, allocation.height - (height + view->spacing * 2))/2;
1331  } else {
1332  x = view->spacing;
1333  y = view->spacing;
1334 
1335  /* Adjust for extra allocation */
1336  x = x + MAX (0, allocation.width - (width + border->left + border->right + view->spacing * 2))/2;
1337  y = y + MAX (0, allocation.height - (height + border->top + border->bottom + view->spacing * 2))/2;
1338  }
1339 
1340  page_area->x = x;
1341  page_area->y = y;
1342  }
1343 
1344  return TRUE;
1345 }

+ Here is the caller graph for this function:

GType ev_view_get_type ( void  )
void ev_view_handle_link ( EvView view,
EvLink link 
)

Definition at line 1965 of file ev-view.c.

1966 {
1967  EvLinkAction *action = NULL;
1968  EvLinkActionType type;
1969 
1970  action = ev_link_get_action (link);
1971  if (!action)
1972  return;
1973 
1974  type = ev_link_action_get_action_type (action);
1975 
1976  switch (type) {
1978  EvLinkDest *dest;
1979 
1980  g_signal_emit (view, signals[SIGNAL_HANDLE_LINK], 0, link);
1981 
1982  dest = ev_link_action_get_dest (action);
1983  ev_view_goto_dest (view, dest);
1984  }
1985  break;
1987  GList *show, *hide, *toggle;
1988  GList *l;
1989  EvDocumentLayers *document_layers;
1990 
1991  document_layers = EV_DOCUMENT_LAYERS (view->document);
1992 
1993  show = ev_link_action_get_show_list (action);
1994  for (l = show; l; l = g_list_next (l)) {
1995  ev_document_layers_show_layer (document_layers, EV_LAYER (l->data));
1996  }
1997 
1998  hide = ev_link_action_get_hide_list (action);
1999  for (l = hide; l; l = g_list_next (l)) {
2000  ev_document_layers_hide_layer (document_layers, EV_LAYER (l->data));
2001  }
2002 
2003  toggle = ev_link_action_get_toggle_list (action);
2004  for (l = toggle; l; l = g_list_next (l)) {
2005  EvLayer *layer = EV_LAYER (l->data);
2006 
2007  if (ev_document_layers_layer_is_visible (document_layers, layer)) {
2008  ev_document_layers_hide_layer (document_layers, layer);
2009  } else {
2010  ev_document_layers_show_layer (document_layers, layer);
2011  }
2012  }
2013 
2014  g_signal_emit (view, signals[SIGNAL_LAYERS_CHANGED], 0);
2015  ev_view_reload (view);
2016  }
2017  break;
2022  g_signal_emit (view, signals[SIGNAL_EXTERNAL_LINK], 0, action);
2023  break;
2024  }
2025 }

+ Here is the caller graph for this function:

void ev_view_hide_cursor ( EvView view)

Definition at line 9420 of file ev-view.c.

9421 {
9423 }
void ev_view_highlight_forward_search ( EvView view,
EvSourceLink link 
)

Definition at line 8882 of file ev-view.c.

8884 {
8885  EvMapping *mapping;
8886  gint page;
8887  GdkRectangle view_rect;
8888 
8889  if (!ev_document_has_synctex (view->document))
8890  return;
8891 
8892  mapping = ev_document_synctex_forward_search (view->document, link);
8893  if (!mapping)
8894  return;
8895 
8896  if (view->synctex_result)
8897  g_free (view->synctex_result);
8898  view->synctex_result = mapping;
8899 
8900  page = GPOINTER_TO_INT (mapping->data);
8901  ev_document_model_set_page (view->model, page);
8902 
8903  _ev_view_transform_doc_rect_to_view_rect (view, page, &mapping->area, &view_rect);
8904  ensure_rectangle_is_visible (view, &view_rect);
8905  gtk_widget_queue_draw (GTK_WIDGET (view));
8906 }
gboolean ev_view_is_caret_navigation_enabled ( EvView view)

ev_view_get_caret_navigation_enabled: : a EvView

Returns: whether caret navigation mode is enabled for the document

Since: 3.10

Definition at line 3819 of file ev-view.c.

3820 {
3821  g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
3822 
3823  return view->caret_enabled;
3824 }

+ Here is the caller graph for this function:

gboolean ev_view_is_loading ( EvView view)

ev_view_is_loading: :

Returns: TRUE iff the view is currently loading a document

Since: 3.8

Definition at line 7956 of file ev-view.c.

7957 {
7958  return view->loading;
7959 }

+ Here is the caller graph for this function:

GtkWidget* ev_view_new ( void  )

Definition at line 7858 of file ev-view.c.

7859 {
7860  GtkWidget *view;
7861 
7862  view = g_object_new (EV_TYPE_VIEW, NULL);
7863 
7864  return view;
7865 }

+ Here is the caller graph for this function:

gboolean ev_view_next_page ( EvView view)

Definition at line 9432 of file ev-view.c.

9433 {
9434  gint next_page;
9435 
9436  g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
9437 
9438  next_page = go_to_next_page (view, view->current_page);
9439  if (next_page == -1)
9440  return FALSE;
9441 
9442  ev_document_model_set_page (view->model, next_page);
9443 
9444  return TRUE;
9445 }

+ Here is the caller graph for this function:

gboolean ev_view_previous_page ( EvView view)

Definition at line 9448 of file ev-view.c.

9449 {
9450  gint prev_page;
9451 
9452  g_return_val_if_fail (EV_IS_VIEW (view), FALSE);
9453 
9454  prev_page = go_to_previous_page (view, view->current_page);
9455  if (prev_page == -1)
9456  return FALSE;
9457 
9458  ev_document_model_set_page (view->model, prev_page);
9459 
9460  return TRUE;
9461 }

+ Here is the caller graph for this function:

void ev_view_reload ( EvView view)

Definition at line 8292 of file ev-view.c.

8293 {
8296 }

+ Here is the caller graph for this function:

void ev_view_remove_annotation ( EvView view,
EvAnnotation annot 
)

Definition at line 3458 of file ev-view.c.

3460 {
3461  guint page;
3462 
3463  g_return_if_fail (EV_IS_VIEW (view));
3464  g_return_if_fail (EV_IS_ANNOTATION (annot));
3465 
3466  g_object_ref (annot);
3467 
3468  page = ev_annotation_get_page_index (annot);
3469 
3470  if (EV_IS_ANNOTATION_MARKUP (annot))
3471  ev_view_remove_window_child_for_annot (view, page, annot);
3472  if (view->annot_window_map != NULL)
3473  g_hash_table_remove (view->annot_window_map, annot);
3474 
3475  _ev_view_set_focused_element (view, NULL, -1);
3476 
3479  annot);
3481 
3483 
3484  /* FIXME: only redraw the annot area */
3485  ev_view_reload_page (view, page, NULL);
3486 
3487  g_signal_emit (view, signals[SIGNAL_ANNOT_REMOVED], 0, annot);
3488  g_object_unref (annot);
3489 }

+ Here is the caller graph for this function:

void ev_view_scroll ( EvView view,
GtkScrollType  scroll,
gboolean  horizontal 
)

ev_view_scroll: : a EvView : :

Deprecated: 3.10

Definition at line 991 of file ev-view.c.

994 {
995  GtkAdjustment *adjustment;
996  double value, increment;
997  gdouble upper, lower;
998  gdouble page_size;
999  gdouble step_increment;
1000  gboolean first_page = FALSE;
1001  gboolean last_page = FALSE;
1002 
1003  if (view->key_binding_handled)
1004  return;
1005 
1006  view->jump_to_find_result = FALSE;
1007 
1008  if ((!horizontal && ev_view_page_fits (view, GTK_ORIENTATION_VERTICAL)) ||
1009  (horizontal && ev_view_page_fits (view, GTK_ORIENTATION_HORIZONTAL))) {
1010  switch (scroll) {
1011  case GTK_SCROLL_PAGE_BACKWARD:
1012  case GTK_SCROLL_STEP_BACKWARD:
1013  ev_view_previous_page (view);
1014  break;
1015  case GTK_SCROLL_PAGE_FORWARD:
1016  case GTK_SCROLL_STEP_FORWARD:
1017  ev_view_next_page (view);
1018  break;
1019  case GTK_SCROLL_START:
1020  ev_view_first_page (view);
1021  break;
1022  case GTK_SCROLL_END:
1023  ev_view_last_page (view);
1024  break;
1025  default:
1026  break;
1027  }
1028  return;
1029  }
1030 
1031  /* Assign values for increment and vertical adjustment */
1032  adjustment = horizontal ? view->hadjustment : view->vadjustment;
1033  value = gtk_adjustment_get_value (adjustment);
1034  upper = gtk_adjustment_get_upper (adjustment);
1035  lower = gtk_adjustment_get_lower (adjustment);
1036  page_size = gtk_adjustment_get_page_size (adjustment);
1037  step_increment = gtk_adjustment_get_step_increment (adjustment);
1038 
1039  /* Assign boolean for first and last page */
1040  if (view->current_page == 0)
1041  first_page = TRUE;
1042  if (view->current_page == ev_document_get_n_pages (view->document) - 1)
1043  last_page = TRUE;
1044 
1045  switch (scroll) {
1046  case GTK_SCROLL_PAGE_BACKWARD:
1047  /* Do not jump backwards if at the first page */
1048  if (value == lower && first_page) {
1049  /* Do nothing */
1050  /* At the top of a page, assign the upper bound limit of previous page */
1051  } else if (value == lower) {
1052  value = upper - page_size;
1053  ev_view_previous_page (view);
1054  /* Jump to the top */
1055  } else {
1056  increment = compute_scroll_increment (view, GTK_SCROLL_PAGE_BACKWARD);
1057  value = MAX (value - increment, lower);
1058  }
1059  break;
1060  case GTK_SCROLL_PAGE_FORWARD:
1061  /* Do not jump forward if at the last page */
1062  if (value == (upper - page_size) && last_page) {
1063  /* Do nothing */
1064  /* At the bottom of a page, assign the lower bound limit of next page */
1065  } else if (value == (upper - page_size)) {
1066  value = 0;
1067  ev_view_next_page (view);
1068  /* Jump to the bottom */
1069  } else {
1070  increment = compute_scroll_increment (view, GTK_SCROLL_PAGE_FORWARD);
1071  value = MIN (value + increment, upper - page_size);
1072  }
1073  break;
1074  case GTK_SCROLL_STEP_BACKWARD:
1075  value -= step_increment;
1076  break;
1077  case GTK_SCROLL_STEP_FORWARD:
1078  value += step_increment;
1079  break;
1080  case GTK_SCROLL_STEP_DOWN:
1081  value -= step_increment / 10;
1082  break;
1083  case GTK_SCROLL_STEP_UP:
1084  value += step_increment / 10;
1085  break;
1086  case GTK_SCROLL_START:
1087  value = lower;
1088  if (!first_page)
1089  ev_view_first_page (view);
1090  break;
1091  case GTK_SCROLL_END:
1092  value = upper - page_size;
1093  if (!last_page)
1094  ev_view_last_page (view);
1095  /* Changing pages causes the top to be shown. Here we want the bottom shown. */
1096  view->pending_point.y = value;
1097  break;
1098  default:
1099  break;
1100  }
1101 
1102  value = CLAMP (value, lower, upper - page_size);
1103 
1104  gtk_adjustment_set_value (adjustment, value);
1105 }

+ Here is the caller graph for this function:

void ev_view_select_all ( EvView view)

Definition at line 9205 of file ev-view.c.

9206 {
9207  GList *selections = NULL;
9208  int n_pages, i;
9209 
9210  /* Disable selection on rotated pages for the 0.4.0 series */
9211  if (view->rotation != 0)
9212  return;
9213 
9214  n_pages = ev_document_get_n_pages (view->document);
9215  for (i = 0; i < n_pages; i++) {
9216  gdouble width, height;
9217  EvViewSelection *selection;
9218 
9219  get_doc_page_size (view, i, &width, &height);
9220 
9221  selection = g_slice_new0 (EvViewSelection);
9222  selection->page = i;
9223  selection->style = EV_SELECTION_STYLE_GLYPH;
9224  selection->rect.x1 = selection->rect.y1 = 0;
9225  selection->rect.x2 = width;
9226  selection->rect.y2 = height;
9227 
9228  selections = g_list_prepend (selections, selection);
9229  }
9230 
9231  merge_selection_region (view, g_list_reverse (selections));
9232 }

+ Here is the caller graph for this function:

void ev_view_set_allow_links_change_zoom ( EvView view,
gboolean  allowed 
)

Definition at line 9464 of file ev-view.c.

9465 {
9466  g_return_if_fail (EV_IS_VIEW (view));
9467 
9468  view->allow_links_change_zoom = allowed;
9469 }

+ Here is the caller graph for this function:

void ev_view_set_caret_cursor_position ( EvView view,
guint  page,
guint  offset 
)

Definition at line 3835 of file ev-view.c.

3838 {
3839  g_return_if_fail (EV_IS_VIEW (view));
3840  g_return_if_fail (EV_IS_DOCUMENT (view->document));
3841  g_return_if_fail (page < ev_document_get_n_pages (view->document));
3842 
3843  if (view->cursor_page != page || view->cursor_offset != offset) {
3844  view->cursor_page = page;
3845  view->cursor_offset = offset;
3846 
3847  g_signal_emit (view, signals[SIGNAL_CURSOR_MOVED], 0,
3848  view->cursor_page, view->cursor_offset);
3849 
3850  if (view->caret_enabled && cursor_is_in_visible_page (view))
3851  gtk_widget_queue_draw (GTK_WIDGET (view));
3852  }
3853 }

+ Here is the caller graph for this function:

void ev_view_set_caret_navigation_enabled ( EvView view,
gboolean  enabled 
)

ev_view_set_caret_navigation_enabled: : a EvView : whether to enable caret navigation mode

Enables or disables caret navigation mode for the document.

Since: 3.10

Definition at line 3793 of file ev-view.c.

3795 {
3796  g_return_if_fail (EV_IS_VIEW (view));
3797 
3798  if (view->caret_enabled != enabled) {
3799  view->caret_enabled = enabled;
3800  if (view->caret_enabled)
3802 
3804 
3805  if (cursor_is_in_visible_page (view))
3806  gtk_widget_queue_draw (GTK_WIDGET (view));
3807  }
3808 }

+ Here is the caller graph for this function:

EV_DEPRECATED void ev_view_set_loading ( EvView view,
gboolean  loading 
)

ev_view_set_loading: : :

Deprecated: 3.8

Definition at line 7937 of file ev-view.c.

7939 {
7940  if (view->loading == loading)
7941  return;
7942 
7943  view->loading = loading;
7944  g_object_notify (G_OBJECT (view), "is-loading");
7945 }

+ Here is the caller graph for this function:

void ev_view_set_model ( EvView view,
EvDocumentModel model 
)

Definition at line 8213 of file ev-view.c.

8215 {
8216  g_return_if_fail (EV_IS_VIEW (view));
8217  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
8218 
8219  if (model == view->model)
8220  return;
8221 
8222  if (view->model) {
8223  g_signal_handlers_disconnect_by_data (view->model, view);
8224  g_object_unref (view->model);
8225  }
8226  view->model = g_object_ref (model);
8227 
8228  /* Initialize view from model */
8231  view->scale = ev_document_model_get_scale (view->model);
8235  ev_view_document_changed_cb (view->model, NULL, view);
8236 
8237  g_signal_connect (view->model, "notify::document",
8238  G_CALLBACK (ev_view_document_changed_cb),
8239  view);
8240  g_signal_connect (view->model, "notify::rotation",
8241  G_CALLBACK (ev_view_rotation_changed_cb),
8242  view);
8243  g_signal_connect (view->model, "notify::inverted-colors",
8245  view);
8246  g_signal_connect (view->model, "notify::sizing-mode",
8247  G_CALLBACK (ev_view_sizing_mode_changed_cb),
8248  view);
8249  g_signal_connect (view->model, "notify::page-layout",
8250  G_CALLBACK (ev_view_page_layout_changed_cb),
8251  view);
8252  g_signal_connect (view->model, "notify::scale",
8253  G_CALLBACK (ev_view_scale_changed_cb),
8254  view);
8255  g_signal_connect (view->model, "notify::min-scale",
8256  G_CALLBACK (ev_view_min_scale_changed_cb),
8257  view);
8258  g_signal_connect (view->model, "notify::max-scale",
8259  G_CALLBACK (ev_view_max_scale_changed_cb),
8260  view);
8261  g_signal_connect (view->model, "notify::continuous",
8262  G_CALLBACK (ev_view_continuous_changed_cb),
8263  view);
8264  g_signal_connect (view->model, "notify::dual-odd-left",
8265  G_CALLBACK (ev_view_dual_odd_left_changed_cb),
8266  view);
8267  g_signal_connect (view->model, "notify::fullscreen",
8268  G_CALLBACK (ev_view_fullscreen_changed_cb),
8269  view);
8270  g_signal_connect (view->model, "page-changed",
8271  G_CALLBACK (ev_view_page_changed_cb),
8272  view);
8273 
8274  if (view->accessible)
8276  view->model);
8277 }

+ Here is the caller graph for this function:

void ev_view_set_page_cache_size ( EvView view,
gsize  cache_size 
)

ev_view_set_page_cache_size: : EvView instance : size in bytes

Sets the maximum size in bytes that will be used to cache rendered pages. Use 0 to disable caching rendered pages.

Note that this limit doesn't affect the current visible page range, which will always be rendered. In order to limit the total memory used you have to use ev_document_model_set_max_scale() too.

Definition at line 7916 of file ev-view.c.

7918 {
7919  if (view->pixbuf_cache_size == cache_size)
7920  return;
7921 
7922  view->pixbuf_cache_size = cache_size;
7923  if (view->pixbuf_cache)
7924  ev_pixbuf_cache_set_max_size (view->pixbuf_cache, cache_size);
7925 
7926  view_update_scale_limits (view);
7927 }

+ Here is the caller graph for this function:

void ev_view_show_cursor ( EvView view)

Definition at line 9426 of file ev-view.c.

9427 {
9429 }
gboolean ev_view_supports_caret_navigation ( EvView view)

ev_view_supports_caret_navigation: : a EvView

Returns: whether the document supports caret navigation

Since: 3.10

Definition at line 3769 of file ev-view.c.

3770 {
3771  EvDocumentTextInterface *iface;
3772 
3773  if (!view->document || !EV_IS_DOCUMENT_TEXT (view->document))
3774  return FALSE;
3775 
3776  iface = EV_DOCUMENT_TEXT_GET_IFACE (view->document);
3777  if (!iface->get_text_layout || !iface->get_text)
3778  return FALSE;
3779 
3780  return TRUE;
3781 }

+ Here is the caller graph for this function:

void ev_view_zoom_in ( EvView view)

Definition at line 8325 of file ev-view.c.

8326 {
8327  ev_view_zoom (view, ZOOM_IN_FACTOR);
8328 }

+ Here is the caller graph for this function:

void ev_view_zoom_out ( EvView view)

Definition at line 8331 of file ev-view.c.

8332 {
8333  ev_view_zoom (view, ZOOM_OUT_FACTOR);
8334 }

+ Here is the caller graph for this function: