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-image-accessible.c File Reference
#include <config.h>
#include "ev-image-accessible.h"
#include "ev-view-private.h"
+ Include dependency graph for ev-image-accessible.c:

Go to the source code of this file.

Data Structures

struct  _EvImageAccessiblePrivate
 

Functions

static void ev_image_accessible_component_iface_init (AtkComponentIface *iface)
 
static void ev_image_accessible_image_iface_init (AtkImageIface *iface)
 
 G_DEFINE_TYPE_WITH_CODE (EvImageAccessible, ev_image_accessible, ATK_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE, ev_image_accessible_image_iface_init))
 
static void ev_image_accessible_get_extents (AtkComponent *atk_component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type)
 
static const gchar * ev_image_accessible_get_image_description (AtkImage *image)
 
static const gchar * ev_image_accessible_get_image_locale (AtkImage *atk_image)
 
static void ev_image_accessible_get_image_size (AtkImage *atk_image, int *width, int *height)
 
static void ev_image_accessible_get_image_position (AtkImage *atk_image, gint *x, gint *y, AtkCoordType coord_type)
 
static AtkStateSet * ev_image_accessible_ref_state_set (AtkObject *atk_object)
 
static AtkObject * ev_image_accessible_get_parent (AtkObject *atk_object)
 
static void ev_image_accessible_finalize (GObject *object)
 
static void ev_image_accessible_class_init (EvImageAccessibleClass *klass)
 
static void ev_image_accessible_init (EvImageAccessible *image)
 
EvImageAccessibleev_image_accessible_new (EvPageAccessible *page, EvImage *image, EvRectangle *area)
 

Function Documentation

static void ev_image_accessible_class_init ( EvImageAccessibleClass klass)
static

Definition at line 166 of file ev-image-accessible.c.

167 {
168  GObjectClass *object_class = G_OBJECT_CLASS (klass);
169  AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
170 
171  object_class->finalize = ev_image_accessible_finalize;
172  atk_class->get_parent = ev_image_accessible_get_parent;
173  atk_class->ref_state_set = ev_image_accessible_ref_state_set;
174 
175  g_type_class_add_private (klass, sizeof (EvImageAccessiblePrivate));
176 }
static void ev_image_accessible_component_iface_init ( AtkComponentIface *  iface)
static

Definition at line 73 of file ev-image-accessible.c.

74 {
75  iface->get_extents = ev_image_accessible_get_extents;
76 }
static void ev_image_accessible_finalize ( GObject *  object)
static

Definition at line 156 of file ev-image-accessible.c.

157 {
158  EvImageAccessiblePrivate *priv = EV_IMAGE_ACCESSIBLE (object)->priv;
159 
160  g_object_unref (priv->image);
161 
162  G_OBJECT_CLASS (ev_image_accessible_parent_class)->finalize (object);
163 }

+ Here is the caller graph for this function:

static void ev_image_accessible_get_extents ( AtkComponent *  atk_component,
gint *  x,
gint *  y,
gint *  width,
gint *  height,
AtkCoordType  coord_type 
)
static

Definition at line 56 of file ev-image-accessible.c.

62 {
63  EvRectangle atk_rect;
64 
65  ev_image_accessible_get_atk_rect (ATK_OBJECT (atk_component), coord_type, &atk_rect);
66  *x = atk_rect.x1;
67  *y = atk_rect.y1;
68  *width = atk_rect.x2 - atk_rect.x1;
69  *height = atk_rect.y2 - atk_rect.y1;
70 }

+ Here is the caller graph for this function:

static const gchar* ev_image_accessible_get_image_description ( AtkImage *  image)
static

Definition at line 79 of file ev-image-accessible.c.

80 {
81  /* This will be obtainable for tagged PDFs */
82  return NULL;
83 }

+ Here is the caller graph for this function:

static const gchar* ev_image_accessible_get_image_locale ( AtkImage *  atk_image)
static

Definition at line 86 of file ev-image-accessible.c.

87 {
88  /* This will be obtainable for tagged PDFs */
89  return NULL;
90 }

+ Here is the caller graph for this function:

static void ev_image_accessible_get_image_position ( AtkImage *  atk_image,
gint *  x,
gint *  y,
AtkCoordType  coord_type 
)
static

Definition at line 105 of file ev-image-accessible.c.

109 {
110  EvRectangle atk_rect;
111 
112  ev_image_accessible_get_atk_rect (ATK_OBJECT (atk_image), ATK_XY_WINDOW, &atk_rect);
113  *x = atk_rect.x1;
114  *y = atk_rect.y1;
115 }

+ Here is the caller graph for this function:

static void ev_image_accessible_get_image_size ( AtkImage *  atk_image,
int *  width,
int *  height 
)
static

