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-link-dest.c File Reference
#include <config.h>
#include "ev-link-dest.h"
#include "ev-document-type-builtins.h"
+ Include dependency graph for ev-link-dest.c:

Go to the source code of this file.

Data Structures

struct  _EvLinkDest
 
struct  _EvLinkDestClass
 
struct  _EvLinkDestPrivate
 

Macros

#define EV_LINK_DEST_GET_PRIVATE(object)   (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK_DEST, EvLinkDestPrivate))
 

Enumerations

enum  {
  PROP_0, PROP_TYPE, PROP_PAGE, PROP_LEFT,
  PROP_TOP, PROP_BOTTOM, PROP_RIGHT, PROP_ZOOM,
  PROP_CHANGE, PROP_NAMED, PROP_PAGE_LABEL
}
 
enum  EvDestChange { EV_DEST_CHANGE_TOP = 1 << 0, EV_DEST_CHANGE_LEFT = 1 << 1, EV_DEST_CHANGE_ZOOM = 1 << 2 }
 

Functions

EvLinkDestType ev_link_dest_get_dest_type (EvLinkDest *self)
 
gint ev_link_dest_get_page (EvLinkDest *self)
 
gdouble ev_link_dest_get_top (EvLinkDest *self, gboolean *change_top)
 
gdouble ev_link_dest_get_left (EvLinkDest *self, gboolean *change_left)
 
gdouble ev_link_dest_get_bottom (EvLinkDest *self)
 
gdouble ev_link_dest_get_right (EvLinkDest *self)
 
gdouble ev_link_dest_get_zoom (EvLinkDest *self, gboolean *change_zoom)
 
const gchar * ev_link_dest_get_named_dest (EvLinkDest *self)
 
const gchar * ev_link_dest_get_page_label (EvLinkDest *self)
 
static void ev_link_dest_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *param_spec)
 
static void ev_link_dest_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *param_spec)
 
static void ev_link_dest_finalize (GObject *object)
 
static void ev_link_dest_init (EvLinkDest *ev_link_dest)
 
static void ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
 
EvLinkDestev_link_dest_new_page (gint page)
 
EvLinkDestev_link_dest_new_xyz (gint page, gdouble left, gdouble top, gdouble zoom, gboolean change_left, gboolean change_top, gboolean change_zoom)
 
EvLinkDestev_link_dest_new_fit (gint page)
 
EvLinkDestev_link_dest_new_fith (gint page, gdouble top, gboolean change_top)
 
EvLinkDestev_link_dest_new_fitv (gint page, gdouble left, gboolean change_left)
 
EvLinkDestev_link_dest_new_fitr (gint page, gdouble left, gdouble bottom, gdouble right, gdouble top)
 
EvLinkDestev_link_dest_new_named (const gchar *named_dest)
 
EvLinkDestev_link_dest_new_page_label (const gchar *page_label)
 
gboolean ev_link_dest_equal (EvLinkDest *a, EvLinkDest *b)
 

Macro Definition Documentation

#define EV_LINK_DEST_GET_PRIVATE (   object)    (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK_DEST, EvLinkDestPrivate))

Definition at line 71 of file ev-link-dest.c.

Enumeration Type Documentation

anonymous enum
Enumerator
PROP_0 
PROP_TYPE 
PROP_PAGE 
PROP_LEFT 
PROP_TOP 
PROP_BOTTOM 
PROP_RIGHT 
PROP_ZOOM 
PROP_CHANGE 
PROP_NAMED 
PROP_PAGE_LABEL 

Definition at line 26 of file ev-link-dest.c.

26  {
27  PROP_0,
28  PROP_TYPE,
29  PROP_PAGE,
30  PROP_LEFT,
31  PROP_TOP,
33  PROP_RIGHT,
34  PROP_ZOOM,
36  PROP_NAMED,
38 };
Enumerator
EV_DEST_CHANGE_TOP 
EV_DEST_CHANGE_LEFT 
EV_DEST_CHANGE_ZOOM 

Definition at line 40 of file ev-link-dest.c.

