Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ps/ps-document.c
diff options
context:
space:
mode:
Diffstat (limited to 'ps/ps-document.c')
-rw-r--r--ps/ps-document.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/ps/ps-document.c b/ps/ps-document.c
index 7619f03..09e4ef3 100644
--- a/ps/ps-document.c
+++ b/ps/ps-document.c
@@ -149,9 +149,7 @@ The DONE message indicates that ghostscript has finished processing.
#include <stdio.h>
#include <math.h>
-#include "ev-document.h"
#include "ps-document.h"
-#include "ps.h"
#include "gsdefaults.h"
#ifdef HAVE_LOCALE_H
@@ -175,6 +173,11 @@ The DONE message indicates that ghostscript has finished processing.
enum { INTERPRETER_MESSAGE, INTERPRETER_ERROR, LAST_SIGNAL };
+enum {
+ PROP_0,
+ PROP_TITLE
+};
+
/* structure to describe section of file to send to ghostscript */
struct record_list {
FILE *fp;
@@ -283,6 +286,41 @@ ps_document_init(PSDocument * gs)
}
static void
+ps_document_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id)
+
+ {
+ case PROP_TITLE:
+ /* read only */
+ break;
+ }
+}
+
+static void
+ps_document_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ PSDocument *ps = PS_DOCUMENT (object);
+
+ switch (prop_id)
+ {
+ case PROP_TITLE:
+ if (ps->doc) {
+ g_value_set_string (value, ps->doc->title);
+ } else {
+ g_value_set_string (value, NULL);
+ }
+ break;
+ }
+}
+
+static void
ps_document_class_init(PSDocumentClass * klass)
{
GObjectClass *object_class;
@@ -292,6 +330,8 @@ ps_document_class_init(PSDocumentClass * klass)
gs_class = klass;
object_class->finalize = ps_document_finalize;
+ object_class->get_property = ps_document_get_property;
+ object_class->set_property = ps_document_set_property;
/* Create atoms */
klass->gs_atom = gdk_atom_intern("GHOSTVIEW", FALSE);
@@ -300,6 +340,8 @@ ps_document_class_init(PSDocumentClass * klass)
klass->string_atom = gdk_atom_intern("STRING", FALSE);
gtk_gs_defaults_load();
+
+ g_object_class_override_property (object_class, PROP_TITLE, "title");
}
/* Clean all memory and temporal files */
@@ -1296,6 +1338,8 @@ document_load(PSDocument * gs, const gchar * fname)
/* we grab the vital statistics!!! */
gs->doc = psscan(gs->gs_psfile, gs->respect_eof, filename);
+ g_object_notify (G_OBJECT (gs), "title");
+
if(gs->doc == NULL) {
/* File does not seem to be a Postscript one */
gchar buf[1024];