Definition at line 93 of file ev-image-accessible.c.

96 {
97  EvRectangle atk_rect;
98 
99  ev_image_accessible_get_atk_rect (ATK_OBJECT (atk_image), ATK_XY_WINDOW, &atk_rect);
100  *width = atk_rect.x2 - atk_rect.x1;
101  *height = atk_rect.y2 - atk_rect.y1;
102 }

+ Here is the caller graph for this function:

static AtkObject* ev_image_accessible_get_parent ( AtkObject *  atk_object)
static

Definition at line 148 of file ev-image-accessible.c.

149 {
150  EvImageAccessiblePrivate *priv = EV_IMAGE_ACCESSIBLE (atk_object)->priv;
151 
152  return ATK_OBJECT (priv->page);
153 }

+ Here is the caller graph for this function:

static void ev_image_accessible_image_iface_init ( AtkImageIface *  iface)
static

Definition at line 187 of file ev-image-accessible.c.

188 {
189  iface->get_image_description = ev_image_accessible_get_image_description;
190  iface->get_image_locale = ev_image_accessible_get_image_locale;
191  iface->get_image_position = ev_image_accessible_get_image_position;
192  iface->get_image_size = ev_image_accessible_get_image_size;
193 }
static void ev_image_accessible_init ( EvImageAccessible image)
static

Definition at line 179 of file ev-image-accessible.c.

180 {
181  atk_object_set_role (ATK_OBJECT (image), ATK_ROLE_IMAGE);
182 
183  image->priv = G_TYPE_INSTANCE_GET_PRIVATE (image, EV_TYPE_IMAGE_ACCESSIBLE, EvImageAccessiblePrivate);
184 }
EvImageAccessible* ev_image_accessible_new ( EvPageAccessible page,
EvImage image,
EvRectangle area 
)

Definition at line 196 of file ev-image-accessible.c.

199 {
200  EvImageAccessible *atk_image;
201 
202  atk_image = g_object_new (EV_TYPE_IMAGE_ACCESSIBLE, NULL);
203  atk_image->priv->page = page;
204  atk_image->priv->image = g_object_ref (image);
205  atk_image->priv->area = *area;
206 
207  return EV_IMAGE_ACCESSIBLE (atk_image);
208 }

+ Here is the caller graph for this function:

static AtkStateSet* ev_image_accessible_ref_state_set ( AtkObject *  atk_object)
static

Definition at line 118 of file ev-image-accessible.c.

119 {
120  AtkStateSet *state_set;
121  AtkStateSet *copy_set;
122  AtkStateSet *page_accessible_state_set;
123  EvImageAccessible *self;
124  EvViewAccessible *view_accessible;
125  gint page;
126 
127  self = EV_IMAGE_ACCESSIBLE (atk_object);
128  state_set = ATK_OBJECT_CLASS (ev_image_accessible_parent_class)->ref_state_set (atk_object);
129  atk_state_set_clear_states (state_set);
130 
131  page_accessible_state_set = atk_object_ref_state_set (ATK_OBJECT (self->priv->page));
132  copy_set = atk_state_set_or_sets (state_set, page_accessible_state_set);
133  atk_state_set_remove_state (copy_set, ATK_STATE_FOCUSABLE);
134  atk_state_set_remove_state (copy_set, ATK_STATE_FOCUSED);
135 
136  view_accessible = ev_page_accessible_get_view_accessible (self->priv->page);
137  page = ev_page_accessible_get_page (self->priv->page);
138  if (!ev_view_accessible_is_doc_rect_showing (view_accessible, page, &self->priv->area))
139  atk_state_set_remove_state (copy_set, ATK_STATE_SHOWING);
140 
141  g_object_unref (state_set);
142  g_object_unref (page_accessible_state_set);
143 
144  return copy_set;
145 }

+ Here is the caller graph for this function:

G_DEFINE_TYPE_WITH_CODE ( EvImageAccessible  ,
ev_image_accessible  ,
ATK_TYPE_OBJECT  ,
G_IMPLEMENT_INTERFACE(ATK_TYPE_IMAGE, ev_image_accessible_image_iface_init  
)

Definition at line 36 of file ev-image-accessible.c.

44 {
45  EvImageAccessible *image;
46  EvViewAccessible *view_accessible;
47  gint page;
48 
49  image = EV_IMAGE_ACCESSIBLE (atk_object);
50  view_accessible = ev_page_accessible_get_view_accessible (image->priv->page);
51  page = ev_page_accessible_get_page (image->priv->page);
52  _transform_doc_rect_to_atk_rect (view_accessible, page, &image->priv->area, atk_rect, coord_type);
53 }