40  {
41  EV_DEST_CHANGE_TOP = 1 << 0,
42  EV_DEST_CHANGE_LEFT = 1 << 1,
43  EV_DEST_CHANGE_ZOOM = 1 << 2
44 } EvDestChange;

Function Documentation

static void ev_link_dest_class_init ( EvLinkDestClass ev_link_dest_class)
static

Definition at line 282 of file ev-link-dest.c.

283 {
284  GObjectClass *g_object_class;
285 
286  g_object_class = G_OBJECT_CLASS (ev_link_dest_class);
287 
288  g_object_class->set_property = ev_link_dest_set_property;
289  g_object_class->get_property = ev_link_dest_get_property;
290 
291  g_object_class->finalize = ev_link_dest_finalize;
292 
293  g_type_class_add_private (g_object_class, sizeof (EvLinkDestPrivate));
294 
295  g_object_class_install_property (g_object_class,
296  PROP_TYPE,
297  g_param_spec_enum ("type",
298  "Dest Type",
299  "The destination type",
300  EV_TYPE_LINK_DEST_TYPE,
302  G_PARAM_READWRITE |
303  G_PARAM_CONSTRUCT_ONLY |
304  G_PARAM_STATIC_STRINGS));
305  g_object_class_install_property (g_object_class,
306  PROP_PAGE,
307  g_param_spec_int ("page",
308  "Dest Page",
309  "The destination page",
310  -1,
311  G_MAXINT,
312  0,
313  G_PARAM_READWRITE |
314  G_PARAM_CONSTRUCT_ONLY |
315  G_PARAM_STATIC_STRINGS));
316  g_object_class_install_property (g_object_class,
317  PROP_LEFT,
318  g_param_spec_double ("left",
319  "Left coordinate",
320  "The left coordinate",
321  -G_MAXDOUBLE,
322  G_MAXDOUBLE,
323  0,
324  G_PARAM_READWRITE |
325  G_PARAM_CONSTRUCT_ONLY |
326  G_PARAM_STATIC_STRINGS));
327  g_object_class_install_property (g_object_class,
328  PROP_TOP,
329  g_param_spec_double ("top",
330  "Top coordinate",
331  "The top coordinate",
332  -G_MAXDOUBLE,
333  G_MAXDOUBLE,
334  0,
335  G_PARAM_READWRITE |
336  G_PARAM_CONSTRUCT_ONLY |
337  G_PARAM_STATIC_STRINGS));
338  g_object_class_install_property (g_object_class,
339  PROP_BOTTOM,
340  g_param_spec_double ("bottom",
341  "Bottom coordinate",
342  "The bottom coordinate",
343  -G_MAXDOUBLE,
344  G_MAXDOUBLE,
345  0,
346  G_PARAM_READWRITE |
347  G_PARAM_CONSTRUCT_ONLY |
348  G_PARAM_STATIC_STRINGS));
349  g_object_class_install_property (g_object_class,
350  PROP_RIGHT,
351  g_param_spec_double ("right",
352  "Right coordinate",
353  "The right coordinate",
354  -G_MAXDOUBLE,
355  G_MAXDOUBLE,
356  0,
357  G_PARAM_READWRITE |
358  G_PARAM_CONSTRUCT_ONLY |
359  G_PARAM_STATIC_STRINGS));
360 
361  g_object_class_install_property (g_object_class,
362  PROP_ZOOM,
363  g_param_spec_double ("zoom",
364  "Zoom",
365  "Zoom",
366  0,
367  G_MAXDOUBLE,
368  0,
369  G_PARAM_READWRITE |
370  G_PARAM_CONSTRUCT_ONLY |
371  G_PARAM_STATIC_STRINGS));
372  g_object_class_install_property (g_object_class,
373  PROP_CHANGE,
374  g_param_spec_uint ("change",
375  "Change",
376  "Wether top, left, and zoom should be changed",
377  0,
378  G_MAXUINT,
379  0,
380  G_PARAM_READWRITE |
381  G_PARAM_CONSTRUCT_ONLY |
382  G_PARAM_STATIC_STRINGS));
383  g_object_class_install_property (g_object_class,
384  PROP_NAMED,
385  g_param_spec_string ("named",
386  "Named destination",
387  "The named destination",
388  NULL,
389  G_PARAM_READWRITE |
390  G_PARAM_CONSTRUCT_ONLY |
391  G_PARAM_STATIC_STRINGS));
392  g_object_class_install_property (g_object_class,
394  g_param_spec_string ("page-label",
395  "Label of the page",
396  "The label of the destination page",
397  NULL,
398  G_PARAM_READWRITE |
399  G_PARAM_CONSTRUCT_ONLY |
400  G_PARAM_STATIC_STRINGS));
401 }
gboolean ev_link_dest_equal ( EvLinkDest a,
EvLinkDest b 
)

