#include <stdio.h>
#include <math.h>
-#include "ev-document.h"
#include "ps-document.h"
-#include "ps.h"
#include "gsdefaults.h"
#ifdef HAVE_LOCALE_H
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;
gs->gs_status = _("No document loaded.");
}
+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)
{
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);
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 */
/* 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];