summaryrefslogtreecommitdiff
path: root/support/hypertex/tanmoy/ghostview-1.5-hacked/GhostviewP.h
blob: 0749b2dc34e0dd99c912ec9cab7a78d962499b4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
 * GhostviewP.h -- Private header file for Ghostview widget.
 * Copyright (C) 1992  Timothy O. Theisen
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *   Author: Tim Theisen           Systems Programmer
 * Internet: tim@cs.wisc.edu       Department of Computer Sciences
 *     UUCP: uwvax!tim             University of Wisconsin-Madison
 *    Phone: (608)262-0438         1210 West Dayton Street
 *      FAX: (608)262-9777         Madison, WI   53706
 */

#ifndef _GhostviewP_h
#define _GhostviewP_h

#include "Ghostview.h"
#include <X11/Xmu/Atoms.h>
#include <X11/Xmu/CharSet.h>
#include <stdio.h>

typedef struct {
    AtomPtr ghostview;
    AtomPtr gv_colors;
    AtomPtr next;
    AtomPtr page;
    AtomPtr done;
} GhostviewClassPart;

typedef struct _GhostviewClassRec {
    CoreClassPart	core_class;
    GhostviewClassPart	ghostview_class;
} GhostviewClassRec;

extern GhostviewClassRec ghostviewClassRec;

/* structure to describe section of file to send to ghostscript */
struct record_list {
    FILE *fp;
    long begin;
    unsigned int len;
    Boolean seek_needed;
    Boolean close;
    struct record_list *next;
};

typedef struct {
    /* resources */
    Pixel		foreground;
    Cursor		cursor;
    Cursor		busy_cursor;
    XtCallbackList	callback;
    XtCallbackList	message_callback;
    XtCallbackList	output_callback;
    String		interpreter;
    Boolean		quiet;
    Boolean		safer;
    Boolean		use_bpixmap;
    String		arguments;
    String		filename;
    XtPageOrientation	orientation;
    XtPalette		palette;
    float		xdpi;
    float		ydpi;
    int			llx;
    int			lly;
    int			urx;
    int			ury;
    int			left_margin;
    int			bottom_margin;
    int			right_margin;
    int			top_margin;
    /* private state */
    GC			gc;		/* GC used to clear window */
    Window		mwin;		/* destination of ghostsript messages */
    Boolean		disable_start;	/* whether to fork ghostscript */
    int			interpreter_pid;/* pid of ghostscript, -1 if none */
    struct record_list	*ps_input;	/* pointer it gs input queue */
    char		*input_buffer;	/* pointer to input buffer */
    unsigned int	bytes_left;	/* bytes left in section */
#ifndef VMS
    char		*input_buffer_ptr; /* pointer into input buffer */
    unsigned int	buffer_bytes_left; /* bytes left in buffer */
#endif
    int			interpreter_input; /* fd gs stdin, -1 if None */
    int			interpreter_output; /* fd gs stdout, -1 if None */
#ifndef VMS
    int			interpreter_error; /* fd gs stderr, -1 if None */
    XtInputId		interpreter_input_id; /* XtInputId for above */
    XtInputId		interpreter_output_id; /* XtInputId for above */
    XtInputId		interpreter_error_id; /* XtInputId for above */
#else /* VMS */
    short		interpreter_input_iosb[4];  /* I/O Status Blocks    */
    short		interpreter_output_iosb[4]; /* for each mailbox     */
    char		*output_buffer; /* pointer to output buffer */
#endif /* VMS */
    Dimension		gs_width;	/* Width of window at last Setup() */
    Dimension		gs_height;	/* Height of window at last Setup() */
    Boolean		busy;		/* Is gs busy drawing? */
    Boolean		changed;	/* something changed since Setup()? */
} GhostviewPart;

typedef struct _GhostviewRec {
    CorePart		core;
    GhostviewPart	ghostview;
} GhostviewRec;

#endif /* _GhostviewP_h */