ev_link_dest_equal: : a EvLinkDest : a EvLinkDest

Checks whether and are equal.

Returns: TRUE iff and are equal

Since: 3.8

Definition at line 535 of file ev-link-dest.c.

537 {
538  g_return_val_if_fail (EV_IS_LINK_DEST (a), FALSE);
539  g_return_val_if_fail (EV_IS_LINK_DEST (b), FALSE);
540 
541  if (a == b)
542  return TRUE;
543 
544  if (a->priv->type != b->priv->type)
545  return FALSE;
546 
547  switch (a->priv->type) {
549  return a->priv->page == b->priv->page;
550 
552  return a->priv->page == b->priv->page &&
553  a->priv->left == b->priv->left &&
554  a->priv->top == b->priv->top &&
555  a->priv->zoom == b->priv->zoom &&
556  a->priv->change == b->priv->change;
557 
559  return a->priv->page == b->priv->page;
560 
562  return a->priv->page == b->priv->page &&
563  a->priv->top == b->priv->top &&
564  a->priv->change == b->priv->change;
565 
567  return a->priv->page == b->priv->page &&
568  a->priv->left == b->priv->left &&
569  a->priv->change == b->priv->change;
570 
572  return a->priv->page == b->priv->page &&
573  a->priv->left == b->priv->left &&
574  a->priv->top == b->priv->top &&
575  a->priv->right == b->priv->right &&
576  a->priv->bottom == b->priv->bottom &&
577  a->priv->change == b->priv->change;
578 
580  return !g_strcmp0 (a->priv->named, b->priv->named);
581 
583  return !g_strcmp0 (a->priv->page_label, b->priv->page_label);
584 
585  default:
586  return FALSE;
587  }
588 
589  return FALSE;
590 }

+ Here is the caller graph for this function:

static void ev_link_dest_finalize ( GObject *  object)
static

Definition at line 255 of file ev-link-dest.c.

256 {
257  EvLinkDestPrivate *priv;
258 
259  priv = EV_LINK_DEST (object)->priv;
260 
261  if (priv->named) {
262  g_free (priv->named);
263  priv->named = NULL;
264  }
265  if (priv->page_label) {
266  g_free (priv->page_label);
267  priv->page_label = NULL;
268  }
269 
270  G_OBJECT_CLASS (ev_link_dest_parent_class)->finalize (object);
271 }

+ Here is the caller graph for this function:

gdouble ev_link_dest_get_bottom ( EvLinkDest self)

Definition at line 115 of file ev-link-dest.c.

116 {
117  g_return_val_if_fail (EV_IS_LINK_DEST (self), 0);
118 
119  return self->priv->bottom;
120 }

+ Here is the caller graph for this function:

EvLinkDestType ev_link_dest_get_dest_type ( EvLinkDest self)

Definition at line 75 of file ev-link-dest.c.

76 {
77  g_return_val_if_fail (EV_IS_LINK_DEST (self), 0);
78 
79  return self->priv->type;
80 }

+ Here is the caller graph for this function:

gdouble ev_link_dest_get_left ( EvLinkDest self,
gboolean *  change_left 
)

Definition at line 103 of file ev-link-dest.c.

105 {
106  g_return_val_if_fail (EV_IS_LINK_DEST (self), 0);
107 
108  if (change_left)
109  *change_left = (self->priv->change & EV_DEST_CHANGE_LEFT);
110 
111  return self->priv->left;
112 }

+ Here is the caller graph for this function:

