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-accessible.h File Reference
#include <gtk/gtk-a11y.h>
#include "ev-document-model.h"
+ Include dependency graph for ev-view-accessible.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvViewAccessible
 
struct  _EvViewAccessibleClass
 

Macros

#define EV_TYPE_VIEW_ACCESSIBLE   (ev_view_accessible_get_type ())
 
#define EV_VIEW_ACCESSIBLE(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_VIEW_ACCESSIBLE, EvViewAccessible))
 
#define EV_IS_VIEW_ACCESSIBLE(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_VIEW_ACCESSIBLE))
 

Typedefs

typedef struct _EvViewAccessible EvViewAccessible
 
typedef struct
_EvViewAccessibleClass 
EvViewAccessibleClass
 
typedef struct
_EvViewAccessiblePrivate 
EvViewAccessiblePrivate
 

Functions

GType ev_view_accessible_get_type (void)
 
AtkObject * ev_view_accessible_new (GtkWidget *widget)
 
void ev_view_accessible_set_model (EvViewAccessible *accessible, EvDocumentModel *model)
 
gint ev_view_accessible_get_n_pages (EvViewAccessible *accessible)
 
gint ev_view_accessible_get_relevant_page (EvViewAccessible *accessible)
 
void ev_view_accessible_set_page_range (EvViewAccessible *accessible, gint start, gint end)
 
void _transform_doc_rect_to_atk_rect (EvViewAccessible *accessible, gint page, EvRectangle *doc_rect, EvRectangle *atk_rect, AtkCoordType coord_type)
 
gboolean ev_view_accessible_is_doc_rect_showing (EvViewAccessible *accessible, gint page, EvRectangle *doc_rect)
 
void ev_view_accessible_set_focused_element (EvViewAccessible *accessible, EvMapping *new_focus, gint new_focus_page)
 
void ev_view_accessible_update_element_state (EvViewAccessible *accessible, EvMapping *element, gint element_page)
 

Macro Definition Documentation

#define EV_IS_VIEW_ACCESSIBLE (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EV_TYPE_VIEW_ACCESSIBLE))

Definition at line 33 of file ev-view-accessible.h.

#define EV_TYPE_VIEW_ACCESSIBLE   (ev_view_accessible_get_type ())

Definition at line 31 of file ev-view-accessible.h.

#define EV_VIEW_ACCESSIBLE (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), EV_TYPE_VIEW_ACCESSIBLE, EvViewAccessible))

Definition at line 32 of file ev-view-accessible.h.

Typedef Documentation

Definition at line 35 of file ev-view-accessible.h.

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

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

Function Documentation

void _transform_doc_rect_to_atk_rect ( EvViewAccessible accessible,
gint  page,
EvRectangle doc_rect,
EvRectangle atk_rect,
AtkCoordType  coord_type 
)

Definition at line 517 of file ev-view-accessible.c.

522 {
523  EvView *view;
524  GdkRectangle view_rect;
525  GtkWidget *widget, *toplevel;
526  gint x_widget, y_widget;
527 
528  view = EV_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible)));
529  _ev_view_transform_doc_rect_to_view_rect (view, page, doc_rect, &view_rect);
530  view_rect.x -= view->scroll_x;
531  view_rect.y -= view->scroll_y;
532 
533  widget = GTK_WIDGET (view);
534  toplevel = gtk_widget_get_toplevel (widget);
535  gtk_widget_translate_coordinates (widget, toplevel, 0, 0, &x_widget, &y_widget);
536  view_rect.x += x_widget;
537  view_rect.y += y_widget;
538 
539  if (coord_type == ATK_XY_SCREEN) {
540  gint x_window, y_window;
541  gdk_window_get_origin (gtk_widget_get_window (toplevel), &x_window, &y_window);
542  view_rect.x += x_window;
543  view_rect.y += y_window;
544  }
545 
546  atk_rect->x1 = view_rect.x;
547  atk_rect->y1 = view_rect.y;
548  atk_rect->x2 = view_rect.x + view_rect.width;
549  atk_rect->y2 = view_rect.y + view_rect.height;
550 }

+ Here is the caller graph for this function:

gint ev_view_accessible_get_n_pages ( EvViewAccessible accessible)

Definition at line 134 of file ev-view-accessible.c.

135 {
136  return self->priv->children == NULL ? 0 : self->priv->children->len;
137 }

+ Here is the caller graph for this function:

gint ev_view_accessible_get_relevant_page ( EvViewAccessible accessible)

Definition at line 505 of file ev-view-accessible.c.

506 {
507  EvView *view;
508 
509  g_return_val_if_fail (EV_IS_VIEW_ACCESSIBLE (accessible), -1);
510 
511  view = EV_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible)));
512 
513  return get_relevant_page (view);
514 }

+ Here is the caller graph for this function:

GType ev_view_accessible_get_type ( void  )
gboolean ev_view_accessible_is_doc_rect_showing ( EvViewAccessible accessible,
gint  page,
EvRectangle doc_rect 
)

Definition at line 553 of file ev-view-accessible.c.

