aboutsummaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorlecoanet2004-05-10 15:35:25 +0000
committerlecoanet2004-05-10 15:35:25 +0000
commitd52537b88bc85808a821786790f1bb1d07f250b3 (patch)
tree179a27be9a16b47a98fa5529d3f3101a6f1f51a1 /win
parentbd0dbc880963f10c549711f8497693634eeede04 (diff)
downloadtkzinc-d52537b88bc85808a821786790f1bb1d07f250b3.zip
tkzinc-d52537b88bc85808a821786790f1bb1d07f250b3.tar.gz
tkzinc-d52537b88bc85808a821786790f1bb1d07f250b3.tar.bz2
tkzinc-d52537b88bc85808a821786790f1bb1d07f250b3.tar.xz
Tried to reduce dependancies to the rest of the code (headers);
This was done to limit the warnings due to redefined functions
Diffstat (limited to 'win')
-rw-r--r--win/WinPort.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/win/WinPort.c b/win/WinPort.c
index ecdbe03..6bd3bfa 100644
--- a/win/WinPort.c
+++ b/win/WinPort.c
@@ -28,8 +28,9 @@
#ifdef _WIN32
-#include "Geo.h"
-#include "Types.h"
+#include <tcl.h>
+#undef EXTERN
+#define EXTERN
#include <tkInt.h>
#include <tkWinInt.h>
#ifdef PTK
@@ -39,6 +40,14 @@
static const char rcsid[] = "$Id";
static const char compile_id[]="$Compile$";
+#ifndef MIN
+#define MIN(a, b) ((a) <= (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b) ((a) >= (b) ? (a) : (b))
+#endif
+
+
/*
*----------------------------------------------------------------------
*
@@ -54,12 +63,12 @@ static const char compile_id[]="$Compile$";
*
*----------------------------------------------------------------------
*/
-ZnBool
+int
ZnPointInRegion(TkRegion reg,
int x,
int y)
{
- return (ZnBool) PtInRegion((HRGN) reg, x, y);
+ return PtInRegion((HRGN) reg, x, y);
}
/*
@@ -131,9 +140,8 @@ ZnPolygonRegion(XPoint *points,
POINT *pts;
HRGN reg;
int i;
- char msg[256];
- pts = ZnMalloc(n*sizeof(POINT));
+ pts = (POINT *) ckalloc(n*sizeof(POINT));
for (i = 0; i < n; i++, points++) {
pts[i].x = points->x;
pts[i].y = points->y;
@@ -142,10 +150,9 @@ ZnPolygonRegion(XPoint *points,
reg = CreatePolygonRgn(pts, n,
fill_rule==EvenOddRule?ALTERNATE:WINDING);
if (!reg) {
- sprintf(msg, "Polygon region failed: %ld, n: %d\n", GetLastError(), n);
- OutputDebugString(msg);
+ fprintf(stderr, "Polygon region failed: %ld, n: %d\n", GetLastError(), n);
}
- ZnFree(pts);
+ ckfree((char *) pts);
return (TkRegion) reg;
}
@@ -406,8 +413,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
HBRUSH bgBrush = CreateSolidBrush(gc->background);
if (twdPtr->type != TWD_BITMAP) {
- ZnWarning("unexpected drawable type in stipple");
- exit(1);
+ Tcl_Panic("unexpected drawable type in stipple");
}
/*
@@ -544,8 +550,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
HBRUSH oldMemBrush;
if (twdPtr->type != TWD_BITMAP) {
- ZnWarning("unexpected drawable type in stipple");
- exit(1);
+ Tcl_Panic("unexpected drawable type in stipple");
}
/*
@@ -925,8 +930,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill)
HBRUSH oldMemBrush;
if (twdPtr->type != TWD_BITMAP) {
- ZnWarning("unexpected drawable type in stipple");
- exit(1);
+ Tcl_Panic("unexpected drawable type in stipple");
}
/*