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

Go to the source code of this file.

Macros

#define EV_TYPE_MAPPING_LIST   (ev_mapping_list_get_type())
 

Typedefs

typedef typedefG_BEGIN_DECLS
struct _EvMappingList 
EvMappingList
 

Functions

GType ev_mapping_list_get_type (void) G_GNUC_CONST
 
EvMappingListev_mapping_list_new (guint page, GList *list, GDestroyNotify data_destroy_func)
 
EvMappingListev_mapping_list_ref (EvMappingList *mapping_list)
 
void ev_mapping_list_unref (EvMappingList *mapping_list)
 
guint ev_mapping_list_get_page (EvMappingList *mapping_list)
 
GList * ev_mapping_list_get_list (EvMappingList *mapping_list)
 
void ev_mapping_list_remove (EvMappingList *mapping_list, EvMapping *mapping)
 
EvMappingev_mapping_list_find (EvMappingList *mapping_list, gconstpointer data)
 
EvMappingev_mapping_list_find_custom (EvMappingList *mapping_list, gconstpointer data, GCompareFunc func)
 
EvMappingev_mapping_list_get (EvMappingList *mapping_list, gdouble x, gdouble y)
 
gpointer ev_mapping_list_get_data (EvMappingList *mapping_list, gdouble x, gdouble y)
 
EvMappingev_mapping_list_nth (EvMappingList *mapping_list, guint n)
 
guint ev_mapping_list_length (EvMappingList *mapping_list)
 

Macro Definition Documentation

#define EV_TYPE_MAPPING_LIST   (ev_mapping_list_get_type())

Definition at line 34 of file ev-mapping-list.h.

Typedef Documentation

typedef typedefG_BEGIN_DECLS struct _EvMappingList EvMappingList

Definition at line 32 of file ev-mapping-list.h.

Function Documentation

EvMapping* ev_mapping_list_find ( EvMappingList mapping_list,
gconstpointer  data 
)

ev_mapping_list_find: : an EvMappingList : mapping data to find

Returns: (transfer none): an EvMapping

Definition at line 46 of file ev-mapping-list.c.

48 {
49  GList *list;
50 
51  for (list = mapping_list->list; list; list = list->next) {
52  EvMapping *mapping = list->data;
53 
54  if (mapping->data == data)
55  return mapping;
56  }
57 
58  return NULL;
59 }

+ Here is the caller graph for this function:

EvMapping* ev_mapping_list_find_custom ( EvMappingList mapping_list,
gconstpointer  data,
GCompareFunc  func 
)

ev_mapping_list_find_custom: : an EvMappingList : mapping data to find : (scope call): function to use for equality check

Returns: (transfer none): an EvMapping

Definition at line 70 of file ev-mapping-list.c.

73 {
74  GList *list;
75 
76  for (list = mapping_list->list; list; list = list->next) {
77  EvMapping *mapping = list->data;
78 
79  if (!func (mapping->data, data))
80  return mapping;
81  }
82 
83  return NULL;
84 }
EvMapping* ev_mapping_list_get ( EvMappingList mapping_list,
gdouble  x,
gdouble  y 
)

ev_mapping_list_get: : an EvMappingList : X coordinate : Y coordinate

Returns: (transfer none): the EvMapping in the list at coordinates (x, y)

Since: 3.12

Definition at line 113 of file ev-mapping-list.c.

116 {
117  GList *list;
118 
119  g_return_val_if_fail (mapping_list != NULL, NULL);
120 
121  for (list = mapping_list->list; list; list = list->next) {
122  EvMapping *mapping = list->data;
123 
124  if ((x >= mapping->area.x1) &&
125  (y >= mapping->area.y1) &&
126  (x <= mapping->area.x2) &&
127  (y <= mapping->area.y2)) {
128  return mapping;
129  }
130  }
131 
132  return NULL;
133 }

+ Here is the caller graph for this function:

gpointer ev_mapping_list_get_data ( EvMappingList mapping_list,
gdouble  x,
gdouble  y 
)

