diff options
author | treectrl <treectrl> | 2005-05-19 00:42:04 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2005-05-19 00:42:04 (GMT) |
commit | 442f6759f0aec32d0160721384d5bcf63e515201 (patch) | |
tree | 91d37c34c4c17bc08dad34133d9bbecf23f51140 | |
parent | 79199606320eb3a92fb82195d522a04b59623e76 (diff) | |
download | tktreectrl-442f6759f0aec32d0160721384d5bcf63e515201.zip tktreectrl-442f6759f0aec32d0160721384d5bcf63e515201.tar.gz tktreectrl-442f6759f0aec32d0160721384d5bcf63e515201.tar.bz2 |
Attempt to fix Tk_FillRegion() on the mac using QuickDraw. *** Hasn't even been compiled yet. ***
-rw-r--r-- | generic/tkTreeUtils.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/generic/tkTreeUtils.c b/generic/tkTreeUtils.c index 9ada3e9..7459fe6 100644 --- a/generic/tkTreeUtils.c +++ b/generic/tkTreeUtils.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2005 Tim Baker * - * RCS: @(#) $Id: tkTreeUtils.c,v 1.14 2005/05/17 01:21:14 treectrl Exp $ + * RCS: @(#) $Id: tkTreeUtils.c,v 1.15 2005/05/19 00:42:04 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -16,6 +16,8 @@ /* OffsetRgn() on Mac */ #ifdef TARGET_OS_MAC #include <Carbon/Carbon.h> +#include "tkMacOSXInt.h" +static PixPathHandle gPenPat = NULL; #endif /* @@ -469,7 +471,25 @@ void Tk_FillRegion(Display *display, Drawable drawable, GC gc, TkRegion rgn) FillRgn(dc, (HRGN) rgn, brush); DeleteObject(brush); TkWinReleaseDrawableDC(drawable, dc, &dcState); -/* Apparently this works on Mac Aqua as well as Unix */ +#elif defined(TARGET_OS_MAC) + MacDrawable *macWin = (MacDrawable *) d; + CGrafPtr saveWorld; + GDHandle saveDevice; + GWorldPtr destPort; + RGBColor macColor; + + destPort = TkMacOSXGetDrawablePort(drawable); + if (gPenPat == NULL) + gPenPat = NewPixPat(); + if (TkSetMacColor(gc->foreground, &macColor) == true) + MakeRGBPat(gPenPath, &macColor); + display->request++; + GetGWorld(&saveWorld, &saveDevice); + SetGWorld(destPort, NULL); + TkMacOSXSetUpClippingRgn(drawable); + TkMacOSXSetUpGraphicsPort(gc, destPort); + FillCRgn((RgnHandle) rgn, gPenPat); + SetGWorld(saveWorld, saveDevice); #else XRectangle box; |