const gchar* ev_link_dest_get_named_dest ( EvLinkDest self)

Definition at line 143 of file ev-link-dest.c.

144 {
145  g_return_val_if_fail (EV_IS_LINK_DEST (self), NULL);
146 
147  return self->priv->named;
148 }

+ Here is the caller graph for this function:

gint ev_link_dest_get_page ( EvLinkDest self)

Definition at line 83 of file ev-link-dest.c.

84 {
85  g_return_val_if_fail (EV_IS_LINK_DEST (self), -1);
86 
87  return self->priv->page;
88 }

+ Here is the caller graph for this function:

const gchar* ev_link_dest_get_page_label ( EvLinkDest self)

Definition at line 151 of file ev-link-dest.c.

152 {
153  g_return_val_if_fail (EV_IS_LINK_DEST (self), NULL);
154 
155  return self->priv->page_label;
156 }

+ Here is the caller graph for this function:

static void ev_link_dest_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  param_spec 
)
static

Definition at line 159 of file ev-link-dest.c.

163 {
164  EvLinkDest *self;
165 
166  self = EV_LINK_DEST (object);
167 
168  switch (prop_id) {
169  case PROP_TYPE:
170  g_value_set_enum (value, self->priv->type);
171  break;
172  case PROP_PAGE:
173  g_value_set_int (value, self->priv->page);
174  break;
175  case PROP_TOP:
176  g_value_set_double (value, self->priv->top);
177  break;
178  case PROP_LEFT:
179  g_value_set_double (value, self->priv->left);
180  break;
181  case PROP_BOTTOM:
182  g_value_set_double (value, self->priv->bottom);
183  break;
184  case PROP_RIGHT:
185  g_value_set_double (value, self->priv->left);
186  break;
187  case PROP_ZOOM:
188  g_value_set_double (value, self->priv->zoom);
189  break;
190  case PROP_CHANGE:
191  g_value_set_uint (value, self->priv->change);
192  break;
193  case PROP_NAMED:
194  g_value_set_string (value, self->priv->named);
195  break;
196  case PROP_PAGE_LABEL:
197  g_value_set_string (value, self->priv->page_label);
198  break;
199  default:
200  G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
201  prop_id,
202  param_spec);
203  break;
204  }
205 }

+ Here is the caller graph for this function:

gdouble ev_link_dest_get_right ( EvLinkDest self)

Definition at line 123 of file ev-link-dest.c.

124 {
125  g_return_val_if_fail (EV_IS_LINK_DEST (self), 0);
126 
127  return self->priv->right;
128 }

+ Here is the caller graph for this function:

gdouble ev_link_dest_get_top ( EvLinkDest self,
gboolean *  change_top 
)

Definition at line 91 of file ev-link-dest.c.

93 {
94  g_return_val_if_fail (EV_IS_LINK_DEST (self), 0);
95 
96  if (change_top)
97  *change_top = (self->priv->change & EV_DEST_CHANGE_TOP);
98 
99  return self->priv->top;
100 }

+ Here is the caller graph for this function:

gdouble ev_link_dest_get_zoom ( EvLinkDest self,
gboolean *  change_zoom 
)

Definition at line 131 of file ev-link-dest.c.

133 {
134  g_return_val_if_fail (EV_IS_LINK_DEST (self), 0);
135 
136  if (change_zoom)
137  *change_zoom = (self->priv->change & EV_DEST_CHANGE_ZOOM);
138 
139  return self->priv->zoom;
140 }

+ Here is the caller graph for this function:

static void ev_link_dest_init ( EvLinkDest ev_link_dest)
static

Definition at line 274 of file ev-link-dest.c.

275 {
276  ev_link_dest->priv = EV_LINK_DEST_GET_PRIVATE (ev_link_dest);
277 
278  ev_link_dest->priv->named = NULL;
279 }
EvLinkDest* ev_link_dest_new_fit ( gint  page)

Definition at line 441 of file ev-link-dest.c.

442 {
443  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
444  "page", page,
445  "type", EV_LINK_DEST_TYPE_FIT,
446  NULL));
447 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_fith ( gint  page,
gdouble  top,
gboolean  change_top 
)