ev_mapping_list_get_data: : an EvMappingList : X coordinate : Y coordinate

Returns: (transfer none): the data of a mapping in the list at coordinates (x, y)

Definition at line 144 of file ev-mapping-list.c.

147 {
148  EvMapping *mapping;
149 
150  mapping = ev_mapping_list_get (mapping_list, x, y);
151  if (mapping)
152  return mapping->data;
153 
154  return NULL;
155 }

+ Here is the caller graph for this function:

GList* ev_mapping_list_get_list ( EvMappingList mapping_list)

ev_mapping_list_get_list: : an EvMappingList

Returns: (transfer none) (element-type EvMapping): the data for this mapping list

Definition at line 164 of file ev-mapping-list.c.

165 {
166  return mapping_list ? mapping_list->list : NULL;
167 }

+ Here is the caller graph for this function:

guint ev_mapping_list_get_page ( EvMappingList mapping_list)

Definition at line 186 of file ev-mapping-list.c.

187 {
188  return mapping_list->page;
189 }

+ Here is the caller graph for this function:

GType ev_mapping_list_get_type ( void  )
guint ev_mapping_list_length ( EvMappingList mapping_list)

Definition at line 192 of file ev-mapping-list.c.

193 {
194  g_return_val_if_fail (mapping_list != NULL, 0);
195 
196  return g_list_length (mapping_list->list);
197 }

+ Here is the caller graph for this function:

EvMappingList* ev_mapping_list_new ( guint  page,
GList *  list,
GDestroyNotify  data_destroy_func 
)

Definition at line 208 of file ev-mapping-list.c.

211 {
212  EvMappingList *mapping_list;
213 
214  g_return_val_if_fail (data_destroy_func != NULL, NULL);
215 
216  mapping_list = g_slice_new (EvMappingList);
217  mapping_list->page = page;
218  mapping_list->list = list;
219  mapping_list->data_destroy_func = data_destroy_func;
220  mapping_list->ref_count = 1;
221 
222  return mapping_list;
223 }

+ Here is the caller graph for this function:

EvMapping* ev_mapping_list_nth ( EvMappingList mapping_list,
guint  n 
)

ev_mapping_list_nth: : an EvMappingList
: the position to retrieve

Returns: (transfer none): the #Evmapping at position
in

Definition at line 94 of file ev-mapping-list.c.

96 {
97  g_return_val_if_fail (mapping_list != NULL, NULL);
98 
99  return (EvMapping *)g_list_nth_data (mapping_list->list, n);
100 }

+ Here is the caller graph for this function:

EvMappingList* ev_mapping_list_ref ( EvMappingList mapping_list)

Definition at line 226 of file ev-mapping-list.c.

227 {
228  g_return_val_if_fail (mapping_list != NULL, NULL);
229  g_return_val_if_fail (mapping_list->ref_count > 0, mapping_list);
230 
231  g_atomic_int_add (&mapping_list->ref_count, 1);
232 
233  return mapping_list;
234 }

+ Here is the caller graph for this function:

void ev_mapping_list_remove ( EvMappingList mapping_list,
EvMapping mapping 
)

ev_mapping_list_remove: : an EvMappingList : EvMapping to remove

Since: 3.14

Definition at line 177 of file ev-mapping-list.c.

179 {
180  mapping_list->list = g_list_remove (mapping_list->list, mapping);
181  mapping_list->data_destroy_func (mapping->data);
182  g_free (mapping);
183 }

+ Here is the caller graph for this function:

void ev_mapping_list_unref ( EvMappingList mapping_list)

Definition at line 245 of file ev-mapping-list.c.

246 {
247  g_return_if_fail (mapping_list != NULL);
248  g_return_if_fail (mapping_list->ref_count > 0);
249 
250  if (g_atomic_int_add (&mapping_list->ref_count, -1) - 1 == 0) {
251  g_list_foreach (mapping_list->list,
253  mapping_list->data_destroy_func);
254  g_list_free (mapping_list->list);
255  g_slice_free (EvMappingList, mapping_list);
256  }
257 }

+ Here is the caller graph for this function: