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-properties-main.c File Reference
#include <config.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libnautilus-extension/nautilus-extension-types.h>
#include <libnautilus-extension/nautilus-property-page-provider.h>
#include <evince-document.h>
#include "ev-properties-view.h"
+ Include dependency graph for ev-properties-main.c:

Go to the source code of this file.

Functions

static void property_page_provider_iface_init (NautilusPropertyPageProviderIface *iface)
 
static GList * ev_properties_get_pages (NautilusPropertyPageProvider *provider, GList *files)
 
static void ev_properties_plugin_register_type (GTypeModule *module)
 
void nautilus_module_initialize (GTypeModule *module)
 
void nautilus_module_shutdown (void)
 
void nautilus_module_list_types (const GType **types, int *num_types)
 

Variables

static GType epp_type = 0
 

Function Documentation

static GList * ev_properties_get_pages ( NautilusPropertyPageProvider *  provider,
GList *  files 
)
static

Definition at line 85 of file ev-properties-main.c.

87 {
88  GError *error = NULL;
89  EvDocument *document = NULL;
90  GList *pages = NULL;
91  NautilusFileInfo *file;
92  gchar *uri = NULL;
93  gchar *mime_type = NULL;
94  GtkWidget *page, *label;
95  NautilusPropertyPage *property_page;
96 
97  /* only add properties page if a single file is selected */
98  if (files == NULL || files->next != NULL)
99  goto end;
100  file = files->data;
101 
102  /* okay, make the page */
103  uri = nautilus_file_info_get_uri (file);
104  mime_type = nautilus_file_info_get_mime_type (file);
105 
106  document = ev_backends_manager_get_document (mime_type);
107  if (!document)
108  goto end;
109 
110  ev_document_load (document, uri, &error);
111  if (error) {
112  g_error_free (error);
113  goto end;
114  }
115 
116  label = gtk_label_new (_("Document"));
117  page = ev_properties_view_new (document);
119  ev_document_get_info (document));
120  gtk_widget_show (page);
121  property_page = nautilus_property_page_new ("document-properties",
122  label, page);
123 
124  pages = g_list_prepend (pages, property_page);
125 
126 end:
127  g_free (uri);
128  g_free (mime_type);
129 
130  if (document != NULL)
131  g_object_unref (document);
132 
133  return pages;
134 }

+ Here is the caller graph for this function:

static void ev_properties_plugin_register_type ( GTypeModule *  module)
static

Definition at line 50 of file ev-properties-main.c.

51 {
52  const GTypeInfo info = {
53  sizeof (GObjectClass),
54  (GBaseInitFunc) NULL,
55  (GBaseFinalizeFunc) NULL,
56  (GClassInitFunc) NULL,
57  NULL,
58  NULL,
59  sizeof (GObject),
60  0,
61  (GInstanceInitFunc) NULL
62  };
63  const GInterfaceInfo property_page_provider_iface_info = {
64  (GInterfaceInitFunc)property_page_provider_iface_init,
65  NULL,
66  NULL
67  };
68 
69  epp_type = g_type_module_register_type (module, G_TYPE_OBJECT,
70  "EvPropertiesPlugin",
71  &info, 0);
72  g_type_module_add_interface (module,
73  epp_type,
74  NAUTILUS_TYPE_PROPERTY_PAGE_PROVIDER,
75  &property_page_provider_iface_info);
76 }

+ Here is the caller graph for this function:

void nautilus_module_initialize ( GTypeModule *  module)

Definition at line 138 of file ev-properties-main.c.

139 {
142 
143  ev_init ();
144 }
void nautilus_module_list_types ( const GType **  types,
int *  num_types 
)

Definition at line 153 of file ev-properties-main.c.

155 {
156  static GType type_list[1];
157 
158  type_list[0] = epp_type;
159  *types = type_list;
160  *num_types = G_N_ELEMENTS (type_list);
161 }
void nautilus_module_shutdown ( void  )

Definition at line 147 of file ev-properties-main.c.

148 {
149  ev_shutdown ();
150 }
static void property_page_provider_iface_init ( NautilusPropertyPageProviderIface *  iface)
static

Definition at line 79 of file ev-properties-main.c.

80 {
81  iface->get_pages = ev_properties_get_pages;
82 }

+ Here is the caller graph for this function:

Variable Documentation

GType epp_type = 0
static

Definition at line 43 of file ev-properties-main.c.