earlybrowserreborn - Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 roytam 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 GhostviewLayout(
144 #if NeedFunctionPrototypes
145     Widget      /* w */,
146     Bool        /* xfree */,
147     Bool        /* yfree */
148 #endif
149 );
150  
151 extern void GhostviewDisableInterpreter(
152 #if NeedFunctionPrototypes
153     Widget      /* w */
154 #endif
155 );
156  
157 extern Boolean GhostviewIsInterpreterReady(
158 #if NeedFunctionPrototypes
159     Widget      /* w */
160 #endif
161 );
162  
163 extern Boolean GhostviewIsInterpreterRunning(
164 #if NeedFunctionPrototypes
165     Widget      /* w */
166 #endif
167 );
168  
169 extern Pixmap GhostviewGetBackingPixmap(
170 #if NeedFunctionPrototypes
171     Widget      /* w */
172 #endif
173 );
174  
175 extern Boolean GhostviewSendPS(
176 #if NeedFunctionPrototypes
177     Widget      /* widget */,
178     FILE*       /* fp */,
179     long        /* begin */,
180     unsigned int        /* len */,
181     Bool        /* close */
182 #endif
183 );
184  
185 extern Boolean GhostviewNextPage(
186 #if NeedFunctionPrototypes
187     Widget      /* w */
188 #endif
189 );
190  
191 /* The structure returned by the regular callback */
192  
193 typedef struct _GhostviewReturnStruct {
194     int width, height;
195     int psx, psy;
196     float xdpi, ydpi;
197 } GhostviewReturnStruct;
198  
199 #endif /* _Ghostview_h */