diff options
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r-- | macosx/tkMacOSXDraw.c | 70 |
1 files changed, 30 insertions, 40 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index fd8a1eb..b6a834f 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -73,6 +73,7 @@ TkMacOSXInitCGDrawing( int limit) { static Boolean initialized = FALSE; + (void)enable; if (!initialized) { initialized = TRUE; @@ -602,7 +603,7 @@ TkMacOSXGetCGContextForDrawable( bytesPerRow = ((size_t) macDraw->size.width * bitsPerPixel + 127) >> 3 & ~15; len = macDraw->size.height * bytesPerRow; - data = ckalloc(len); + data = (char *)ckalloc(len); bzero(data, len); macDraw->context = CGBitmapContextCreate(data, macDraw->size.width, macDraw->size.height, bitsPerComponent, bytesPerRow, @@ -868,6 +869,7 @@ XFillPolygon( MacDrawable *macWin = (MacDrawable *) d; TkMacOSXDrawingContext dc; int i; + (void)shape; display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { @@ -948,7 +950,6 @@ XDrawRectangle( return Success; } -#ifdef TK_MACOSXDRAW_UNUSED /* *---------------------------------------------------------------------- * @@ -973,7 +974,7 @@ XDrawRectangle( *---------------------------------------------------------------------- */ -void +int XDrawRectangles( Display *display, Drawable drawable, @@ -987,8 +988,8 @@ XDrawRectangles( int i, lw = gc->line_width; display->request++; - if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + if (!TkMacOSXSetupDrawingContext(drawable, gc, 1, &dc)) { + return BadDrawable; } if (dc.context) { CGRect rect; @@ -1006,8 +1007,8 @@ XDrawRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } -#endif /* *---------------------------------------------------------------------- @@ -1178,7 +1179,6 @@ XDrawArc( return Success; } -#ifdef TK_MACOSXDRAW_UNUSED /* *---------------------------------------------------------------------- * @@ -1259,7 +1259,6 @@ XDrawArcs( TkMacOSXRestoreDrawingContext(&dc); return Success; } -#endif /* *---------------------------------------------------------------------- @@ -1340,7 +1339,6 @@ XFillArc( return Success; } -#ifdef TK_MACOSXDRAW_UNUSED /* *---------------------------------------------------------------------- * @@ -1357,7 +1355,7 @@ XFillArc( *---------------------------------------------------------------------- */ -void +int XFillArcs( Display *display, Drawable d, @@ -1372,7 +1370,7 @@ XFillArcs( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -1420,25 +1418,8 @@ XFillArcs( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } -#endif - -#ifdef TK_MACOSXDRAW_UNUSED -/* - *---------------------------------------------------------------------- - * - * XMaxRequestSize -- - * - *---------------------------------------------------------------------- - */ - -long -XMaxRequestSize( - Display *display) -{ - return (SHRT_MAX / 4); -} -#endif /* *---------------------------------------------------------------------- @@ -1465,7 +1446,7 @@ TkScrollWindow( int x, int y, /* Position rectangle to be scrolled. */ int width, int height, int dx, int dy, /* Distance rectangle should be moved. */ - TkRegion damageRgn) /* Region to accumulate damage in. */ + Region damageRgn) /* Region to accumulate damage in. */ { Drawable drawable = Tk_WindowId(tkwin); MacDrawable *macDraw = (MacDrawable *) drawable; @@ -1474,6 +1455,7 @@ TkScrollWindow( HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; int result = 0; + (void)gc; if (view) { /* @@ -1560,6 +1542,9 @@ TkMacOSXSetUpGraphicsPort( GC gc, /* GC to apply to current port. */ void *destPort) { + (void)gc; + (void)destPort; + Tcl_Panic("TkMacOSXSetUpGraphicsPort: Obsolete, no more QD!"); } @@ -1594,6 +1579,7 @@ TkMacOSXSetupDrawingContext( NSWindow *win = NULL; TkMacOSXDrawingContext dc = {}; CGRect clipBounds; + (void)useCG; /* * If the drawable is not a pixmap and it has an associated NSWindow then @@ -1904,6 +1890,7 @@ void TkMacOSXSetUpClippingRgn( Drawable drawable) /* Drawable to update. */ { + (void)drawable; } /* @@ -1931,6 +1918,7 @@ TkpClipDrawableToRect( int width, int height) { MacDrawable *macDraw = (MacDrawable *) d; + (void)display; if (macDraw->drawRgn) { CFRelease(macDraw->drawRgn); @@ -1978,12 +1966,12 @@ ClipToGC( { if (gc && gc->clip_mask && ((TkpClipMask *) gc->clip_mask)->type == TKP_CLIP_REGION) { - TkRegion gcClip = ((TkpClipMask *) gc->clip_mask)->value.region; + Region gcClip = ((TkpClipMask *) gc->clip_mask)->value.region; int xOffset = ((MacDrawable *) d)->xOff + gc->clip_x_origin; int yOffset = ((MacDrawable *) d)->yOff + gc->clip_y_origin; HIShapeRef clipRgn = *clipRgnPtr, gcClipRgn; - TkMacOSXOffsetRegion(gcClip, xOffset, yOffset); + XOffsetRegion(gcClip, xOffset, yOffset); gcClipRgn = TkMacOSXGetNativeRegion(gcClip); if (clipRgn) { *clipRgnPtr = HIShapeCreateIntersection(gcClipRgn, clipRgn); @@ -1992,7 +1980,7 @@ ClipToGC( *clipRgnPtr = HIShapeCreateCopy(gcClipRgn); } CFRelease(gcClipRgn); - TkMacOSXOffsetRegion(gcClip, -xOffset, -yOffset); + XOffsetRegion(gcClip, -xOffset, -yOffset); } } @@ -2019,6 +2007,9 @@ TkMacOSXMakeStippleMap( Drawable drawable, /* Window to apply stipple. */ Drawable stipple) /* The stipple pattern. */ { + (void)drawable; + (void)stipple; + return NULL; } @@ -2068,7 +2059,7 @@ TkpDrawHighlightBorder ( /* *---------------------------------------------------------------------- * - * TkpDrawFrame -- + * TkpDrawFrameEx -- * * This procedure draws the rectangular frame area. If the user has * requested themeing, it draws with the background theme. @@ -2083,8 +2074,9 @@ TkpDrawHighlightBorder ( */ void -TkpDrawFrame( +TkpDrawFrameEx( Tk_Window tkwin, + Drawable drawable, Tk_3DBorder border, int highlightWidth, int borderWidth, @@ -2102,11 +2094,9 @@ TkpDrawFrame( } } - Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), - border, highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, relief); + Tk_Fill3DRectangle(tkwin, drawable, border, highlightWidth, + highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, + Tk_Height(tkwin) - 2 * highlightWidth, borderWidth, relief); } /* |