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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
/*
* Ghostview.h -- Public 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 _Ghostview_h
#define _Ghostview_h
/* Be sure that FILE* is defined */
#include <stdio.h>
/****************************************************************
*
* Ghostview widget
*
****************************************************************/
/* Resources:
Name Class RepType Default Value
---- ----- ------- -------------
arguments Arguments String NULL
background Background Pixel XtDefaultBackground
border BorderColor Pixel XtDefaultForeground
borderWidth BorderWidth Dimension 1
bottomMargin Margin int 0
busyCursor Cursor Cursor watch
callback Callback Pointer NULL
cursor Cursor Cursor crosshair
destroyCallback Callback Pointer NULL
filename Filename String "-"
foreground Foreground Pixel XtDefaultForeground
height Height Dimension 0
interpreter Interpreter String "gs"
leftMargin Margin int 0
llx BoundingBox Int 0
lly BoundingBox Int 0
mappedWhenManaged MappedWhenManaged Boolean True
messageCallback Callback Pointer NULL
orientation Orientation PageOrientation Portrait
outputCallback Callback Pointer NULL
palette Palette Palette Color
quiet Quiet Boolean True
rightMargin Margin int 0
safer Safer Boolean True
topMargin Margin int 0
urx BoundingBox Int 612
ury BoundingBox Int 792
useBackingPixmap UseBackingPixmap Boolean True
width Width Dimension 0
x Position Position 0
xdpi Resolution Float **
y Position Position 0
ydpi Resolution Float **
** automatically calculated from display parameters if width and
height are not set.
*/
/* define any special resource names here that are not in <X11/StringDefs.h> */
#define XtNbusyCursor "busyCursor"
#define XtNcursor "cursor"
#define XtNfilename "filename"
#define XtNinterpreter "interpreter"
#define XtNmessageCallback "messageCallback"
#define XtNoutputCallback "outputCallback"
#define XtNpalette "palette"
#define XtNarguments "arguments"
#define XtNquiet "quiet"
#define XtNsafer "safer"
#define XtNllx "llx"
#define XtNlly "lly"
#define XtNurx "urx"
#define XtNury "ury"
#define XtNuseBackingPixmap "useBackingPixmap"
#define XtNxdpi "xdpi"
#define XtNydpi "ydpi"
#define XtNrightMargin "rightMargin"
#define XtNleftMargin "leftMargin"
#define XtNbottomMargin "bottomMargin"
#define XtNtopMargin "topMargin"
#define XtCBoundingBox "BoundingBox"
#define XtCFilename "Filename"
#define XtCInterpreter "Interpreter"
#define XtCPalette "Palette"
#define XtCArguments "Arguments"
#define XtCQuiet "Quiet"
#define XtCSafer "Safer"
#define XtCResolution "Resolution"
#define XtCUseBackingPixmap "UseBackingPixmap"
/******************************************************************************
* XmuCvtStringToPageOrientation
*/
/* Number represents clockwise rotation of the paper in degrees */
typedef enum {
XtPageOrientationPortrait = 0, /* Normal portrait orientation */
XtPageOrientationLandscape = 90, /* Normal landscape orientation */
XtPageOrientationUpsideDown = 180, /* Don't think this will be used much */
XtPageOrientationSeascape = 270 /* Landscape rotated the other way */
} XtPageOrientation;
#define XtEportrait "portrait"
#define XtElandscape "landscape"
#define XtEupsideDown "upside-down"
#define XtEseascape "seascape"
#define XtRPageOrientation "PageOrientation"
extern Boolean XmuCvtStringToPageOrientation();
/******************************************************************************
* XmuCvtStringToPalette
*/
typedef enum {
XtPaletteMonochrome,
XtPaletteGrayscale,
XtPaletteColor
} XtPalette;
#define XtEmonochrome "monochrome"
#define XtEgrayscale "grayscale"
#define XtEcolor "color"
#define XtRPalette "Palette"
extern Boolean XmuCvtStringToPalette();
/* declare specific GhostviewWidget class and instance datatypes */
typedef struct _GhostviewClassRec* GhostviewWidgetClass;
typedef struct _GhostviewRec* GhostviewWidget;
/* declare the class constant */
extern WidgetClass ghostviewWidgetClass;
/* Public routines */
extern void GhostviewEnableInterpreter(
#if NeedFunctionPrototypes
Widget /* w */
#endif
);
extern void GhostviewDisableInterpreter(
#if NeedFunctionPrototypes
Widget /* w */
#endif
);
extern Boolean GhostviewIsInterpreterReady(
#if NeedFunctionPrototypes
Widget /* w */
#endif
);
extern Boolean GhostviewIsInterpreterRunning(
#if NeedFunctionPrototypes
Widget /* w */
#endif
);
extern Pixmap GhostviewGetBackingPixmap(
#if NeedFunctionPrototypes
Widget /* w */
#endif
);
extern Boolean GhostviewSendPS(
#if NeedFunctionPrototypes
Widget /* widget */,
FILE* /* fp */,
long /* begin */,
unsigned int /* len */,
Bool /* close */
#endif
);
extern Boolean GhostviewNextPage(
#if NeedFunctionPrototypes
Widget /* w */
#endif
);
/* The structure returned by the regular callback */
typedef struct _GhostviewReturnStruct {
int width, height;
int psx, psy;
float xdpi, ydpi;
} GhostviewReturnStruct;
#endif /* _Ghostview_h */
|