556 {
557  EvView *view;
558  GdkRectangle view_rect;
559  GtkAllocation allocation;
560  gint x, y;
561  gboolean hidden;
562 
563  view = EV_VIEW (gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible)));
564  if (page < view->start_page || page > view->end_page)
565  return FALSE;
566 
567  gtk_widget_get_allocation (GTK_WIDGET (view), &allocation);
568  x = gtk_adjustment_get_value (view->hadjustment);
569  y = gtk_adjustment_get_value (view->vadjustment);
570 
571  _ev_view_transform_doc_rect_to_view_rect (view, page, doc_rect, &view_rect);
572  hidden = view_rect.x + view_rect.width < x || view_rect.x > x + allocation.width ||
573  view_rect.y + view_rect.height < y || view_rect.y > y + allocation.height;
574 
575  return !hidden;
576 }

+ Here is the caller graph for this function:

AtkObject* ev_view_accessible_new ( GtkWidget *  widget)

Definition at line 473 of file ev-view-accessible.c.

474 {
475  AtkObject *accessible;
476  EvView *view;
477 
478  g_return_val_if_fail (EV_IS_VIEW (widget), NULL);
479 
480  accessible = g_object_new (EV_TYPE_VIEW_ACCESSIBLE, NULL);
481  atk_object_initialize (accessible, widget);
482 
483  g_signal_connect (widget, "cursor-moved",
484  G_CALLBACK (ev_view_accessible_cursor_moved),
485  accessible);
486  g_signal_connect (widget, "selection-changed",
488  accessible);
489  g_signal_connect (widget, "focus-in-event",
491  accessible);
492  g_signal_connect (widget, "focus-out-event",
494  accessible);
495 
496  view = EV_VIEW (widget);
497  if (view->model)
499  view->model);
500 
501  return accessible;
502 }

+ Here is the caller graph for this function:

void ev_view_accessible_set_focused_element ( EvViewAccessible accessible,
EvMapping new_focus,
gint  new_focus_page 
)

Definition at line 607 of file ev-view-accessible.c.

610 {
611  EvPageAccessible *page;
612 
613  if (accessible->priv->focused_element) {
614  atk_object_notify_state_change (accessible->priv->focused_element, ATK_STATE_FOCUSED, FALSE);
615  accessible->priv->focused_element = NULL;
616  }
617 
618  if (!new_focus || new_focus_page == -1)
619  return;
620 
621  page = g_ptr_array_index (accessible->priv->children, new_focus_page);
622  accessible->priv->focused_element = ev_page_accessible_get_accessible_for_mapping (page, new_focus);
623  if (accessible->priv->focused_element)
624  atk_object_notify_state_change (accessible->priv->focused_element, ATK_STATE_FOCUSED, TRUE);
625 }

+ Here is the caller graph for this function:

void ev_view_accessible_set_model ( EvViewAccessible accessible,
EvDocumentModel model 
)

Definition at line 427 of file ev-view-accessible.c.

429 {
430  EvViewAccessiblePrivate* priv = accessible->priv;
431 
432  if (priv->model == model)
433  return;
434 
435  if (priv->model) {
436  g_signal_handlers_disconnect_by_data (priv->model, accessible);
437  g_object_unref (priv->model);
438  }
439 
440  priv->model = g_object_ref (model);
441 
442  document_changed_cb (model, NULL, accessible);
443  g_signal_connect (priv->model, "page-changed",
444  G_CALLBACK (page_changed_cb),
445  accessible);
446  g_signal_connect (priv->model, "notify::document",
447  G_CALLBACK (document_changed_cb),
448  accessible);
449 }

+ Here is the caller graph for this function:

void ev_view_accessible_set_page_range ( EvViewAccessible accessible,
gint  start,
gint  end 
)

Definition at line 579 of file ev-view-accessible.c.

582 {
583  gint i;
584  AtkObject *page;
585 
586  g_return_if_fail (EV_IS_VIEW_ACCESSIBLE (accessible));
587 
588  for (i = accessible->priv->start_page; i <= accessible->priv->end_page; i++) {
589  if (i < start || i > end) {
590  page = g_ptr_array_index (accessible->priv->children, i);
591  atk_object_notify_state_change (page, ATK_STATE_SHOWING, FALSE);
592  }
593  }
594 
595  for (i = start; i <= end; i++) {
596  if (i < accessible->priv->start_page || i > accessible->priv->end_page) {
597  page = g_ptr_array_index (accessible->priv->children, i);
598  atk_object_notify_state_change (page, ATK_STATE_SHOWING, TRUE);
599  }
600  }
601 
602  accessible->priv->start_page = start;
603  accessible->priv->end_page = end;
604 }

+ Here is the caller graph for this function:

void ev_view_accessible_update_element_state ( EvViewAccessible accessible,
EvMapping element,
gint  element_page 
)

Definition at line 628 of file ev-view-accessible.c.

631 {
632  EvPageAccessible *page;
633 
634  page = g_ptr_array_index (accessible->priv->children, element_page);
636 }

+ Here is the caller graph for this function: