source: trunk/kitgen/8.x/blt/win/bltWin.h@ 199

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

initial commit

File size: 8.8 KB
Line 
1
2/*
3 * bltWin.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_WIN_H
27#define _BLT_WIN_H
28
29#define STRICT
30#define WIN32_LEAN_AND_MEAN
31#include <windows.h>
32#undef STRICT
33#undef WIN32_LEAN_AND_MEAN
34#include <windowsx.h>
35
36
37#undef STD_NORMAL_BACKGROUND
38#undef STD_NORMAL_FOREGROUND
39#undef STD_SELECT_BACKGROUND
40#undef STD_SELECT_FOREGROUND
41#undef STD_TEXT_FOREGROUND
42#undef STD_FONT
43#undef STD_FONT_LARGE
44#undef STD_FONT_SMALL
45
46#define STD_NORMAL_BACKGROUND "SystemButtonFace"
47#define STD_NORMAL_FOREGROUND "SystemButtonText"
48#define STD_SELECT_BACKGROUND "SystemHighlight"
49#define STD_SELECT_FOREGROUND "SystemHighlightText"
50#define STD_TEXT_FOREGROUND "SystemWindowText"
51#define STD_FONT "Arial 8"
52#define STD_FONT_LARGE "Arial 12"
53#define STD_FONT_SMALL "Arial 6"
54
55#ifdef CHECK_UNICODE_CALLS
56#define _UNICODE
57#define UNICODE
58#define __TCHAR_DEFINED
59typedef float *_TCHAR;
60#define _TCHAR_DEFINED
61typedef float *TCHAR;
62#endif /* CHECK_UNICODE_CALLS */
63
64/* DOS Encapsulated PostScript File Header */
65#pragma pack(2)
66typedef struct {
67 BYTE magic[4]; /* Magic number for a DOS EPS file
68 * C5,D0,D3,C6 */
69 DWORD psStart; /* Offset of PostScript section. */
70 DWORD psLength; /* Length of the PostScript section. */
71 DWORD wmfStart; /* Offset of Windows Meta File section. */
72 DWORD wmfLength; /* Length of Meta file section. */
73 DWORD tiffStart; /* Offset of TIFF section. */
74 DWORD tiffLength; /* Length of TIFF section. */
75 WORD checksum; /* Checksum of header. If FFFF, ignore. */
76} DOSEPSHEADER;
77#pragma pack()
78
79/* Aldus Portable Metafile Header */
80#pragma pack(2)
81typedef struct {
82 DWORD key; /* Type of metafile */
83 WORD hmf; /* Unused. Must be NULL. */
84 SMALL_RECT bbox; /* Bounding rectangle */
85 WORD inch; /* Units per inch. */
86 DWORD reserved; /* Unused. */
87 WORD checksum; /* XOR of previous fields (10 32-bit words). */
88} APMHEADER;
89#pragma pack()
90
91extern double hypot(double x, double y);
92extern int Blt_AsyncRead(int fd, char *buffer, unsigned int size);
93extern int Blt_AsyncWrite(int fd, char *buffer, unsigned int size);
94extern void Blt_CreateFileHandler(int fd, int flags, Tcl_FileProc * proc,
95 ClientData clientData);
96extern void Blt_DeleteFileHandler(int fd);
97extern int Blt_GetPlatformId(void);
98extern char *Blt_LastError(void);
99extern int Blt_GetOpenPrinter(Tcl_Interp *interp, const char *id,
100 Drawable *drawablePtr);
101extern int Blt_PrintDialog(Tcl_Interp *interp, Drawable *drawablePtr);
102extern int Blt_OpenPrinterDoc(Tcl_Interp *interp, const char *id);
103extern int Blt_ClosePrinterDoc(Tcl_Interp *interp, const char *id);
104extern void Blt_GetPrinterScale(HDC dc, double *xRatio, double *yRatio);
105extern int Blt_StartPrintJob(Tcl_Interp *interp, Drawable drawable);
106extern int Blt_EndPrintJob(Tcl_Interp *interp, Drawable drawable);
107
108#undef EXPORT
109#define EXPORT __declspec(dllexport)
110
111#ifdef _MSC_VER
112#define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
113#define strcasecmp(s1,s2) _stricmp(s1,s2)
114#define isnan(x) _isnan(x)
115#endif /* _MSC_VER */
116
117#ifdef __BORLANDC__
118#define isnan(x) _isnan(x)
119#endif
120
121#if defined(__BORLANDC__) || defined(_MSC_VER)
122#ifdef FINITE
123#undef FINITE
124#define FINITE(x) _finite(x)
125#endif
126#endif /* __BORLANDC__ || _MSC_VER */
127
128#ifdef __GNUC__
129#include <wingdi.h>
130#include <windowsx.h>
131#undef Status
132#include <winspool.h>
133#define Status int
134/*
135 * Add definitions missing from windgi.h, windowsx.h, and winspool.h
136 */
137#include "missing.h"
138#endif /* __GNUC__ */
139
140#define XCopyArea Blt_EmulateXCopyArea
141#define XCopyPlane Blt_EmulateXCopyPlane
142#define XDrawArcs Blt_EmulateXDrawArcs
143#define XDrawLine Blt_EmulateXDrawLine
144#define XDrawLines Blt_EmulateXDrawLines
145#define XDrawPoints Blt_EmulateXDrawPoints
146#define XDrawRectangle Blt_EmulateXDrawRectangle
147#define XDrawRectangles Blt_EmulateXDrawRectangles
148#define XDrawSegments Blt_EmulateXDrawSegments
149#define XDrawString Blt_EmulateXDrawString
150#define XFillArcs Blt_EmulateXFillArcs
151#define XFillPolygon Blt_EmulateXFillPolygon
152#define XFillRectangle Blt_EmulateXFillRectangle
153#define XFillRectangles Blt_EmulateXFillRectangles
154#define XFree Blt_EmulateXFree
155#define XGetWindowAttributes Blt_EmulateXGetWindowAttributes
156#define XLowerWindow Blt_EmulateXLowerWindow
157#define XMaxRequestSize Blt_EmulateXMaxRequestSize
158#define XRaiseWindow Blt_EmulateXRaiseWindow
159#define XReparentWindow Blt_EmulateXReparentWindow
160#define XSetDashes Blt_EmulateXSetDashes
161#define XUnmapWindow Blt_EmulateXUnmapWindow
162#define XWarpPointer Blt_EmulateXWarpPointer
163
164EXTERN GC Blt_EmulateXCreateGC(Display *display, Drawable drawable,
165 unsigned long mask, XGCValues *valuesPtr);
166EXTERN void Blt_EmulateXCopyArea(Display *display, Drawable src, Drawable dest,
167 GC gc, int src_x, int src_y, unsigned int width, unsigned int height,
168 int dest_x, int dest_y);
169EXTERN void Blt_EmulateXCopyPlane(Display *display, Drawable src,
170 Drawable dest, GC gc, int src_x, int src_y, unsigned int width,
171 unsigned int height, int dest_x, int dest_y, unsigned long plane);
172EXTERN void Blt_EmulateXDrawArcs(Display *display, Drawable drawable, GC gc,
173 XArc *arcArr, int nArcs);
174EXTERN void Blt_EmulateXDrawLine(Display *display, Drawable drawable, GC gc,
175 int x1, int y1, int x2, int y2);
176EXTERN void Blt_EmulateXDrawLines(Display *display, Drawable drawable, GC gc,
177 XPoint *pointArr, int nPoints, int mode);
178EXTERN void Blt_EmulateXDrawPoints(Display *display, Drawable drawable, GC gc,
179 XPoint *pointArr, int nPoints, int mode);
180EXTERN void Blt_EmulateXDrawRectangle(Display *display, Drawable drawable,
181 GC gc, int x, int y, unsigned int width, unsigned int height);
182EXTERN void Blt_EmulateXDrawRectangles(Display *display, Drawable drawable,
183 GC gc, XRectangle *rectArr, int nRects);
184EXTERN void Blt_EmulateXDrawSegments(Display *display, Drawable drawable,
185 GC gc, XSegment *segArr, int nSegments);
186EXTERN void Blt_EmulateXDrawSegments(Display *display, Drawable drawable,
187 GC gc, XSegment *segArr, int nSegments);
188EXTERN void Blt_EmulateXDrawString(Display *display, Drawable drawable, GC gc,
189 int x, int y, _Xconst char *string, int length);
190EXTERN void Blt_EmulateXFillArcs(Display *display, Drawable drawable, GC gc,
191 XArc *arcArr, int nArcs);
192EXTERN void Blt_EmulateXFillPolygon(Display *display, Drawable drawable,
193 GC gc, XPoint *points, int nPoints, int shape, int mode);
194EXTERN void Blt_EmulateXFillRectangle(Display *display, Drawable drawable,
195 GC gc, int x, int y, unsigned int width, unsigned int height);
196EXTERN void Blt_EmulateXFillRectangles(Display *display, Drawable drawable,
197 GC gc, XRectangle *rectArr, int nRects);
198EXTERN void Blt_EmulateXFree(void *ptr);
199EXTERN int Blt_EmulateXGetWindowAttributes(Display *display, Window window,
200 XWindowAttributes * attrsPtr);
201EXTERN void Blt_EmulateXLowerWindow(Display *display, Window window);
202EXTERN void Blt_EmulateXMapWindow(Display *display, Window window);
203EXTERN long Blt_EmulateXMaxRequestSize(Display *display);
204EXTERN void Blt_EmulateXRaiseWindow(Display *display, Window window);
205EXTERN void Blt_EmulateXReparentWindow(Display *display, Window window,
206 Window parent, int x, int y);
207EXTERN void Blt_EmulateXSetDashes(Display *display, GC gc, int dashOffset,
208 _Xconst char *dashList, int n);
209EXTERN void Blt_EmulateXUnmapWindow(Display *display, Window window);
210EXTERN void Blt_EmulateXWarpPointer(Display *display, Window srcWindow,
211 Window destWindow, int srcX, int srcY, unsigned int srcWidth,
212 unsigned int srcHeight, int destX, int destY);
213
214EXTERN void Blt_DrawLine2D(Display *display, Drawable drawable, GC gc,
215 POINT *screenPts, int nScreenPts);
216
217extern unsigned char *Blt_GetBitmapData _ANSI_ARGS_((Display *display,
218 Pixmap bitmap, int width, int height, int *pitchPtr));
219
220extern HFONT Blt_CreateRotatedFont _ANSI_ARGS_((Tk_Window tkwin,
221 unsigned long font, double theta));
222
223extern HPALETTE Blt_GetSystemPalette _ANSI_ARGS_((void));
224
225extern HPEN Blt_GCToPen _ANSI_ARGS_((HDC dc, GC gc));
226
227#endif /*_BLT_WIN_H*/
Note: See TracBrowser for help on using the repository browser.