]> www.fi.muni.cz Git - evince.git/blob - ps/gtkgs.h
Remove unused code and make a lot of stuff private
[evince.git] / ps / gtkgs.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 __GTK_GS_H__
25 #define __GTK_GS_H__
26
27 #include <gdk/gdk.h>
28 #include <gtk/gtkwidget.h>
29
30 #include <gconf/gconf-client.h>
31
32 #include <errno.h>
33 #include <signal.h>
34 #include <unistd.h>
35 #include <sys/types.h>
36 #include <stdio.h>
37
38 #include "gstypes.h"
39
40 G_BEGIN_DECLS
41
42 #define GTK_GS_TYPE         (gtk_gs_get_type())
43 #define GTK_GS(obj)         GTK_CHECK_CAST (obj, gtk_gs_get_type (), GtkGS)
44 #define GTK_GS_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_gs_get_type (), GtkGSClass)
45 #define GTK_IS_GS(obj)      GTK_CHECK_TYPE (obj, gtk_gs_get_type())
46
47 typedef struct _GtkGS GtkGS;
48 typedef struct _GtkGSClass GtkGSClass;
49
50 struct _GtkGS {
51   GObject object;
52   GdkWindow *pstarget;          /* the window passed to gv
53                                  * it is a child of widget...
54                                  */
55   GdkGC *psgc;
56
57   GtkGSZoomMode zoom_mode;
58
59   GdkPixmap *bpixmap;           /* Backing pixmap */
60
61   long message_window;          /* Used by ghostview to receive messages from app */
62
63   int disable_start;            /* Can the interpreter be started? */
64   pid_t interpreter_pid;        /* PID of interpreter, -1 if none  */
65   int interpreter_input;        /* stdin of interpreter            */
66   int interpreter_output;       /* stdout of interpreter           */
67   int interpreter_err;          /* stderr of interpreter           */
68   guint interpreter_input_id;
69   guint interpreter_output_id;
70   guint interpreter_error_id;
71
72   gint llx;
73   gint lly;
74   gint urx;
75   gint ury;
76   gint left_margin;
77   gint right_margin;
78   gint top_margin;
79   gint bottom_margin;
80   gint width;                   /* Size of window at last setup()  */
81   gint height;
82   gboolean busy;                /* Is gs busy drawing? */
83   gboolean changed;             /* Anything changed since setup */
84   gfloat zoom_factor;
85   gint current_page;
86   gboolean structured_doc;
87   gboolean loaded;
88
89   struct record_list *ps_input;
90   gchar *input_buffer_ptr;
91   guint bytes_left;
92   guint buffer_bytes_left;
93
94   FILE *gs_psfile;              /* the currently loaded FILE */
95   gchar *gs_filename;           /* the currently loaded filename */
96   gchar *gs_filename_dsc;       /* Used to browse PDF to PS */
97   gchar *gs_filename_unc;       /* Uncompressed file */
98   gchar *input_buffer;
99   gint gs_scanstyle;
100   gboolean send_filename_to_gs; /* True if gs should read from file directly */
101   gboolean reading_from_pipe;   /* True if ggv is reading input from pipe */
102   struct document *doc;
103
104   /* User selected options... */
105   gboolean antialiased;         /* Using antialiased display */
106   gboolean respect_eof;         /* respect EOF comments? */
107   gint default_size;
108   gboolean override_size;
109   gfloat xdpi, ydpi;
110   gboolean override_orientation;
111   gint fallback_orientation;    /* Orientation to use if override */
112   gint real_orientation;        /* Real orientation from the document */
113
114   const gchar *gs_status;       /* GtkGS status */
115
116   guint avail_w, avail_h;
117 };
118
119 struct _GtkGSClass {
120   GObjectClass parent_class;
121   GdkAtom gs_atom;
122   GdkAtom gs_colors_atom;
123   GdkAtom next_atom;
124   GdkAtom page_atom;
125   GdkAtom done_atom;
126   GdkAtom string_atom;
127
128   GConfClient *gconf_client;
129
130   void (*interpreter_message) (GtkGS *, gchar *, gpointer);
131   void (*interpreter_error) (GtkGS *, gint, gpointer);
132 };
133
134 GType gtk_gs_get_type(void);
135
136 G_END_DECLS
137
138 #endif /* __GTK_GS_H__ */