source: trunk/kitgen/8.x/blt/generic/bltInt.h

Last change on this file was 175, checked in by demin, 12 years ago

initial commit

File size: 26.5 KB
Line 
1
2/*
3 * bltInt.h --
4 *
5 * Copyright 1993-1998 Lucent Technologies, Inc.
6 *
7 * Permission to use, copy, modify, and distribute this software and
8 * its documentation for any purpose and without fee is hereby
9 * granted, provided that the above copyright notice appear in all
10 * copies and that both that the copyright notice and warranty
11 * disclaimer appear in supporting documentation, and that the names
12 * of Lucent Technologies any of their entities not be used in
13 * advertising or publicity pertaining to distribution of the software
14 * without specific, written prior permission.
15 *
16 * Lucent Technologies disclaims all warranties with regard to this
17 * software, including all implied warranties of merchantability and
18 * fitness. In no event shall Lucent Technologies be liable for any
19 * special, indirect or consequential damages or any damages
20 * whatsoever resulting from loss of use, data or profits, whether in
21 * an action of contract, negligence or other tortuous action, arising
22 * out of or in connection with the use or performance of this
23 * software.
24 */
25
26#ifndef _BLT_INT_H
27#define _BLT_INT_H
28
29#ifdef WIN32
30#define STRICT
31#define WIN32_LEAN_AND_MEAN
32#include <windows.h>
33#undef STRICT
34#undef WIN32_LEAN_AND_MEAN
35#include <windowsx.h>
36#endif /* WIN32 */
37
38#define USE_NON_CONST
39#include <tcl.h>
40#define USE_COMPOSITELESS_PHOTO_PUT_BLOCK
41#include <tk.h>
42
43#define _VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
44#define TCL_VERSION_NUMBER _VERSION(TCL_MAJOR_VERSION, TCL_MINOR_VERSION, TCL_RELEASE_SERIAL)
45#define TK_VERSION_NUMBER _VERSION(TK_MAJOR_VERSION, TK_MINOR_VERSION, TK_RELEASE_SERIAL)
46
47#include "bltTkInt.h"
48
49#include <stdio.h>
50#include <assert.h>
51
52#if defined(WIN32) && !defined(__GNUC__)
53#include "bltWinConfig.h"
54#else
55#include "bltConfig.h"
56#endif
57
58#ifdef WIN32
59#ifndef EXPORT
60#if defined(_MSC_VER) || defined(__BORLANDC__)
61#define EXPORT __declspec(dllexport)
62#else
63#define EXPORT
64#endif /* _MSC_VER || __BORLANDC__ */
65#endif /* EXPORT */
66
67/* Misc. definitions */
68#define NO_CUTBUFFER 1
69#define NO_TILESCROLLBAR 1
70#define NO_DND 1
71
72#ifndef __GNUC__
73#ifdef O_NONBLOCK
74#define O_NONBLOCK 1
75#endif
76#endif /* __GNUC__ */
77#endif /* WIN32 */
78
79#include "blt.h"
80#include "bltNsUtil.h"
81
82#ifdef HAVE_STDLIB_H
83#include <stdlib.h>
84#endif /* HAVE_STDLIB_H */
85
86#ifdef HAVE_STRING_H
87#include <string.h>
88#endif /* HAVE_STRING_H */
89
90#ifdef HAVE_ERRNO_H
91#include <errno.h>
92#endif /* HAVE_ERRNO_H */
93
94#ifdef HAVE_CTYPE_H
95#include <ctype.h>
96#endif /* HAVE_CTYPE_H */
97
98#ifdef HAVE_MEMORY_H
99#include <memory.h>
100#endif /* HAVE_MEMORY_H */
101
102#ifdef HAVE_UNISTD_H
103#include <unistd.h>
104#endif /* HAVE_UNISTD_H */
105
106#ifdef HAVE_LIMITS_H
107#include <limits.h>
108#endif
109
110#include "bltMath.h"
111
112#undef INLINE
113#ifdef __GNUC__
114#define INLINE inline
115#else
116#define INLINE
117#endif
118#undef EXPORT
119#define EXPORT
120
121#undef VARARGS
122#ifdef __cplusplus
123#define ANYARGS (...)
124#define VARARGS(first) (first, ...)
125#define VARARGS2(first, second) (first, second, ...)
126#else
127#define ANYARGS ()
128#define VARARGS(first) ()
129#define VARARGS2(first, second) ()
130#endif /* __cplusplus */
131
132#undef MIN
133#define MIN(a,b) (((a)<(b))?(a):(b))
134
135#undef MAX
136#define MAX(a,b) (((a)>(b))?(a):(b))
137
138#undef MIN3
139#define MIN3(a,b,c) (((a)<(b))?(((a)<(c))?(a):(c)):(((b)<(c))?(b):(c)))
140
141#undef MAX3
142#define MAX3(a,b,c) (((a)>(b))?(((a)>(c))?(a):(c)):(((b)>(c))?(b):(c)))
143
144#define TRUE 1
145#define FALSE 0
146
147/*
148 * The macro below is used to modify a "char" value (e.g. by casting
149 * it to an unsigned character) so that it can be used safely with
150 * macros such as isspace.
151 */
152#define UCHAR(c) ((unsigned char) (c))
153
154#undef panic
155#define panic(mesg) Blt_Panic("%s:%d %s", __FILE__, __LINE__, (mesg))
156
157/*
158 * Since the Tcl/Tk distribution doesn't perform any asserts, dynamic
159 * loading can fail to find the __assert function. As a workaround,
160 * we'll include our own.
161 */
162#undef assert
163#ifdef NDEBUG
164#define assert(EX) ((void)0)
165#else
166extern void Blt_Assert _ANSI_ARGS_((char *expr, char *file, int line));
167#ifdef __STDC__
168#define assert(EX) (void)((EX) || (Blt_Assert(#EX, __FILE__, __LINE__), 0))
169#else
170#define assert(EX) (void)((EX) || (Blt_Assert("EX", __FILE__, __LINE__), 0))
171#endif /* __STDC__ */
172
173#endif /* NDEBUG */
174
175#if (TCL_MAJOR_VERSION >= 8)
176extern Tcl_Obj *bltEmptyStringObjPtr;
177#endif /* TCL_MAJOR_VERSION >= 8 */
178
179/*
180 * ----------------------------------------------------------------------
181 *
182 * Blt_CmdSpec --
183 *
184 * ----------------------------------------------------------------------
185 */
186typedef struct {
187 char *name; /* Name of command */
188 Tcl_CmdProc *cmdProc;
189 Tcl_CmdDeleteProc *cmdDeleteProc;
190 ClientData clientData;
191} Blt_CmdSpec;
192
193#if (TCL_MAJOR_VERSION >= 8)
194/*
195 * ----------------------------------------------------------------------
196 *
197 * Blt_CmdSpec --
198 *
199 * ----------------------------------------------------------------------
200 */
201typedef struct {
202 char *name; /* Name of command */
203 Tcl_ObjCmdProc *cmdProc;
204 Tcl_CmdDeleteProc *cmdDeleteProc;
205 ClientData clientData;
206} Blt_ObjCmdSpec;
207
208#endif /* TCL_MAJOR_VERSION >= 8 */
209
210/*
211 * ----------------------------------------------------------------------
212 *
213 * Blt_Op --
214 *
215 * Generic function prototype of CmdOptions.
216 *
217 * ----------------------------------------------------------------------
218 */
219typedef int (*Blt_Op) _ANSI_ARGS_(ANYARGS);
220
221/*
222 * ----------------------------------------------------------------------
223 *
224 * Blt_OpSpec --
225 *
226 * Structure to specify a set of operations for a Tcl command.
227 * This is passed to the Blt_GetOp procedure to look
228 * for a function pointer associated with the operation name.
229 *
230 * ----------------------------------------------------------------------
231 */
232typedef struct {
233 char *name; /* Name of operation */
234 int minChars; /* Minimum # characters to disambiguate */
235 Blt_Op proc;
236 int minArgs; /* Minimum # args required */
237 int maxArgs; /* Maximum # args required */
238 char *usage; /* Usage message */
239
240} Blt_OpSpec;
241
242typedef enum {
243 BLT_OP_ARG0, /* Op is the first argument. */
244 BLT_OP_ARG1, /* Op is the second argument. */
245 BLT_OP_ARG2, /* Op is the third argument. */
246 BLT_OP_ARG3, /* Op is the fourth argument. */
247 BLT_OP_ARG4 /* Op is the fifth argument. */
248
249} Blt_OpIndex;
250
251#define BLT_OP_LINEAR_SEARCH 1
252#define BLT_OP_BINARY_SEARCH 0
253
254extern Blt_Op Blt_GetOp _ANSI_ARGS_((Tcl_Interp *interp, int nSpecs,
255 Blt_OpSpec *specArr, int operPos, int argc, char **argv, int flags));
256
257#if (TCL_VERSION_NUMBER >= _VERSION(8,0,0))
258extern Blt_Op Blt_GetOpFromObj _ANSI_ARGS_((Tcl_Interp *interp,
259 int nSpecs, Blt_OpSpec *specArr, int operPos, int objc,
260 Tcl_Obj *CONST *objv, int flags));
261#endif
262
263/*
264 * ----------------------------------------------------------------------
265 *
266 * Assume we need to declare free if there's no stdlib.h or malloc.h
267 *
268 * ----------------------------------------------------------------------
269 */
270#if !defined(HAVE_STDLIB_H) && !defined(HAVE_MALLOC_H)
271extern void free _ANSI_ARGS_((void *));
272#endif
273
274#define free(x) abc123(x)
275
276extern int Blt_DictionaryCompare _ANSI_ARGS_((char *s1, char *s2));
277
278EXTERN void Blt_Panic _ANSI_ARGS_(TCL_VARARGS(char *, args));
279
280
281extern void Blt_Draw3DRectangle _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable,
282 Tk_3DBorder border, int x, int y, int width, int height,
283 int borderWidth, int relief));
284extern void Blt_Fill3DRectangle _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable,
285 Tk_3DBorder border, int x, int y, int width, int height,
286 int borderWidth, int relief));
287
288#ifdef notdef
289#define Blt_Fill3DRectangle Tk_Fill3DRectangle
290#define Blt_Draw3DRectangle Tk_Draw3DRectangle
291#endif
292
293/* ---------------------------------------------------------------- */
294
295
296#define PIXELS_NONNEGATIVE 0
297#define PIXELS_POSITIVE 1
298#define PIXELS_ANY 2
299
300#define COUNT_NONNEGATIVE 0
301#define COUNT_POSITIVE 1
302#define COUNT_ANY 2
303
304#define BLT_SCROLL_MODE_CANVAS (1<<0)
305#define BLT_SCROLL_MODE_LISTBOX (1<<1)
306#define BLT_SCROLL_MODE_HIERBOX (1<<2)
307
308#define RGB_ANTIQUEWHITE1 "#ffefdb"
309#define RGB_BISQUE1 "#ffe4c4"
310#define RGB_BISQUE2 "#eed5b7"
311#define RGB_BISQUE3 "#cdb79e"
312#define RGB_BLACK "#000000"
313#define RGB_BLUE "#0000ff"
314#define RGB_GREEN "#00ff00"
315#define RGB_GREY "#b0b0b0"
316#define RGB_GREY15 "#262626"
317#define RGB_GREY50 "#7f7f7f"
318#define RGB_GREY64 "#a3a3a3"
319#define RGB_GREY70 "#b3b3b3"
320#define RGB_GREY75 "#bfbfbf"
321#define RGB_GREY77 "#c3c3c3"
322#define RGB_GREY82 "#d1d1d1"
323#define RGB_GREY85 "#d9d9d9"
324#define RGB_GREY90 "#e5e5e5"
325#define RGB_GREY95 "#f2f2f2"
326#define RGB_LIGHTBLUE0 "#e4f7ff"
327#define RGB_LIGHTBLUE1 "#bfefff"
328#define RGB_LIGHTBLUE2 "#b2dfee"
329#define RGB_LIGHTSKYBLUE1 "#b0e2ff"
330#define RGB_MAROON "#b03060"
331#define RGB_NAVYBLUE "#000080"
332#define RGB_PINK "#ffc0cb"
333#define RGB_BISQUE1 "#ffe4c4"
334#define RGB_RED "#ff0000"
335#define RGB_WHITE "#ffffff"
336#define RGB_YELLOW "#ffff00"
337
338#ifdef OLD_TK_COLORS
339#define STD_NORMAL_BACKGROUND RGB_BISQUE1
340#define STD_ACTIVE_BACKGROUND RGB_BISQUE2
341#define STD_SELECT_BACKGROUND RGB_LIGHTBLUE1
342#define STD_DISABLE_FOREGROUND RGB_GREY64
343#else
344#define STD_NORMAL_BACKGROUND RGB_GREY85
345#define STD_ACTIVE_BACKGROUND RGB_GREY64
346#define STD_SELECT_BACKGROUND RGB_LIGHTBLUE1
347#define STD_DISABLE_FOREGROUND RGB_GREY64
348#endif /* OLD_TK_COLORS */
349
350#define STD_ACTIVE_BG_MONO RGB_BLACK
351#define STD_ACTIVE_FOREGROUND RGB_BLACK
352#define STD_ACTIVE_FG_MONO RGB_WHITE
353#define STD_BORDERWIDTH "2"
354#define STD_FONT "*-Helvetica-Medium-R-Normal-*-12-120-*"
355#define STD_FONT_HUGE "*-Helvetica-Medium-R-Normal-*-18-180-*"
356#define STD_FONT_LARGE "*-Helvetica-Medium-R-Normal-*-14-140-*"
357#define STD_FONT_SMALL "*-Helvetica-Medium-R-Normal-*-10-100-*"
358#define STD_INDICATOR_COLOR RGB_MAROON
359#define STD_NORMAL_BG_MONO RGB_WHITE
360#define STD_NORMAL_FOREGROUND RGB_BLACK
361#define STD_NORMAL_FG_MONO RGB_BLACK
362#define STD_SELECT_BG_MONO RGB_BLACK
363#define STD_SELECT_BORDERWIDTH "2"
364#define STD_SELECT_FOREGROUND RGB_BLACK
365#define STD_SELECT_FG_MONO RGB_WHITE
366#define STD_SHADOW_COLOR RGB_GREY64
367#define STD_SHADOW_MONO RGB_BLACK
368
369#define LineWidth(w) (((w) > 1) ? (w) : 0)
370
371#ifdef TCL_UTF_MAX
372#define HAVE_UTF 1
373extern FILE *Blt_OpenUtfFile _ANSI_ARGS_((char *fileName, char *mode));
374#define fopen(f,m) Blt_OpenUtfFile((f),(m));
375#else
376#define HAVE_UTF 0
377#endif /* TCL_UTF_MAX */
378
379typedef char *DestroyData;
380
381
382
383#ifndef TK_RELIEF_SOLID
384#define TK_RELIEF_SOLID TK_RELIEF_FLAT
385#endif
386
387/*
388 * Tcl/Tk Backward compatibility section.
389 */
390#if (TCL_MAJOR_VERSION > 7)
391
392#define NO_FLAGS 0
393#define Blt_FindPhoto(interp, name) Tk_FindPhoto(interp, name)
394
395#else
396
397#define Tcl_GetStringResult(interp) ((interp)->result)
398#define Blt_FindPhoto(interp, name) Tk_FindPhoto(name)
399
400#define Tcl_DeleteCommandFromToken(interp, token) \
401 Tcl_DeleteCommand(interp, Tcl_GetCommandName(interp, token))
402
403/*
404 *--------------------------------------------------------------
405 *
406 * The definitions below provide foreward compatibility for
407 * functions and types related to event handling that used to
408 * be in Tk but have moved to Tcl.
409 *
410 *--------------------------------------------------------------
411 */
412
413#define Tcl_IdleProc Tk_IdleProc
414#define Tcl_FileProc Tk_FileProc
415#define Tcl_TimerProc Tk_TimerProc
416#define Tcl_TimerToken Tk_TimerToken
417
418#define Tcl_BackgroundError Tk_BackgroundError
419#define Tcl_CancelIdleCall Tk_CancelIdleCall
420
421#define Tcl_CreateTimerHandler Tk_CreateTimerHandler
422#define Tcl_DeleteTimerHandler Tk_DeleteTimerHandler
423#define Tcl_DoOneEvent Tk_DoOneEvent
424#define Tcl_DoWhenIdle Tk_DoWhenIdle
425#define Tcl_Sleep Tk_Sleep
426
427/* Additional stuff that has moved to Tcl: */
428
429#define Tcl_AfterCmd Tk_AfterCmd
430#define Tcl_EventuallyFree Tk_EventuallyFree
431#define Tcl_FreeProc Tk_FreeProc
432#define Tcl_Preserve Tk_Preserve
433#define Tcl_Release Tk_Release
434
435#endif /* TCL_MAJOR_VERSION > 7 */
436
437typedef int (QSortCompareProc) _ANSI_ARGS_((const void *, const void *));
438
439
440/*
441 * ----------------------------------------------------------------------
442 *
443 * Blt_Pad --
444 *
445 * Specifies vertical and horizontal padding.
446 *
447 * Padding can be specified on a per side basis. The fields
448 * side1 and side2 refer to the opposite sides, either
449 * horizontally or vertically.
450 *
451 * side1 side2
452 * ----- -----
453 * x | left right
454 * y | top bottom
455 *
456 * ----------------------------------------------------------------------
457 */
458typedef struct {
459 short int side1, side2;
460} Blt_Pad;
461
462#define padLeft padX.side1
463#define padRight padX.side2
464#define padTop padY.side1
465#define padBottom padY.side2
466#define PADDING(x) ((x).side1 + (x).side2)
467
468/*
469 * ----------------------------------------------------------------------
470 *
471 * The following enumerated values are used as bit flags.
472 * FILL_NONE Neither coordinate plane is specified
473 * FILL_X Horizontal plane.
474 * FILL_Y Vertical plane.
475 * FILL_BOTH Both vertical and horizontal planes.
476 *
477 * ----------------------------------------------------------------------
478 */
479#define FILL_NONE 0
480#define FILL_X 1
481#define FILL_Y 2
482#define FILL_BOTH 3
483
484/*
485 * ----------------------------------------------------------------------
486 *
487 * Blt_Dashes --
488 *
489 * List of dash values (maximum 11 based upon PostScript limit).
490 *
491 * ----------------------------------------------------------------------
492 */
493typedef struct {
494 unsigned char values[12];
495 int offset;
496} Blt_Dashes;
497
498#define LineIsDashed(d) ((d).values[0] != 0)
499
500extern void Blt_SetDashes _ANSI_ARGS_((Display *display, GC gc,
501 Blt_Dashes *dashesPtr));
502extern Blt_Dashes *Blt_GetDashes _ANSI_ARGS_((GC gc));
503
504/*
505 * -------------------------------------------------------------------
506 *
507 * Point2D --
508 *
509 * 2-D coordinate.
510 *
511 * -------------------------------------------------------------------
512 */
513typedef struct {
514 double x, y;
515} Point2D;
516
517/*
518 * -------------------------------------------------------------------
519 *
520 * Point3D --
521 *
522 * 3-D coordinate.
523 *
524 * -------------------------------------------------------------------
525 */
526typedef struct {
527 double x, y, z;
528} Point3D;
529
530/*
531 * -------------------------------------------------------------------
532 *
533 * Segment2D --
534 *
535 * 2-D line segment.
536 *
537 * -------------------------------------------------------------------
538 */
539typedef struct {
540 Point2D p, q; /* The two end points of the segment. */
541} Segment2D;
542
543/*
544 * -------------------------------------------------------------------
545 *
546 * Dim2D --
547 *
548 * 2-D dimension.
549 *
550 * -------------------------------------------------------------------
551 */
552typedef struct {
553 short int width, height;
554} Dim2D;
555
556/*
557 *----------------------------------------------------------------------
558 *
559 * Region2D --
560 *
561 * 2-D region. Used to copy parts of images.
562 *
563 *----------------------------------------------------------------------
564 */
565typedef struct {
566 int left, right, top, bottom;
567} Region2D;
568
569#define RegionWidth(r) ((r)->right - (r)->left + 1)
570#define RegionHeight(r) ((r)->bottom - (r)->top + 1)
571
572typedef struct {
573 double left, right, top, bottom;
574} Extents2D;
575
576typedef struct {
577 double left, right, top, bottom, front, back;
578} Extents3D;
579
580#define PointInRegion(e,x,y) \
581 (((x) <= (e)->right) && ((x) >= (e)->left) && \
582 ((y) <= (e)->bottom) && ((y) >= (e)->top))
583
584#define PointInRectangle(r,x0,y0) \
585 (((x0) <= (int)((r)->x + (r)->width - 1)) && ((x0) >= (int)(r)->x) && \
586 ((y0) <= (int)((r)->y + (r)->height - 1)) && ((y0) >= (int)(r)->y))
587
588
589/* -------------------------------------------------------------------
590 *
591 * ColorPair --
592 *
593 * Holds a pair of foreground, background colors.
594 *
595 * -------------------------------------------------------------------
596 */
597typedef struct {
598 XColor *fgColor, *bgColor;
599} ColorPair;
600
601#define COLOR_NONE (XColor *)0
602#define COLOR_DEFAULT (XColor *)1
603#define COLOR_ALLOW_DEFAULTS 1
604
605extern int Blt_GetColorPair _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
606 char *fgColor, char *bgColor, ColorPair *pairPtr, int colorFlag));
607extern void Blt_FreeColorPair _ANSI_ARGS_((ColorPair *pairPtr));
608
609#define STATE_NORMAL 0
610#define STATE_ACTIVE (1<<0)
611#define STATE_DISABLED (1<<1)
612#define STATE_EMPHASIS (1<<2)
613
614
615#define ARROW_LEFT (0)
616#define ARROW_UP (1)
617#define ARROW_RIGHT (2)
618#define ARROW_DOWN (3)
619#define ARROW_OFFSET 4
620#define STD_ARROW_HEIGHT 3
621#define STD_ARROW_WIDTH ((2 * (ARROW_OFFSET - 1)) + 1)
622
623#include "bltText.h"
624
625/*
626 * ----------------------------------------------------------------------
627 *
628 * X11/Xosdefs.h requires XNOSTDHDRS be set for some systems.
629 * This is a guess. If I can't find STDC headers or unistd.h,
630 * assume that this is non-POSIX and non-STDC environment.
631 * (needed for Encore Umax 3.4 ?)
632 *
633 * ----------------------------------------------------------------------
634 */
635#if !defined(STDC_HEADERS) && !defined(HAVE_UNISTD_H)
636#define XNOSTDHDRS 1
637#endif
638
639extern char *Blt_Itoa _ANSI_ARGS_((int value));
640extern char *Blt_Utoa _ANSI_ARGS_((unsigned int value));
641extern char *Blt_Dtoa _ANSI_ARGS_((Tcl_Interp *interp, double value));
642extern Tcl_Command Blt_InitCmd _ANSI_ARGS_((Tcl_Interp *interp,
643 char *namespace, Blt_CmdSpec *specPtr));
644
645#if (TCL_VERSION_NUMBER >= _VERSION(8,0,0))
646extern Tcl_Command Blt_InitObjCmd _ANSI_ARGS_((Tcl_Interp *interp,
647 char *namespace, Blt_ObjCmdSpec *specPtr));
648#if (TCL_VERSION_NUMBER < _VERSION(8,1,0))
649extern char *Tcl_GetString _ANSI_ARGS_((Tcl_Obj *objPtr));
650extern int Tcl_EvalObjv _ANSI_ARGS_((Tcl_Interp *interp, int objc,
651 Tcl_Obj **objv, int flags));
652extern int Tcl_WriteObj _ANSI_ARGS_((Tcl_Channel channel, Tcl_Obj *objPtr));
653extern char *Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp *interp, char *part1,
654 char *part2, Tcl_Obj *objPtr, int flags));
655extern Tcl_Obj *Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp *interp, char *part1,
656 char *part2, int flags));
657#endif /* TCL_VERSION_NUMBER < 8.2.0 */
658#endif /* TCL_VERSION_NUMBER >= 8.0.0 */
659
660
661extern int Blt_InitCmds _ANSI_ARGS_((Tcl_Interp *interp, char *namespace,
662 Blt_CmdSpec *specPtr, int nCmds));
663
664extern int Blt_NaturalSpline _ANSI_ARGS_((Point2D *origPts, int nOrigPts,
665 Point2D *intpPts, int nIntpPts));
666
667extern int Blt_QuadraticSpline _ANSI_ARGS_((Point2D *origPts, int nOrigPts,
668 Point2D *intpPts, int nIntpPts));
669
670extern int Blt_SimplifyLine _ANSI_ARGS_((Point2D *origPts, int low, int high,
671 double tolerance, int indices[]));
672
673extern int Blt_NaturalParametricSpline _ANSI_ARGS_((Point2D *origPts,
674 int nOrigPts, Extents2D *extsPtr, int isClosed, Point2D *intpPts,
675 int nIntpPts));
676
677extern int Blt_CatromParametricSpline _ANSI_ARGS_((Point2D *origPts,
678 int nOrigPts, Point2D *intpPts, int nIntpPts));
679
680extern int Blt_StringToFlag _ANSI_ARGS_((ClientData clientData,
681 Tcl_Interp *interp, Tk_Window tkwin, char *string, char *widgRec,
682 int flags));
683extern char *Blt_FlagToString _ANSI_ARGS_((ClientData clientData,
684 Tk_Window tkwin, char *string, int offset, Tcl_FreeProc **freeProc));
685
686extern void Blt_InitHexTable _ANSI_ARGS_((char *table));
687
688extern GC Blt_GetPrivateGC _ANSI_ARGS_((Tk_Window tkwin, unsigned long gcMask,
689 XGCValues *valuePtr));
690
691extern GC Blt_GetPrivateGCFromDrawable _ANSI_ARGS_((Display *display,
692 Drawable drawable, unsigned long gcMask, XGCValues *valuePtr));
693
694extern void Blt_FreePrivateGC _ANSI_ARGS_((Display *display, GC gc));
695
696extern Tk_Window Blt_FindChild _ANSI_ARGS_((Tk_Window parent, char *name));
697
698extern Tk_Window Blt_FirstChild _ANSI_ARGS_((Tk_Window parent));
699
700extern Tk_Window Blt_NextChild _ANSI_ARGS_((Tk_Window tkwin));
701
702extern void Blt_RelinkWindow _ANSI_ARGS_((Tk_Window tkwin, Tk_Window newParent,
703 int x, int y));
704
705extern Tk_Window Blt_Toplevel _ANSI_ARGS_((Tk_Window tkwin));
706
707extern int Blt_GetPixels _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
708 char *string, int check, int *valuePtr));
709extern int Blt_GetPosition _ANSI_ARGS_((Tcl_Interp *interp, char *string,
710 int *indexPtr));
711extern int Blt_GetCount _ANSI_ARGS_((Tcl_Interp *interp, char *string,
712 int check, int *valuePtr));
713
714extern char *Blt_NameOfFill _ANSI_ARGS_((int fill));
715
716extern int Blt_GetXY _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
717 char *string, int *x, int *y));
718
719extern Point2D Blt_GetProjection _ANSI_ARGS_((int x, int y, Point2D *p,
720 Point2D *q));
721
722extern void Blt_DrawArrow _ANSI_ARGS_((Display *display, Drawable drawable,
723 GC gc, int x, int y, int arrowHeight, int orientation));
724
725extern Tk_OptionParseProc Blt_StringToEnum;
726extern Tk_OptionPrintProc Blt_EnumToString;
727
728extern int Blt_ConfigModified _ANSI_ARGS_(TCL_VARARGS(Tk_ConfigSpec *, specs));
729
730extern void Blt_DStringAppendElements _ANSI_ARGS_(TCL_VARARGS(Tcl_DString *, args));
731
732extern void Blt_MakeTransparentWindowExist _ANSI_ARGS_((Tk_Window tkwin,
733 Window parent, int isBusy));
734
735extern Window Blt_GetParent _ANSI_ARGS_((Display *display, Window tkwin));
736
737extern void Blt_GetBoundingBox _ANSI_ARGS_((int width, int height,
738 double theta, double *widthPtr, double *heightPtr, Point2D *points));
739
740extern void Blt_InitEpsCanvasItem _ANSI_ARGS_((Tcl_Interp *interp));
741
742extern void Blt_TranslateAnchor _ANSI_ARGS_((int x, int y, int width,
743 int height, Tk_Anchor anchor, int *transXPtr, int *transYPtr));
744
745extern Point2D Blt_TranslatePoint _ANSI_ARGS_((Point2D *pointPtr, int width,
746 int height, Tk_Anchor anchor));
747
748extern int Blt_ConfigureWidgetComponent _ANSI_ARGS_((Tcl_Interp *interp,
749 Tk_Window tkwin, char *name, char *class, Tk_ConfigSpec *specs,
750 int argc, char **argv, char *widgRec, int flags));
751
752extern void Blt_HSV _ANSI_ARGS_((XColor *colorPtr, double *huePtr,
753 double *valPtr, double *satPtr));
754
755extern void Blt_RGB _ANSI_ARGS_((double hue, double sat, double val,
756 XColor *colorPtr));
757
758extern int Blt_ParseFlag _ANSI_ARGS_((ClientData, Tcl_Interp *, Tk_Window,
759 char *, char *, int));
760extern char *Blt_FlagPrint _ANSI_ARGS_((ClientData, Tk_Window, char *, int,
761 Tcl_FreeProc **));
762
763extern int Blt_MaxRequestSize _ANSI_ARGS_((Display *display,
764 unsigned int elemSize));
765
766extern Window Blt_GetRealWindowId _ANSI_ARGS_((Tk_Window tkwin));
767extern int Blt_RootX _ANSI_ARGS_((Tk_Window tkwin));
768extern int Blt_RootY _ANSI_ARGS_((Tk_Window tkwin));
769extern void Blt_RootCoordinates _ANSI_ARGS_((Tk_Window tkwin, int x, int y,
770 int *rootXPtr, int *rootYPtr));
771extern void Blt_MapToplevel _ANSI_ARGS_((Tk_Window tkwin));
772extern void Blt_UnmapToplevel _ANSI_ARGS_((Tk_Window tkwin));
773extern void Blt_RaiseToplevel _ANSI_ARGS_((Tk_Window tkwin));
774extern void Blt_LowerToplevel _ANSI_ARGS_((Tk_Window tkwin));
775extern void Blt_ResizeToplevel _ANSI_ARGS_((Tk_Window tkwin,
776 int width, int height));
777extern void Blt_MoveToplevel _ANSI_ARGS_((Tk_Window tkwin, int x, int y));
778extern void Blt_MoveResizeToplevel _ANSI_ARGS_((Tk_Window tkwin,
779 int x, int y, int width, int height));
780extern ClientData Blt_GetWindowInstanceData _ANSI_ARGS_((Tk_Window tkwin));
781
782extern void Blt_SetWindowInstanceData _ANSI_ARGS_((Tk_Window tkwin,
783 ClientData instanceData));
784
785extern void Blt_DeleteWindowInstanceData _ANSI_ARGS_((Tk_Window tkwin));
786
787extern int Blt_AdjustViewport _ANSI_ARGS_((int offset, int worldSize,
788 int windowSize, int scrollUnits, int scrollMode));
789
790extern int Blt_GetScrollInfo _ANSI_ARGS_((Tcl_Interp *interp, int argc,
791 char **argv, int *offsetPtr, int worldSize, int windowSize,
792 int scrollUnits, int scrollMode));
793
794#if (TK_MAJOR_VERSION >= 8)
795extern int Blt_GetScrollInfoFromObj _ANSI_ARGS_((Tcl_Interp *interp, int objc,
796 Tcl_Obj *CONST *objv, int *offsetPtr, int worldSize, int windowSize,
797 int scrollUnits, int scrollMode));
798#endif
799
800extern void Blt_UpdateScrollbar _ANSI_ARGS_((Tcl_Interp *interp,
801 char *scrollCmd, double firstFract, double lastFract));
802
803extern int Blt_ReparentWindow _ANSI_ARGS_((Display *display, Window window,
804 Window newParent, int x, int y));
805
806#if defined(HAVE_JPEGLIB_H) || defined(HAVE_IJL_H)
807#define HAVE_JPEG 1
808extern int Blt_JPEGToPhoto _ANSI_ARGS_((Tcl_Interp *interp, char *fileName,
809 Tk_PhotoHandle photo));
810#endif /* HAVE_JPEGLIB_H || HAVE_IJL_H */
811
812#define Blt_SetBooleanResult(i, b) \
813 Tcl_SetResult((i), (b) ? "1" : "0", TCL_STATIC)
814
815/*
816 * Define this if you want to be able to tile to the main window "."
817 * This will cause a conflict with Tk if you try to compile and link
818 * statically.
819 */
820#undef TILE_MAINWINDOW
821
822#ifdef WIN32
823#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 0)
824#else
825#define NO_DDE 1
826#endif
827#else
828#define NO_DDE 1
829#define NO_PRINTER 1
830#endif /* WIN32 */
831
832#if (TCL_MAJOR_VERSION == 7)
833#define NO_TREE 1
834#define NO_ARRAY 1
835#define NO_TREEVIEW 1
836#endif
837
838/* #define NO_TED */
839
840#ifndef NO_BEEP
841extern Tcl_AppInitProc Blt_BeepInit;
842#endif
843#ifndef NO_BGEXEC
844extern Tcl_AppInitProc Blt_BgexecInit;
845#endif
846#ifndef NO_BITMAP
847extern Tcl_AppInitProc Blt_BitmapInit;
848#endif
849#ifndef NO_BUSY
850extern Tcl_AppInitProc Blt_BusyInit;
851#endif
852#ifndef NO_CONTAINER
853extern Tcl_AppInitProc Blt_ContainerInit;
854#endif
855#ifndef NO_CRC32
856extern Tcl_AppInitProc Blt_Crc32Init;
857#endif
858#ifndef NO_CUTBUFFER
859extern Tcl_AppInitProc Blt_CutbufferInit;
860#endif
861#ifndef NO_DEBUG
862extern Tcl_AppInitProc Blt_DebugInit;
863#endif
864#ifndef NO_DRAGDROP
865extern Tcl_AppInitProc Blt_DragDropInit;
866#endif
867#ifndef NO_DND
868extern Tcl_AppInitProc Blt_DndInit;
869#endif
870#ifndef NO_GRAPH
871extern Tcl_AppInitProc Blt_GraphInit;
872#endif
873#ifndef NO_HIERBOX
874extern Tcl_AppInitProc Blt_HierboxInit;
875#endif
876#ifndef NO_HIERTABLE
877extern Tcl_AppInitProc Blt_HiertableInit;
878#endif
879#ifndef NO_HTEXT
880extern Tcl_AppInitProc Blt_HtextInit;
881#endif
882#ifdef WIN32
883#ifndef NO_PRINTER
884extern Tcl_AppInitProc Blt_PrinterInit;
885#endif
886#endif
887#ifndef NO_TABLE
888extern Tcl_AppInitProc Blt_TableInit;
889#endif
890#ifndef NO_VECTOR
891extern Tcl_AppInitProc Blt_VectorInit;
892#endif
893#ifndef NO_WINOP
894extern Tcl_AppInitProc Blt_WinopInit;
895#endif
896#ifndef NO_WATCH
897extern Tcl_AppInitProc Blt_WatchInit;
898#endif
899#ifndef NO_SPLINE
900extern Tcl_AppInitProc Blt_SplineInit;
901#endif
902#ifndef NO_TABSET
903extern Tcl_AppInitProc Blt_TabsetInit;
904#endif
905#ifndef NO_TABNOTEBOOK
906extern Tcl_AppInitProc Blt_TabnotebookInit;
907#endif
908#ifndef NO_TREE
909extern Tcl_AppInitProc Blt_TreeInit;
910#endif
911#ifndef NO_TREEVIEW
912extern Tcl_AppInitProc Blt_TreeViewInit;
913#endif
914#ifndef NO_TILEFRAME
915extern Tcl_AppInitProc Blt_FrameInit;
916#endif
917#ifndef NO_TILEBUTTON
918extern Tcl_AppInitProc Blt_ButtonInit;
919#endif
920#ifndef NO_TILESCROLLBAR
921extern Tcl_AppInitProc Blt_ScrollbarInit;
922#endif
923
924#if (BLT_MAJOR_VERSION == 3)
925#ifndef NO_MOUNTAIN
926extern Tcl_AppInitProc Blt_MountainInit;
927#endif
928#endif
929#ifndef NO_TED
930extern Tcl_AppInitProc Blt_TedInit;
931#endif
932
933#ifndef NO_DDE
934extern Tcl_AppInitProc Blt_DdeInit;
935#endif
936
937typedef void *(Blt_MallocProc) _ANSI_ARGS_((size_t size));
938typedef void *(Blt_CallocProc) _ANSI_ARGS_((int nElem, size_t size));
939typedef void *(Blt_ReallocProc) _ANSI_ARGS_((void *ptr, size_t size));
940typedef void *(Blt_FreeProc) _ANSI_ARGS_((void *ptr));
941
942EXTERN Blt_MallocProc *Blt_MallocProcPtr;
943EXTERN Blt_FreeProc *Blt_FreeProcPtr;
944EXTERN Blt_ReallocProc *Blt_ReallocProcPtr;
945
946#define Blt_Malloc(size) (*Blt_MallocProcPtr)(size)
947#define Blt_Free (*Blt_FreeProcPtr)
948#define Blt_Realloc(ptr, size) (*Blt_ReallocProcPtr)(ptr, size)
949
950EXTERN char *Blt_Strdup _ANSI_ARGS_((CONST char *ptr));
951EXTERN void *Blt_Calloc _ANSI_ARGS_((unsigned int nElem, size_t size));
952
953#ifdef WIN32
954#include "bltWin.h"
955#endif
956
957#ifndef WIN32
958#define PurifyPrintf printf
959#endif /* WIN32 */
960#endif /*_BLT_INT_H*/
Note: See TracBrowser for help on using the repository browser.