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

Go to the source code of this file.

Data Structures

struct  _EvLinkAction
 
struct  _EvLinkActionClass
 
struct  _EvLinkActionPrivate
 

Macros

#define EV_LINK_ACTION_GET_PRIVATE(object)   (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK_ACTION, EvLinkActionPrivate))
 

Enumerations

enum  {
  PROP_0, PROP_TYPE, PROP_DEST, PROP_URI,
  PROP_FILENAME, PROP_PARAMS, PROP_NAME, PROP_SHOW_LIST,
  PROP_HIDE_LIST, PROP_TOGGLE_LIST
}
 

Functions

EvLinkActionType ev_link_action_get_action_type (EvLinkAction *self)
 
EvLinkDestev_link_action_get_dest (EvLinkAction *self)
 
const gchar * ev_link_action_get_uri (EvLinkAction *self)
 
const gchar * ev_link_action_get_filename (EvLinkAction *self)
 
const gchar * ev_link_action_get_params (EvLinkAction *self)
 
const gchar * ev_link_action_get_name (EvLinkAction *self)
 
GList * ev_link_action_get_show_list (EvLinkAction *self)
 
GList * ev_link_action_get_hide_list (EvLinkAction *self)
 
GList * ev_link_action_get_toggle_list (EvLinkAction *self)
 
static void ev_link_action_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *param_spec)
 
static void ev_link_action_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *param_spec)
 
static void ev_link_action_finalize (GObject *object)
 
static void ev_link_action_init (EvLinkAction *ev_link_action)
 
static void ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
 
EvLinkActionev_link_action_new_dest (EvLinkDest *dest)
 
EvLinkActionev_link_action_new_remote (EvLinkDest *dest, const gchar *filename)
 
EvLinkActionev_link_action_new_external_uri (const gchar *uri)
 
EvLinkActionev_link_action_new_launch (const gchar *filename, const gchar *params)
 
EvLinkActionev_link_action_new_named (const gchar *name)
 
EvLinkActionev_link_action_new_layers_state (GList *show_list, GList *hide_list, GList *toggle_list)
 
gboolean ev_link_action_equal (EvLinkAction *a, EvLinkAction *b)
 

Macro Definition Documentation

#define EV_LINK_ACTION_GET_PRIVATE (   object)    (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK_ACTION, EvLinkActionPrivate))

Definition at line 62 of file ev-link-action.c.

Enumeration Type Documentation

anonymous enum
Enumerator
PROP_0 
PROP_TYPE 
PROP_DEST 
PROP_URI 
PROP_FILENAME 
PROP_PARAMS 
PROP_NAME 
PROP_SHOW_LIST 
PROP_HIDE_LIST 
PROP_TOGGLE_LIST 

Definition at line 25 of file ev-link-action.c.

25  {
26  PROP_0,
27  PROP_TYPE,
28  PROP_DEST,
29  PROP_URI,
32  PROP_NAME,
36 };

Function Documentation

static void ev_link_action_class_init ( EvLinkActionClass ev_link_action_class)
static

Definition at line 318 of file ev-link-action.c.

