summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvas.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkCanvas.c')
-rw-r--r--generic/tkCanvas.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 34454bb..3a60a2b 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvas.c,v 1.42 2007/04/17 15:24:48 dkf Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.43 2007/04/23 21:15:18 das Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -21,6 +21,11 @@
#include "tkInt.h"
#include "tkPort.h"
#include "tkCanvas.h"
+#ifdef TK_NO_DOUBLE_BUFFERING
+#ifdef MAC_OSX_TK
+#include "tkMacOSXInt.h"
+#endif
+#endif /* TK_NO_DOUBLE_BUFFERING */
/*
* See tkCanvas.h for key data structures used to implement canvases.
@@ -177,10 +182,10 @@ static Tk_ConfigSpec configSpecs[] = {
TK_CONFIG_MONO_ONLY},
{TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_CANVAS_SELECT_FG_COLOR, Tk_Offset(TkCanvas, textInfo.selFgColorPtr),
- TK_CONFIG_COLOR_ONLY},
+ TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK},
{TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_CANVAS_SELECT_FG_MONO, Tk_Offset(TkCanvas, textInfo.selFgColorPtr),
- TK_CONFIG_MONO_ONLY},
+ TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK},
{TK_CONFIG_CUSTOM, "-state", "state", "State",
"normal", Tk_Offset(TkCanvas, canvas_state), TK_CONFIG_DONT_SET_DEFAULT,
&stateOption},
@@ -2132,6 +2137,10 @@ DisplayCanvas(
goto borders;
}
+ width = screenX2 - screenX1;
+ height = screenY2 - screenY1;
+
+#ifndef TK_NO_DOUBLE_BUFFERING
/*
* Redrawing is done in a temporary pixmap that is allocated here and
* freed at the end of the function. All drawing is done to the
@@ -2166,14 +2175,19 @@ DisplayCanvas(
(screenX2 + 30 - canvasPtr->drawableXOrigin),
(screenY2 + 30 - canvasPtr->drawableYOrigin),
Tk_Depth(tkwin));
+#else
+ canvasPtr->drawableXOrigin = canvasPtr->xOrigin;
+ canvasPtr->drawableYOrigin = canvasPtr->yOrigin;
+ pixmap = Tk_WindowId(tkwin);
+ TkpClipDrawableToRect(Tk_Display(tkwin), pixmap,
+ screenX1 - canvasPtr->xOrigin, screenY1 - canvasPtr->yOrigin,
+ width, height);
+#endif /* TK_NO_DOUBLE_BUFFERING */
/*
* Clear the area to be redrawn.
*/
- width = screenX2 - screenX1;
- height = screenY2 - screenY1;
-
XFillRectangle(Tk_Display(tkwin), pixmap, canvasPtr->pixmapGC,
screenX1 - canvasPtr->drawableXOrigin,
screenY1 - canvasPtr->drawableYOrigin, (unsigned int) width,
@@ -2211,6 +2225,7 @@ DisplayCanvas(
height);
}
+#ifndef TK_NO_DOUBLE_BUFFERING
/*
* Copy from the temporary pixmap to the screen, then free up the
* temporary pixmap.
@@ -2220,10 +2235,12 @@ DisplayCanvas(
canvasPtr->pixmapGC,
screenX1 - canvasPtr->drawableXOrigin,
screenY1 - canvasPtr->drawableYOrigin,
- (unsigned) (screenX2 - screenX1),
- (unsigned) (screenY2 - screenY1),
+ (unsigned int) width, (unsigned int) height,
screenX1 - canvasPtr->xOrigin, screenY1 - canvasPtr->yOrigin);
Tk_FreePixmap(Tk_Display(tkwin), pixmap);
+#else
+ TkpClipDrawableToRect(Tk_Display(tkwin), pixmap, 0, 0, -1, -1);
+#endif /* TK_NO_DOUBLE_BUFFERING */
}
/*