Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2005-01-03 13:43:31 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-01-03 13:43:31 (GMT)
commitf53f3523ebc7a082eb8a1c046cee836b67696912 (patch)
tree3f1de9127a28d9ae4ce2caa87d923add04e3a3e0 /backend
parentb393a0f9386efcd5742d335be1ecc178caf00853 (diff)
Initial support for document title. Not working yet.
2005-01-03 Marco Pesenti Gritti <marco@gnome.org> * backend/ev-document.c: (ev_document_get_type), (ev_document_class_init), (ev_document_load), (ev_document_get_title): * backend/ev-document.h: * pdf/xpdf/pdf-document.cc: * ps/ps-document.c: (ps_document_set_property), (ps_document_get_property), (ps_document_class_init), (document_load): * ps/ps-document.h: * ps/ps.h: * shell/ev-window.c: (update_window_title), (ev_window_open), (ev_window_init): Initial support for document title. Not working yet.
Diffstat (limited to 'backend')
-rw-r--r--backend/ev-document.c48
-rw-r--r--backend/ev-document.h1
2 files changed, 30 insertions, 19 deletions
diff --git a/backend/ev-document.c b/backend/ev-document.c
index dcc6204..a76a555 100644
--- a/backend/ev-document.c
+++ b/backend/ev-document.c
@@ -23,7 +23,7 @@
#include "ev-document.h"
#include "ev-backend-marshalers.h"
-static void ev_document_base_init (gpointer g_class);
+static void ev_document_class_init (gpointer g_class);
enum
{
@@ -43,8 +43,9 @@ ev_document_get_type (void)
static const GTypeInfo our_info =
{
sizeof (EvDocumentIface),
- ev_document_base_init,
NULL,
+ NULL,
+ (GClassInitFunc)ev_document_class_init
};
type = g_type_register_static (G_TYPE_INTERFACE,
@@ -56,24 +57,23 @@ ev_document_get_type (void)
}
static void
-ev_document_base_init (gpointer g_class)
+ev_document_class_init (gpointer g_class)
{
- static gboolean initialized = FALSE;
-
- if (!initialized)
- {
- signals[CHANGED] =
- g_signal_new ("changed",
- EV_TYPE_DOCUMENT,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EvDocumentIface, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-
- initialized = TRUE;
- }
+ signals[CHANGED] =
+ g_signal_new ("changed",
+ EV_TYPE_DOCUMENT,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EvDocumentIface, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
+ g_object_interface_install_property (g_class,
+ g_param_spec_string ("title",
+ "Document Title",
+ "The title of the document",
+ NULL, 0));
}
gboolean
@@ -85,6 +85,16 @@ ev_document_load (EvDocument *document,
return iface->load (document, uri, error);
}
+char *
+ev_document_get_title (EvDocument *document)
+{
+ char *title;
+
+ g_object_get (document, "title", &title, NULL);
+
+ return title;
+}
+
int
ev_document_get_n_pages (EvDocument *document)
{
diff --git a/backend/ev-document.h b/backend/ev-document.h
index 0059fd4..84b9e97 100644
--- a/backend/ev-document.h
+++ b/backend/ev-document.h
@@ -75,6 +75,7 @@ GType ev_document_get_type (void);
gboolean ev_document_load (EvDocument *document,
const char *uri,
GError **error);
+char *ev_document_get_title (EvDocument *document);
int ev_document_get_n_pages (EvDocument *document);
void ev_document_set_page (EvDocument *document,
int page);