319 {
320  GObjectClass *g_object_class;
321 
322  g_object_class = G_OBJECT_CLASS (ev_link_action_class);
323 
324  g_object_class->set_property = ev_link_action_set_property;
325  g_object_class->get_property = ev_link_action_get_property;
326 
327  g_object_class->finalize = ev_link_action_finalize;
328 
329  g_type_class_add_private (g_object_class, sizeof (EvLinkActionPrivate));
330 
331  g_object_class_install_property (g_object_class,
332  PROP_TYPE,
333  g_param_spec_enum ("type",
334  "Action Type",
335  "The link action type",
336  EV_TYPE_LINK_ACTION_TYPE,
338  G_PARAM_READWRITE |
339  G_PARAM_CONSTRUCT_ONLY |
340  G_PARAM_STATIC_STRINGS));
341  g_object_class_install_property (g_object_class,
342  PROP_DEST,
343  g_param_spec_object ("dest",
344  "Action destination",
345  "The link action destination",
347  G_PARAM_READWRITE |
348  G_PARAM_CONSTRUCT_ONLY |
349  G_PARAM_STATIC_STRINGS));
350  g_object_class_install_property (g_object_class,
351  PROP_URI,
352  g_param_spec_string ("uri",
353  "Link Action URI",
354  "The link action URI",
355  NULL,
356  G_PARAM_READWRITE |
357  G_PARAM_CONSTRUCT_ONLY |
358  G_PARAM_STATIC_STRINGS));
359  g_object_class_install_property (g_object_class,
361  g_param_spec_string ("filename",
362  "Filename",
363  "The link action filename",
364  NULL,
365  G_PARAM_READWRITE |
366  G_PARAM_CONSTRUCT_ONLY |
367  G_PARAM_STATIC_STRINGS));
368  g_object_class_install_property (g_object_class,
369  PROP_PARAMS,
370  g_param_spec_string ("params",
371  "Params",
372  "The link action params",
373  NULL,
374  G_PARAM_READWRITE |
375  G_PARAM_CONSTRUCT_ONLY |
376  G_PARAM_STATIC_STRINGS));
377  g_object_class_install_property (g_object_class,
378  PROP_NAME,
379  g_param_spec_string ("name",
380  "Name",
381  "The link action name",
382  NULL,
383  G_PARAM_READWRITE |
384  G_PARAM_CONSTRUCT_ONLY |
385  G_PARAM_STATIC_STRINGS));
386  g_object_class_install_property (g_object_class,
388  g_param_spec_pointer ("show-list",
389  "ShowList",
390  "The list of layers that should be shown",
391  G_PARAM_READWRITE |
392  G_PARAM_CONSTRUCT_ONLY |
393  G_PARAM_STATIC_STRINGS));
394  g_object_class_install_property (g_object_class,
396  g_param_spec_pointer ("hide-list",
397  "HideList",
398  "The list of layers that should be hidden",
399  G_PARAM_READWRITE |
400  G_PARAM_CONSTRUCT_ONLY |
401  G_PARAM_STATIC_STRINGS));
402  g_object_class_install_property (g_object_class,
404  g_param_spec_pointer ("toggle-list",
405  "ToggleList",
406  "The list of layers that should be toggled",
407  G_PARAM_READWRITE |
408  G_PARAM_CONSTRUCT_ONLY |
409  G_PARAM_STATIC_STRINGS));
410 }
gboolean ev_link_action_equal ( EvLinkAction a,
EvLinkAction b 
)

ev_link_action_equal: : a EvLinkAction : a EvLinkAction

Checks whether and are equal.

Returns: TRUE iff and are equal

Since: 3.8

Definition at line 494 of file ev-link-action.c.

496 {
497  g_return_val_if_fail (EV_IS_LINK_ACTION (a), FALSE);
498  g_return_val_if_fail (EV_IS_LINK_ACTION (b), FALSE);
499 
500  if (a == b)
501  return TRUE;
502 
503  if (a->priv->type != b->priv->type)
504  return FALSE;
505 
506  switch (a->priv->type) {
508  return ev_link_dest_equal (a->priv->dest, b->priv->dest);
509 
511  return ev_link_dest_equal (a->priv->dest, b->priv->dest) &&
512  !g_strcmp0 (a->priv->filename, b->priv->filename);
513 
515  return !g_strcmp0 (a->priv->uri, b->priv->uri);
516 
518  return !g_strcmp0 (a->priv->filename, b->priv->filename) &&
519  !g_strcmp0 (a->priv->params, b->priv->params);
520 
522  return !g_strcmp0 (a->priv->name, b->priv->name);
523 
524  default:
525  return FALSE;
526  }
527 
528  return FALSE;
529 }

+ Here is the caller graph for this function:

static void ev_link_action_finalize ( GObject *  object)
static

Definition at line 256 of file ev-link-action.c.

257 {
258  EvLinkActionPrivate *priv;
259 
260  priv = EV_LINK_ACTION (object)->priv;
261 
262  g_clear_object (&priv->dest);
263 
264  if (priv->uri) {
265  g_free (priv->uri);
266  priv->uri = NULL;
267  }
268 
269  if (priv->filename) {
270  g_free (priv->filename);
271  priv->filename = NULL;
272  }
273 
274  if (priv->params) {
275  g_free (priv->params);
276  priv->params = NULL;
277  }
278 
279  if (priv->name) {
280  g_free (priv->name);
281  priv->name = NULL;
282  }
283 
284  if (priv->show_list) {
285  g_list_foreach (priv->show_list, (GFunc)g_object_unref, NULL);
286  g_list_free (priv->show_list);
287  priv->show_list = NULL;
288  }
289 
290  if (priv->hide_list) {
291  g_list_foreach (priv->hide_list, (GFunc)g_object_unref, NULL);
292  g_list_free (priv->hide_list);
293  priv->hide_list = NULL;
294  }
295 
296  if (priv->toggle_list) {
297  g_list_foreach (priv->toggle_list, (GFunc)g_object_unref, NULL);
298  g_list_free (priv->toggle_list);
299  priv->toggle_list = NULL;
300  }
301 
302  G_OBJECT_CLASS (ev_link_action_parent_class)->finalize (object);
303 }