Definition at line 450 of file ev-link-dest.c.

453 {
454  EvDestChange change = 0;
455 
456  if (change_top)
457  change |= EV_DEST_CHANGE_TOP;
458 
459  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
460  "page", page,
461  "type", EV_LINK_DEST_TYPE_FITH,
462  "top", top,
463  "change", change,
464  NULL));
465 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_fitr ( gint  page,
gdouble  left,
gdouble  bottom,
gdouble  right,
gdouble  top 
)

Definition at line 486 of file ev-link-dest.c.

491 {
493 
494  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
495  "page", page,
496  "type", EV_LINK_DEST_TYPE_FITR,
497  "left", left,
498  "bottom", bottom,
499  "right", right,
500  "top", top,
501  "change", change,
502  NULL));
503 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_fitv ( gint  page,
gdouble  left,
gboolean  change_left 
)

Definition at line 468 of file ev-link-dest.c.

471 {
472  EvDestChange change = 0;
473 
474  if (change_left)
475  change |= EV_DEST_CHANGE_LEFT;
476 
477  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
478  "page", page,
479  "type", EV_LINK_DEST_TYPE_FITV,
480  "left", left,
481  "change", change,
482  NULL));
483 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_named ( const gchar *  named_dest)

Definition at line 506 of file ev-link-dest.c.

507 {
508  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
509  "named", named_dest,
510  "type", EV_LINK_DEST_TYPE_NAMED,
511  NULL));
512 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_page ( gint  page)

Definition at line 404 of file ev-link-dest.c.

405 {
406  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
407  "page", page,
408  "type", EV_LINK_DEST_TYPE_PAGE,
409  NULL));
410 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_page_label ( const gchar *  page_label)

Definition at line 515 of file ev-link-dest.c.

516 {
517  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
518  "page_label", page_label,
520  NULL));
521 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_dest_new_xyz ( gint  page,
gdouble  left,
gdouble  top,
gdouble  zoom,
gboolean  change_left,
gboolean  change_top,
gboolean  change_zoom 
)

Definition at line 413 of file ev-link-dest.c.

420 {
421  EvDestChange change = 0;
422 
423  if (change_left)
424  change |= EV_DEST_CHANGE_LEFT;
425  if (change_top)
426  change |= EV_DEST_CHANGE_TOP;
427  if (change_zoom)
428  change |= EV_DEST_CHANGE_ZOOM;
429 
430  return EV_LINK_DEST (g_object_new (EV_TYPE_LINK_DEST,
431  "page", page,
432  "type", EV_LINK_DEST_TYPE_XYZ,
433  "left", left,
434  "top", top,
435  "zoom", zoom,
436  "change", change,
437  NULL));
438 }

+ Here is the caller graph for this function:

static void ev_link_dest_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  param_spec 
)
static

Definition at line 208 of file ev-link-dest.c.

212 {
213  EvLinkDest *self = EV_LINK_DEST (object);
214 
215  switch (prop_id) {
216  case PROP_TYPE:
217  self->priv->type = g_value_get_enum (value);
218  break;
219  case PROP_PAGE:
220  self->priv->page = g_value_get_int (value);
221  break;
222  case PROP_TOP:
223  self->priv->top = g_value_get_double (value);
224  break;
225  case PROP_LEFT:
226  self->priv->left = g_value_get_double (value);
227  break;
228  case PROP_BOTTOM:
229  self->priv->bottom = g_value_get_double (value);
230  break;
231  case PROP_RIGHT:
232  self->priv->right = g_value_get_double (value);
233  break;
234  case PROP_ZOOM:
235  self->priv->zoom = g_value_get_double (value);
236  break;
237  case PROP_CHANGE:
238  self->priv->change = g_value_get_uint (value);
239  break;
240  case PROP_NAMED:
241  self->priv->named = g_value_dup_string (value);
242  break;
243  case PROP_PAGE_LABEL:
244  self->priv->page_label = g_value_dup_string (value);
245  break;
246  default:
247  G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
248  prop_id,
249  param_spec);
250  break;
251  }
252 }

+ Here is the caller graph for this function: