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-page-action.c File Reference
#include <string.h>
#include <stdlib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "ev-page-action.h"
#include "ev-page-action-widget.h"
+ Include dependency graph for ev-page-action.c:

Go to the source code of this file.

Data Structures

struct  _EvPageActionPrivate
 

Macros

#define EV_PAGE_ACTION_GET_PRIVATE(object)   (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_PAGE_ACTION, EvPageActionPrivate))
 

Enumerations

enum  { ACTIVATE_LINK, N_SIGNALS }
 
enum  { PROP_0, PROP_MODEL }
 

Functions

static void ev_page_action_init (EvPageAction *action)
 
static void ev_page_action_class_init (EvPageActionClass *class)
 
static GtkWidget * create_tool_item (GtkAction *action)
 
static void update_model (EvPageAction *page, GParamSpec *pspec, EvPageActionWidget *proxy)
 
static void activate_link_cb (EvPageActionWidget *proxy, EvLink *link, EvPageAction *action)
 
static void connect_proxy (GtkAction *action, GtkWidget *proxy)
 
static void ev_page_action_dispose (GObject *object)
 
static void ev_page_action_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
static void ev_page_action_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
void ev_page_action_set_model (EvPageAction *page, EvDocumentModel *model)
 
void ev_page_action_set_links_model (EvPageAction *page, GtkTreeModel *links_model)
 
void ev_page_action_grab_focus (EvPageAction *page_action)
 

Variables

static guint signals [N_SIGNALS] = {0, }
 

Macro Definition Documentation

#define EV_PAGE_ACTION_GET_PRIVATE (   object)    (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_PAGE_ACTION, EvPageActionPrivate))

Definition at line 54 of file ev-page-action.c.

Enumeration Type Documentation

anonymous enum
Enumerator
ACTIVATE_LINK 
N_SIGNALS 

Definition at line 44 of file ev-page-action.c.

45 {
47  N_SIGNALS
48 };
anonymous enum
Enumerator
PROP_0 
PROP_MODEL 

Definition at line 56 of file ev-page-action.c.

56  {
57  PROP_0,
59 };

Function Documentation

static void activate_link_cb ( EvPageActionWidget proxy,
EvLink link,
EvPageAction action 
)
static

Definition at line 78 of file ev-page-action.c.

79 {
80  g_signal_emit (action, signals[ACTIVATE_LINK], 0, link);
81 }

+ Here is the caller graph for this function:

static void connect_proxy ( GtkAction *  action,
GtkWidget *  proxy 
)
static

Definition at line 84 of file ev-page-action.c.

85 {
86  EvPageAction *page = EV_PAGE_ACTION (action);
87 
88  if (GTK_IS_TOOL_ITEM (proxy)) {
90  page->priv->doc_model);
91  g_signal_connect (proxy, "activate_link",
92  G_CALLBACK (activate_link_cb),
93  action);
94  g_signal_connect_object (action, "notify::model",
95  G_CALLBACK (update_model),
96  proxy, 0);
97  }
98 
99  GTK_ACTION_CLASS (ev_page_action_parent_class)->connect_proxy (action, proxy);
100 }

+ Here is the caller graph for this function:

static GtkWidget* create_tool_item ( GtkAction *  action)
static

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

63 {
64  GtkWidget *proxy;
65 
66  proxy = g_object_new (EV_TYPE_PAGE_ACTION_WIDGET, NULL);
67 
68  return proxy;
69 }

+ Here is the caller graph for this function:

static void ev_page_action_class_init ( EvPageActionClass class)
static

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

209 {
210  GObjectClass *object_class = G_OBJECT_CLASS (class);
211  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
212 
213  object_class->dispose = ev_page_action_dispose;
214  object_class->set_property = ev_page_action_set_property;
215  object_class->get_property = ev_page_action_get_property;
216 
217  action_class->toolbar_item_type = GTK_TYPE_TOOL_ITEM;
218  action_class->create_tool_item = create_tool_item;
219  action_class->connect_proxy = connect_proxy;
220 
221  signals[ACTIVATE_LINK] = g_signal_new ("activate_link",
222  G_OBJECT_CLASS_TYPE (object_class),
223  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
224  G_STRUCT_OFFSET (EvPageActionClass, activate_link),
225  NULL, NULL,
226  g_cclosure_marshal_VOID__OBJECT,
227  G_TYPE_NONE, 1,
228  G_TYPE_OBJECT);
229 
230  g_object_class_install_property (object_class,
231  PROP_MODEL,
232  g_param_spec_object ("model",
233  "Model",
234  "Current Links Model",
235  GTK_TYPE_TREE_MODEL,
236  G_PARAM_READWRITE |
237  G_PARAM_STATIC_STRINGS));
238 
239  g_type_class_add_private (object_class, sizeof (EvPageActionPrivate));
240 }
static void ev_page_action_dispose ( GObject *  object)
static

Definition at line 103 of file ev-page-action.c.

104 {
105  EvPageAction *page = EV_PAGE_ACTION (object);
106 
107  if (page->priv->model) {
108  g_object_unref (page->priv->model);
109  page->priv->model = NULL;
110  }
111 
112  page->priv->doc_model = NULL;
113 
114  G_OBJECT_CLASS (ev_page_action_parent_class)->dispose (object);
115 }

+ Here is the caller graph for this function:

static void ev_page_action_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 137 of file ev-page-action.c.

141 {
142  EvPageAction *page = EV_PAGE_ACTION (object);
143 
144  switch (prop_id)
145  {
146  case PROP_MODEL:
147  g_value_set_object (value, page->priv->model);
148  break;
149  default:
150  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
151  break;
152  }
153 }

+ Here is the caller graph for this function:

void ev_page_action_grab_focus ( EvPageAction page_action)

Definition at line 186 of file ev-page-action.c.

187 {
188  GSList *proxies;
189 
190  proxies = gtk_action_get_proxies (GTK_ACTION (page_action));
191  for (; proxies != NULL; proxies = proxies->next) {
192  EvPageActionWidget *proxy;
193 
194  proxy = EV_PAGE_ACTION_WIDGET (proxies->data);
195 
196  if (gtk_widget_get_mapped (GTK_WIDGET (proxy)))
198  }
199 }

+ Here is the caller graph for this function:

static void ev_page_action_init ( EvPageAction action)
static

Definition at line 202 of file ev-page-action.c.

203 {
204  page->priv = EV_PAGE_ACTION_GET_PRIVATE (page);
205 }
void ev_page_action_set_links_model ( EvPageAction page,
GtkTreeModel *  links_model 
)

Definition at line 169 of file ev-page-action.c.

171 {
172  g_return_if_fail (EV_IS_PAGE_ACTION (page));
173  g_return_if_fail (GTK_IS_TREE_MODEL (links_model));
174 
175  if (page->priv->model == links_model)
176  return;
177 
178  if (page->priv->model)
179  g_object_unref (page->priv->model);
180  page->priv->model = g_object_ref (links_model);
181 
182  g_object_notify (G_OBJECT (page), "model");
183 }

+ Here is the caller graph for this function:

void ev_page_action_set_model ( EvPageAction page,
EvDocumentModel model 
)

Definition at line 156 of file ev-page-action.c.

158 {
159  g_return_if_fail (EV_IS_PAGE_ACTION (page));
160  g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
161 
162  if (page->priv->doc_model == model)
163  return;
164 
165  page->priv->doc_model = model;
166 }

+ Here is the caller graph for this function:

static void ev_page_action_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

Definition at line 118 of file ev-page-action.c.

122 {
123  EvPageAction *page = EV_PAGE_ACTION (object);
124 
125  switch (prop_id)
126  {
127  case PROP_MODEL:
128  ev_page_action_set_links_model (page, g_value_get_object (value));
129  break;
130  default:
131  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
132  break;
133  }
134 }

+ Here is the caller graph for this function:

static void update_model ( EvPageAction page,
GParamSpec *  pspec,
EvPageActionWidget proxy 
)
static

Definition at line 72 of file ev-page-action.c.

73 {
75 }

+ Here is the caller graph for this function:

Variable Documentation

guint signals[N_SIGNALS] = {0, }
static

Definition at line 50 of file ev-page-action.c.