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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
|
#define BASIC_IVIEW 0
typedef int ColorCode;
typedef enum {
MouseClick = 0,
MouseMove = 1
} MouseEventType;
typedef enum {
NoModifiers = 0,
ExtendModifier = 1,
OptionModifier = 2,
OptionExtendModifier = 3
} MouseClickModifier;
typedef enum {
pointInvisible,
pointNormal,
pointHilited,
pointSelected
} PointState;
typedef enum {
selecting,
brushing,
usermode
} MouseMode;
#ifdef MACINTOSH
#define thePort qd.thePort
#define arrow qd.arrow
#ifdef THINK_C
#define RETURNCHAR '\r'
#endif /* THINK_C */
#ifdef applec
#define RETURNCHAR '\n'
#endif /* applec */
#ifdef __MWERKS__
#define RETURNCHAR '\r'
#endif /* __MWERKS__ */
#else
#ifdef SUNVIEW
typedef struct {
int h, v;
} Point;
#else
typedef struct {
int h, v;
} Point;
typedef struct {
int left, right, width, height;
} Rect;
#endif /* SUNVIEW */
#endif /* MACINTOSH */
#ifdef MACINTOSH
#define IVIEW_WINDOW WindowPtr
#define IVIEW_MENU MenuHandle
#define InitialTop (20 + GetMBarHeight())
#define InitialLeft 10
#define MOUSE_TOLERANCE 0
# define gray qd.gray
# define black qd.black
# define thePort qd.thePort
# define screenBits qd.screenBits
# define arrow qd.arrow
# undef extend
#ifdef applec
VOID PtoCstr _((StringPtr s));
VOID CtoPstr _((char * s));
#endif /* applec */
typedef struct {
LVAL Object; /* elements of window_data */
int idleOn, frontOnly; /* elements of window_data */
int mouse_x, mouse_y; /* elements of window_data */
WindowPtr window;
void (*FreeMem) _((IVIEW_WINDOW));
ColorCode backColor, drawColor;
int canvasWidth, canvasHeight;
int lineType, drawMode, lineWidth;
long RefCon;
int use_color;
int hasHscroll, hasVscroll, view_h, view_v;
int v_scroll_inc[2], h_scroll_inc[2];
ControlHandle hscroll, vscroll;
int initialized;
int symbolMode;
int cursor;
Rect clip_rect;
int clipped;
} StGWWinInfo;
extern Rect scroll_bar_bounds();
#define GetWRefCon(w) (((WindowPeek)(w))->refCon)
#define BAG_RES 1800
#define GLASS_RES 1801
#define CAN_RES 1802
#define BRUSH_RES 1803
#define HAND_RES 1804
#define FINGER_RES 1805
#endif /* MACINTOSH */
#ifdef UNIX
#ifdef GNUPLOT
#define Window long
#define Menu long
#define StGWWinInfo VOID
#define StGWWinInfo VOID
#endif /* GNUPLOT */
#define IVIEW_WINDOW Window
#define IVIEW_MENU Menu
#endif /* UNIX */
#ifdef SUNVIEW
typedef struct {
long Object; /* elements of window_data */
int idleOn, frontOnly; /* elements of window_data */
int mouse_x, mouse_y; /* elements of window_data */
IVIEW_WINDOW window;
int (*FreeMem)();
IVIEW_MENU menu;
int (*MenuAction)(), (*MenuShow)(), (*MenuUpdate)();
ColorCode backColor, drawColor;
int canvasWidth, canvasHeight;
int lineType, drawMode, lineWidth;
Canvas content_canvas;
long RefCon;
int use_color;
int hasHscroll, hasVscroll, view_h, view_v;
int v_scroll_inc[2], h_scroll_inc[2];
/* ControlHandle hscroll, vscroll; +++ */
int initialized;
int symbolMode;
int cursor;
Rect clip_rect;
int clipped;
} StGWWinInfo;
#endif /* SUNVIEW */
#ifdef X11WINDOWS
typedef struct {
LVAL Object; /* elements of window_data */
int idleOn, frontOnly; /* elements of window_data */
int mouse_x, mouse_y; /* elements of window_data */
Window window, panel;
VOID (*FreeMem) _((IVIEW_WINDOW));
ColorCode backColor, drawColor;
int canvasWidth, canvasHeight;
int lineType, drawMode, lineWidth;
long RefCon;
int use_color;
int hasHscroll, hasVscroll, view_h, view_v;
int v_scroll_inc[2], h_scroll_inc[2];
Window hscroll, vscroll;
int initialized;
int symbolMode;
int cursor;
int clip_left, clip_top, clip_width, clip_height;
int clipped;
int frame_width, frame_height;
GC gc, erase_gc, xor_gc;
int go_away, has_menu_button;
} StGWWinInfo;
#endif /* X11WINDOWS */
#ifdef _Windows
#define IVIEW_WINDOW HWND
#define IVIEW_MENU HMENU
typedef struct {
LVAL Object; /* elements of window_data */
int idleOn; /* elements of window_data */
int mouse_x, mouse_y; /* elements of window_data */
IVIEW_WINDOW window;
void (*FreeMem)(HWND);
ColorCode backColor, drawColor;
int canvasWidth, canvasHeight;
int lineType, drawMode, lineWidth;
long RefCon;
int use_color;
int hasHscroll, hasVscroll, view_h, view_v;
int v_scroll_inc[2], h_scroll_inc[2];
int initialized;
int symbolMode;
int cursor;
RECT clip_rect;
int clipped;
LOGPEN drawPen;
int rect_offset;
int bPrinting;
int cxPrintPos, cyPrintPos;
} StGWWinInfo;
/* Access Defines */
#define SETWINOBJECT(w, d) SetWindowLong((HWND) (w), 0, (LONG) (d))
#define GETWINOBJECT(w) ((LVAL) GetWindowLong((HWND) (w), 0))
#define SETGWINFO(w, d) SetWindowLong((HWND) (w), 4, (LONG) (d))
#define GETGWINFO(w) ((StGWWinInfo *) GetWindowLong((HWND) (w), 4))
/* GDI defines */
#define GET_DC(w) (currentDC ? currentDC : GetDC((HWND) (w)))
#define RELEASE_DC(w, d) if (!currentDC) ReleaseDC((HWND) (w), (HDC) (d))
#define GET_DRAW_PEN(g) ((g)->drawPen)
#define RELEASE_PEN(p) DeleteObject(p);
#define SET_PEN(h,g) SelectObject(h, CreatePenIndirect(&GET_DRAW_PEN(g)))
#define RESTORE_PEN(h,p) RELEASE_PEN(SelectObject(h,p))
#define GET_DRAW_BRUSH(g) CreateSolidBrush(get_color((g)->drawColor))
#define GET_ERASE_BRUSH(g) CreateSolidBrush(get_color((g)->backColor))
#define SET_DRAW_BRUSH(h,g) SelectObject(h, GET_DRAW_BRUSH(g))
#define SET_ERASE_BRUSH(h,g) SelectObject(h, GET_ERASE_BRUSH(g))
#define RELEASE_BRUSH(b) DeleteObject(b)
#define RESTORE_BRUSH(h,b) RELEASE_BRUSH(SelectObject(h,b))
#endif /* _Windows */
extern StGWWinInfo *StGWObWinInfo _((LVAL object));
extern long StGWGetRefCon _((StGWWinInfo *));
extern long StGWGetColRefCon _((unsigned int index));
extern long StGWGetCursRefCon _((unsigned int index));
extern long StGWGetSymRefCon _((unsigned int index));
extern IVIEW_WINDOW IViewWindowNew _((LVAL object, int is_GW));
extern ColorCode StGWDrawColor _((StGWWinInfo *));
extern ColorCode StGWBackColor _((StGWWinInfo *));
extern LVAL IViewWindowGetObject _((IVIEW_WINDOW w));
StGWWinInfo *IViewWindowWinInfo _((IVIEW_WINDOW w));
extern IVIEW_WINDOW IViewNew _((LVAL object));
extern IVIEW_WINDOW IViewSpinNew _((LVAL object));
extern IVIEW_WINDOW IViewScatmatNew _((LVAL object));
extern IVIEW_WINDOW IViewListNew _((LVAL object));
extern IVIEW_WINDOW IViewHistNew _((LVAL object));
#define ARROW_CURSOR 0
#define WATCH_CURSOR 1
#define CROSS_CURSOR 2
#define BRUSH_CURSOR 3
#define HAND_CURSOR 4
#define FINGER_CURSOR 5
#define HOUR_GLASS_CURSOR 6
#define TRASH_BAG_CURSOR 7
#define TRASH_CAN_CURSOR 8
typedef char *IViewReallocData;
#ifdef MACINTOSH
#define Fixed Fixed_
#define FixRound FixRound_
#endif /* MACINTOSH */
typedef long Fixed;
typedef struct basic_points {
int num_points, num_variables;
double *scale, *location, **transformation;
IViewReallocData *data, *screen_data;
int recalculateScreenPoints, fixed;
} *IViewBasicPoints;
#define NOCOLOR 255
typedef unsigned char color_index;
typedef struct point_symbol {
int normal, highlighted;
} PointSymbol;
typedef struct point_info {
PointState state, screen_state;
char marked, masked;
color_index color;
PointSymbol symbol;
char *label;
} PointInfo;
typedef struct line_info {
int next, type;
char masked, width;
color_index color;
} LineInfo;
#ifdef USESTRINGS
typedef struct string_info {
char *string;
char masked, up, h, v;
color_index color;
} StringInfo;
#endif /* USESTRINGS */
typedef struct iview_data {
#ifdef USESTRINGS
IViewBasicPoints points, lines, strings;
IViewReallocData pointInfo, lineInfo, stringInfo;
#else
IViewBasicPoints points, lines;
IViewReallocData pointInfo, lineInfo;
#endif /* USESTRINGS */
double *mins, *maxes, *scale, *location;
int *screen_mins, *screen_maxes;
char **variableLabels;
int recalculateScreenPoints, transformed;
double **transformation;
} *IViewData;
#define IVIEW_WINDOW_NULL(w) (w == (IVIEW_WINDOW) 0)
|