]> www.fi.muni.cz Git - evince.git/blob - ps/ps-document.h
Some more sanitization of the ps backend. Remove a lot of unused code and
[evince.git] / ps / ps-document.h
1 /*
2  * Ghostscript widget for GTK/GNOME
3  * 
4  * Copyright 1998 - 2005 The Free Software Foundation
5  * 
6  * Authors: Jaka Mocnik, Federico Mena (Quartic), Szekeres Istvan (Pista)
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __PS_DOCUMENT_H__
25 #define __PS_DOCUMENT_H__
26
27 #include <sys/types.h>
28
29 #include "ev-document.h"
30 #include "ps.h"
31 #include "gstypes.h"
32
33 G_BEGIN_DECLS
34
35 #define PS_TYPE_DOCUMENT         (ps_document_get_type())
36 #define PS_DOCUMENT(obj)         GTK_CHECK_CAST (obj, ps_document_get_type (), PSDocument)
37 #define PS_DOCUMENT_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, ps_document_get_type (), PSDocumentClass)
38 #define GTK_IS_GS(obj)           GTK_CHECK_TYPE (obj, ps_document_get_type())
39
40 typedef struct _PSDocument PSDocument;
41 typedef struct _PSDocumentClass PSDocumentClass;
42
43 struct _PSDocument {
44   GObject object;
45   GdkWindow *pstarget;          /* the window passed to gv
46                                  * it is a child of widget...
47                                  */
48   GdkGC *psgc;
49
50   GdkPixmap *bpixmap;           /* Backing pixmap */
51
52   long message_window;          /* Used by ghostview to receive messages from app */
53
54   int disable_start;            /* Can the interpreter be started? */
55   pid_t interpreter_pid;        /* PID of interpreter, -1 if none  */
56   int interpreter_input;        /* stdin of interpreter            */
57   int interpreter_output;       /* stdout of interpreter           */
58   int interpreter_err;          /* stderr of interpreter           */
59   guint interpreter_input_id;
60   guint interpreter_output_id;
61   guint interpreter_error_id;
62
63   gint llx;
64   gint lly;
65   gint urx;
66   gint ury;
67   gint left_margin;
68   gint right_margin;
69   gint top_margin;
70   gint bottom_margin;
71   gint width;                   /* Size of window at last setup()  */
72   gint height;
73   gboolean busy;                /* Is gs busy drawing? */
74   gboolean changed;             /* Anything changed since setup */
75   gfloat zoom_factor;
76   gint current_page;
77   gboolean structured_doc;
78   gboolean loaded;
79
80   struct record_list *ps_input;
81   gchar *input_buffer_ptr;
82   guint bytes_left;
83   guint buffer_bytes_left;
84
85   FILE *gs_psfile;              /* the currently loaded FILE */
86   gchar *gs_filename;           /* the currently loaded filename */
87   gchar *gs_filename_dsc;       /* Used to browse PDF to PS */
88   gchar *gs_filename_unc;       /* Uncompressed file */
89   gchar *input_buffer;
90   gint gs_scanstyle;
91   gboolean send_filename_to_gs; /* True if gs should read from file directly */
92   gboolean reading_from_pipe;   /* True if ggv is reading input from pipe */
93   struct document *doc;
94
95   /* User selected options... */
96   gboolean antialiased;         /* Using antialiased display */
97   gboolean respect_eof;         /* respect EOF comments? */
98   gint default_size;
99   gfloat xdpi, ydpi;
100   gint fallback_orientation;    /* Orientation to use if override */
101   gint real_orientation;        /* Real orientation from the document */
102
103   const gchar *gs_status;       /* PSDocument status */
104
105   guint avail_w, avail_h;
106
107   int page_x_offset;
108   int page_y_offset;
109
110   gboolean scaling;
111 };
112
113 struct _PSDocumentClass {
114   GObjectClass parent_class;
115
116   GdkAtom gs_atom;
117   GdkAtom next_atom;
118   GdkAtom page_atom;
119   GdkAtom string_atom;
120 };
121
122 GType ps_document_get_type(void);
123
124 G_END_DECLS
125
126 #endif /* __PS_DOCUMENT_H__ */