+ Here is the caller graph for this function:

EvLinkActionType ev_link_action_get_action_type ( EvLinkAction self)

Definition at line 66 of file ev-link-action.c.

67 {
68  g_return_val_if_fail (EV_IS_LINK_ACTION (self), 0);
69 
70  return self->priv->type;
71 }

+ Here is the caller graph for this function:

EvLinkDest* ev_link_action_get_dest ( EvLinkAction self)

ev_link_action_get_dest: : an EvLinkAction

Returns: (transfer none): an EvLinkDest

Definition at line 80 of file ev-link-action.c.

81 {
82  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
83 
84  return self->priv->dest;
85 }

+ Here is the caller graph for this function:

const gchar* ev_link_action_get_filename ( EvLinkAction self)

Definition at line 96 of file ev-link-action.c.

97 {
98  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
99 
100  return self->priv->filename;
101 }

+ Here is the caller graph for this function:

GList* ev_link_action_get_hide_list ( EvLinkAction self)

ev_link_action_get_hide_list: : an EvLinkAction

Returns: (transfer none) (element-type EvLayer): a list of EvLayer objects

Definition at line 140 of file ev-link-action.c.

141 {
142  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
143 
144  return self->priv->hide_list;
145 }

+ Here is the caller graph for this function:

const gchar* ev_link_action_get_name ( EvLinkAction self)

Definition at line 112 of file ev-link-action.c.

113 {
114  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
115 
116  return self->priv->name;
117 }

+ Here is the caller graph for this function:

const gchar* ev_link_action_get_params ( EvLinkAction self)

Definition at line 104 of file ev-link-action.c.

105 {
106  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
107 
108  return self->priv->params;
109 }
static void ev_link_action_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  param_spec 
)
static

Definition at line 162 of file ev-link-action.c.

