1 /*
2  * ghostviewp.h -- Private header file for Ghostview widget.
3  * Copyright (C) 1992  Timothy O. Theisen
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with GNU gv; see the file COPYING.  If not, write to
17  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  *   Author: Tim Theisen           Systems Programmer
21  * Internet: tim@cs.wisc.edu       Department of Computer Sciences
22  *     UUCP: uwvax!tim             University of Wisconsin-Madison
23  *    Phone: (608)262-0438         1210 West Dayton Street
24  *      FAX: (608)262-9777         Madison, WI   53706
25 */
26 
27 #ifndef _GhostviewP_h
28 #define _GhostviewP_h
29 
30 #include "paths.h"
31 #include "Ghostview.h"
32 #include INC_XMU(Atoms.h)
33 #include INC_XMU(CharSet.h)
34 #include <stdio.h>
35 
36 typedef struct {
37     AtomPtr ghostview;
38     AtomPtr gv_colors;
39     AtomPtr next;
40     AtomPtr page;
41     AtomPtr done;
42 } GhostviewClassPart;
43 
44 typedef struct _GhostviewClassRec {
45     CoreClassPart	core_class;
46     GhostviewClassPart	ghostview_class;
47 } GhostviewClassRec;
48 
49 extern GhostviewClassRec ghostviewClassRec;
50 
51 /* structure to describe section of file to send to ghostscript */
52 struct record_list {
53     FILE *fp;
54     gv_off_t begin;
55     gv_off_t len;
56     Boolean seek_needed;
57     Boolean close;
58     struct record_list *next;
59 };
60 
61 typedef struct {
62     /* resources */
63     Pixel		foreground;
64     Cursor		cursor;
65     Cursor		busy_cursor;
66     Cursor		scroll_cursor;
67     int			cursor_type;
68     XtCallbackList	callback;
69     XtCallbackList	message_callback;
70     XtCallbackList	output_callback;
71     String		interpreter;
72     Boolean		quiet;
73     int                 infoVerbose;
74     Boolean		safeDir;
75     int                 xinerama;
76     Boolean		safer;
77     Boolean		use_bpixmap;
78     String		arguments;
79     String		filename;
80     XtPageOrientation	orientation;
81     XtPalette		palette;
82     float		xdpi;
83     float		ydpi;
84     long		lxdpi; /* use lxdi,lydpi for setting resolution resource */
85     long		lydpi; /* and propagate it to xdpi,ydpi in "SetValues". */
86     int			llx;
87     int			lly;
88     int			urx;
89     int			ury;
90     int			left_margin;
91     int			bottom_margin;
92     int			right_margin;
93     int			top_margin;
94 #if 0
95     Pixel		highlight_pixel;
96 #endif
97     /* private state */
98     GC                  highlight_gc;
99     GC			gc;		/* GC used to clear window */
100     Window		mwin;		/* destination of ghostsript messages */
101     Boolean		disable_start;	/* whether to fork ghostscript */
102     int			interpreter_pid;/* pid of ghostscript, -1 if none */
103     struct record_list	*ps_input;	/* pointer it gs input queue */
104     char		*input_buffer;	/* pointer to input buffer */
105     gv_off_t		bytes_left;	/* bytes left in section */
106     char		*input_buffer_ptr; /* pointer into input buffer */
107     unsigned int	buffer_bytes_left; /* bytes left in buffer */
108     int			interpreter_input; /* fd gs stdin, -1 if None */
109     int			interpreter_output; /* fd gs stdout, -1 if None */
110     int			interpreter_error; /* fd gs stderr, -1 if None */
111     XtInputId		interpreter_input_id; /* XtInputId for above */
112     XtInputId		interpreter_output_id; /* XtInputId for above */
113     XtInputId		interpreter_error_id; /* XtInputId for above */
114     Dimension		gs_width;	/* Width of window at last Setup() */
115     Dimension		gs_height;	/* Height of window at last Setup() */
116     Boolean		busy;		/* Is gs busy drawing? */
117     Boolean		changed;	/* something changed since Setup()? */
118     Dimension		pref_width; /*#test#*/
119     Dimension		pref_height;
120     int                 background_cleared;
121 } GhostviewPart;
122 
123 typedef struct _GhostviewRec {
124     CorePart		core;
125     GhostviewPart	ghostview;
126 } GhostviewRec;
127 
128 #endif /* _GhostviewP_h */
129