"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /*
2 * Ghostview.h -- Public 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 2 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 this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 * Author: Tim Theisen Systems Programmer
20 * Internet: tim@cs.wisc.edu Department of Computer Sciences
21 * UUCP: uwvax!tim University of Wisconsin-Madison
22 * Phone: (608)262-0438 1210 West Dayton Street
23 * FAX: (608)262-9777 Madison, WI 53706
24 */
25
26 #ifndef _Ghostview_h
27 #define _Ghostview_h
28 /* Be sure that FILE* is defined */
29 #include <stdio.h>
30
31 /****************************************************************
32 *
33 * Ghostview widget
34 *
35 ****************************************************************/
36
37 /* Resources:
38
39 Name Class RepType Default Value
40 ---- ----- ------- -------------
41 background Background Pixel XtDefaultBackground
42 border BorderColor Pixel XtDefaultForeground
43 borderWidth BorderWidth Dimension 1
44 bottomMargin Margin int 0
45 busyCursor Cursor Cursor watch
46 callback Callback Pointer NULL
47 cursor Cursor Cursor crosshair
48 destroyCallback Callback Pointer NULL
49 filename Filename String "-"
50 height Height Dimension 0
51 interpreter Interpreter String "gs"
52 leftMargin Margin int 0
53 llx BoundingBox Int 0
54 lly BoundingBox Int 0
55 mappedWhenManaged MappedWhenManaged Boolean True
56 messageCallback Callback Pointer NULL
57 orientation Orientation PageOrientation Portrait
58 outputCallback Callback Pointer NULL
59 preload Preload String NULL
60 quiet Quiet Boolean True
61 rightMargin Margin int 0
62 topMargin Margin int 0
63 urx BoundingBox Int 612
64 ury BoundingBox Int 792
65 useBackingPixmap UseBackingPixmap Boolean True
66 width Width Dimension 0
67 x Position Position 0
68 xdpi Resolution Float **
69 y Position Position 0
70 ydpi Resolution Float **
71
72 ** automatically calculated from display parameters if width and
73 height are not set.
74
75 */
76
77 /* define any special resource names here that are not in <X11/StringDefs.h> */
78
79 #define XtNbusyCursor "busyCursor"
80 #define XtNcursor "cursor"
81 #define XtNfilename "filename"
82 #define XtNinterpreter "interpreter"
83 #define XtNmessageCallback "messageCallback"
84 #define XtNoutputCallback "outputCallback"
85 #define XtNpreload "preload"
86 #define XtNquiet "quiet"
87 #define XtNllx "llx"
88 #define XtNlly "lly"
89 #define XtNurx "urx"
90 #define XtNury "ury"
91 #define XtNuseBackingPixmap "useBackingPixmap"
92 #define XtNxdpi "xdpi"
93 #define XtNydpi "ydpi"
94 #define XtNrightMargin "rightMargin"
95 #define XtNleftMargin "leftMargin"
96 #define XtNbottomMargin "bottomMargin"
97 #define XtNtopMargin "topMargin"
98
99 #define XtCBoundingBox "BoundingBox"
100 #define XtCFilename "Filename"
101 #define XtCInterpreter "Interpreter"
102 #define XtCPreload "Preload"
103 #define XtCQuiet "Quiet"
104 #define XtCResolution "Resolution"
105 #define XtCUseBackingPixmap "UseBackingPixmap"
106
107 #define XtRPageOrientation "PageOrientation"
108
109 /******************************************************************************
110 * XmuCvtStringToPageOrientation
111 */
112 /* Number represents clockwise rotation of the paper in degrees */
113 typedef enum {
114 XtPageOrientationPortrait = 0, /* Normal portrait orientation */
115 XtPageOrientationLandscape = 90, /* Normal landscape orientation */
116 XtPageOrientationUpsideDown = 180, /* Don't think this will be used much */
117 XtPageOrientationSeascape = 270 /* Landscape rotated the other way */
118 } XtPageOrientation;
119 #define XtEportrait "portrait"
120 #define XtElandscape "landscape"
121 #define XtEupsideDown "upside-down"
122 #define XtEseascape "seascape"
123 #define XtRPageOrientation "PageOrientation"
124 extern Boolean XmuCvtStringToPageOrientation();
125
126 /* declare specific GhostviewWidget class and instance datatypes */
127
128 typedef struct _GhostviewClassRec* GhostviewWidgetClass;
129 typedef struct _GhostviewRec* GhostviewWidget;
130
131 /* declare the class constant */
132
133 extern WidgetClass ghostviewWidgetClass;
134
135 /* Public routines */
136
137 extern void GhostviewEnableInterpreter(
138 #if NeedFunctionPrototypes
139 Widget /* w */
140 #endif
141 );
142
143 extern void GhostviewDisableInterpreter(
144 #if NeedFunctionPrototypes
145 Widget /* w */
146 #endif
147 );
148
149 extern Boolean GhostviewIsInterpreterReady(
150 #if NeedFunctionPrototypes
151 Widget /* w */
152 #endif
153 );
154
155 extern Boolean GhostviewIsInterpreterRunning(
156 #if NeedFunctionPrototypes
157 Widget /* w */
158 #endif
159 );
160
161 extern Pixmap GhostviewGetBackingPixmap(
162 #if NeedFunctionPrototypes
163 Widget /* w */
164 #endif
165 );
166
167 extern Boolean GhostviewSendPS(
168 #if NeedFunctionPrototypes
169 Widget /* widget */,
170 FILE* /* fp */,
171 long /* begin */,
172 unsigned int /* len */,
173 Bool /* close */
174 #endif
175 );
176
177 extern Boolean GhostviewNextPage(
178 #if NeedFunctionPrototypes
179 Widget /* w */
180 #endif
181 );
182
183 /* The structure returned by the regular callback */
184
185 typedef struct _GhostviewReturnStruct {
186 int width, height;
187 int psx, psy;
188 float xdpi, ydpi;
189 } GhostviewReturnStruct;
190
191 #endif /* _Ghostview_h */