166 {
167  EvLinkAction *self;
168 
169  self = EV_LINK_ACTION (object);
170 
171  switch (prop_id) {
172  case PROP_TYPE:
173  g_value_set_enum (value, self->priv->type);
174  break;
175  case PROP_DEST:
176  g_value_set_object (value, self->priv->dest);
177  break;
178  case PROP_URI:
179  g_value_set_string (value, self->priv->uri);
180  break;
181  case PROP_FILENAME:
182  g_value_set_string (value, self->priv->filename);
183  break;
184  case PROP_PARAMS:
185  g_value_set_string (value, self->priv->params);
186  break;
187  case PROP_NAME:
188  g_value_set_string (value, self->priv->name);
189  break;
190  case PROP_SHOW_LIST:
191  g_value_set_pointer (value, self->priv->show_list);
192  break;
193  case PROP_HIDE_LIST:
194  g_value_set_pointer (value, self->priv->hide_list);
195  break;
196  case PROP_TOGGLE_LIST:
197  g_value_set_pointer (value, self->priv->toggle_list);
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:

GList* ev_link_action_get_show_list ( EvLinkAction self)

ev_link_action_get_show_list: : an EvLinkAction

Returns: (transfer none) (element-type EvLayer): a list of EvLayer objects

Definition at line 126 of file ev-link-action.c.

127 {
128  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
129 
130  return self->priv->show_list;
131 }

+ Here is the caller graph for this function:

GList* ev_link_action_get_toggle_list ( EvLinkAction self)

ev_link_action_get_toggle_list: : an EvLinkAction

Returns: (transfer none) (element-type EvLayer): a list of EvLayer objects

Definition at line 154 of file ev-link-action.c.

155 {
156  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
157 
158  return self->priv->toggle_list;
159 }

+ Here is the caller graph for this function:

const gchar* ev_link_action_get_uri ( EvLinkAction self)

Definition at line 88 of file ev-link-action.c.

89 {
90  g_return_val_if_fail (EV_IS_LINK_ACTION (self), NULL);
91 
92  return self->priv->uri;
93 }

+ Here is the caller graph for this function:

static void ev_link_action_init ( EvLinkAction ev_link_action)
static

Definition at line 306 of file ev-link-action.c.

307 {
308  ev_link_action->priv = EV_LINK_ACTION_GET_PRIVATE (ev_link_action);
309 
310  ev_link_action->priv->dest = NULL;
311  ev_link_action->priv->uri = NULL;
312  ev_link_action->priv->filename = NULL;
313  ev_link_action->priv->params = NULL;
314  ev_link_action->priv->name = NULL;
315 }
EvLinkAction* ev_link_action_new_dest ( EvLinkDest dest)

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

414 {
415  return EV_LINK_ACTION (g_object_new (EV_TYPE_LINK_ACTION,
416  "dest", dest,
418  NULL));
419 }

+ Here is the caller graph for this function:

EvLinkAction* ev_link_action_new_external_uri ( const gchar *  uri)

Definition at line 433 of file ev-link-action.c.

434 {
435  return EV_LINK_ACTION (g_object_new (EV_TYPE_LINK_ACTION,
436  "uri", uri,
438  NULL));
439 }

+ Here is the caller graph for this function:

EvLinkAction* ev_link_action_new_launch ( const gchar *  filename,
const gchar *  params 
)

Definition at line 442 of file ev-link-action.c.

444 {
445  return EV_LINK_ACTION (g_object_new (EV_TYPE_LINK_ACTION,
446  "filename", filename,
447  "params", params,
449  NULL));
450 }

+ Here is the caller graph for this function:

EvLinkAction* ev_link_action_new_layers_state ( GList *  show_list,
GList *  hide_list,
GList *  toggle_list 
)

ev_link_action_new_layers_state: : (element-type EvLayer): a list of EvLayer objects : (element-type EvLayer): a list of EvLayer objects : (element-type EvLayer): a list of EvLayer objects

Returns: (transfer full): a new EvLinkAction

Definition at line 470 of file ev-link-action.c.

473 {
474  return EV_LINK_ACTION (g_object_new (EV_TYPE_LINK_ACTION,
475  "show-list", show_list,
476  "hide-list", hide_list,
477  "toggle-list", toggle_list,
479  NULL));
480 }

+ Here is the caller graph for this function:

EvLinkAction* ev_link_action_new_named ( const gchar *  name)

Definition at line 453 of file ev-link-action.c.

454 {
455  return EV_LINK_ACTION (g_object_new (EV_TYPE_LINK_ACTION,
456  "name", name,
458  NULL));
459 }

+ Here is the caller graph for this function:

EvLinkAction* ev_link_action_new_remote ( EvLinkDest dest,
const gchar *  filename 
)

Definition at line 422 of file ev-link-action.c.

424 {
425  return EV_LINK_ACTION (g_object_new (EV_TYPE_LINK_ACTION,
426  "dest", dest,
427  "filename", filename,
429  NULL));
430 }

+ Here is the caller graph for this function:

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

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

212 {
213  EvLinkAction *self = EV_LINK_ACTION (object);
214 
215  switch (prop_id) {
216  case PROP_TYPE:
217  self->priv->type = g_value_get_enum (value);
218  break;
219  case PROP_DEST:
220  self->priv->dest = g_value_dup_object (value);
221  break;
222  case PROP_URI:
223  g_free (self->priv->uri);
224  self->priv->uri = g_value_dup_string (value);
225  break;
226  case PROP_FILENAME:
227  g_free (self->priv->filename);
228  self->priv->filename = g_value_dup_string (value);
229  break;
230  case PROP_PARAMS:
231  g_free (self->priv->params);
232  self->priv->params = g_value_dup_string (value);
233  break;
234  case PROP_NAME:
235  g_free (self->priv->name);
236  self->priv->name = g_value_dup_string (value);
237  break;
238  case PROP_SHOW_LIST:
239  self->priv->show_list = g_value_get_pointer (value);
240  break;
241  case PROP_HIDE_LIST:
242  self->priv->hide_list = g_value_get_pointer (value);
243  break;
244  case PROP_TOGGLE_LIST:
245  self->priv->toggle_list = g_value_get_pointer (value);
246  break;
247  default:
248  G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
249  prop_id,
250  param_spec);
251  break;
252  }
253 }

+ Here is the caller graph for this function: