summaryrefslogtreecommitdiffstats
path: root/win/tkWinDraw.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-10 15:01:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-10 15:01:17 (GMT)
commit7077d31ea04436ea3ab9e6cc873e1fcbaa53b86c (patch)
tree9a2a2e792ebd39b4e63458f58482637c9bcc5702 /win/tkWinDraw.c
parentd6709afd3e1e09c065cf4e39d196eadf839ce4c4 (diff)
downloadtk-7077d31ea04436ea3ab9e6cc873e1fcbaa53b86c.zip
tk-7077d31ea04436ea3ab9e6cc873e1fcbaa53b86c.tar.gz
tk-7077d31ea04436ea3ab9e6cc873e1fcbaa53b86c.tar.bz2
More progress in making win32 build C++-ready.
Diffstat (limited to 'win/tkWinDraw.c')
-rw-r--r--win/tkWinDraw.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index b21376a..41e9672 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -412,7 +412,7 @@ XCopyPlane(
*/
fgBrush = CreateSolidBrush(gc->foreground);
- oldBrush = SelectObject(destDC, fgBrush);
+ oldBrush = (HBRUSH)SelectObject(destDC, fgBrush);
SetBkColor(destDC, RGB(255,255,255));
SetTextColor(destDC, RGB(0,0,0));
BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, srcDC,
@@ -450,7 +450,7 @@ XCopyPlane(
BitBlt(memDC, 0, 0, (int) width, (int) height, maskDC,
dest_x - gc->clip_x_origin, dest_y - gc->clip_y_origin,
SRCAND);
- oldBrush = SelectObject(destDC, fgBrush);
+ oldBrush = (HBRUSH)SelectObject(destDC, fgBrush);
BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, memDC,
0, 0, MASKPAT);
@@ -553,10 +553,10 @@ TkPutImage(
usePalette = (image->bits_per_pixel < 16);
if (usePalette) {
- infoPtr = ckalloc(sizeof(BITMAPINFOHEADER)
+ infoPtr = (BITMAPINFO *)ckalloc(sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD)*ncolors);
} else {
- infoPtr = ckalloc(sizeof(BITMAPINFOHEADER));
+ infoPtr = (BITMAPINFO *)ckalloc(sizeof(BITMAPINFOHEADER));
}
infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -591,7 +591,7 @@ TkPutImage(
TkWinReleaseDrawableDC(d, dc, &state);
return BadValue;
}
- bitmap = SelectObject(dcMem, bitmap);
+ bitmap = (HBITMAP)SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y,
SRCCOPY);
DeleteObject(SelectObject(dcMem, bitmap));
@@ -672,7 +672,7 @@ XFillRectangles(
stipple = CreatePatternBrush(twdPtr->bitmap.handle);
SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL);
- oldBrush = SelectObject(dc, stipple);
+ oldBrush = (HBRUSH)SelectObject(dc, stipple);
dcMem = CreateCompatibleDC(dc);
/*
@@ -684,7 +684,7 @@ XFillRectangles(
while (nrectangles-- > 0) {
bitmap = CreateCompatibleBitmap(dc, rectangles[0].width,
rectangles[0].height);
- oldBitmap = SelectObject(dcMem, bitmap);
+ oldBitmap = (HBITMAP)SelectObject(dcMem, bitmap);
rect.left = 0;
rect.top = 0;
rect.right = rectangles[0].width;
@@ -719,8 +719,8 @@ XFillRectangles(
}
} else {
HPEN newPen = CreatePen(PS_NULL, 0, gc->foreground);
- HPEN oldPen = SelectObject(dc, newPen);
- oldBrush = SelectObject(dc, brush);
+ HPEN oldPen = (HPEN)SelectObject(dc, newPen);
+ oldBrush = (HBRUSH)SelectObject(dc, brush);
while (nrectangles-- > 0) {
Rectangle(dc, rectangles[0].x, rectangles[0].y,
@@ -849,7 +849,7 @@ RenderObject(
*/
SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL);
- oldBrush = SelectObject(dc, CreatePatternBrush(twdPtr->bitmap.handle));
+ oldBrush = (HBRUSH)SelectObject(dc, CreatePatternBrush(twdPtr->bitmap.handle));
/*
* Create temporary drawing surface containing a copy of the
@@ -857,9 +857,9 @@ RenderObject(
*/
dcMem = CreateCompatibleDC(dc);
- oldBitmap = SelectObject(dcMem, CreateCompatibleBitmap(dc, width,
+ oldBitmap = (HBITMAP)SelectObject(dcMem, CreateCompatibleBitmap(dc, width,
height));
- oldPen = SelectObject(dcMem, pen);
+ oldPen = (HPEN)SelectObject(dcMem, pen);
BitBlt(dcMem, 0, 0, width, height, dc, rect.left, rect.top, SRCCOPY);
/*
@@ -879,7 +879,7 @@ RenderObject(
SetPolyFillMode(dcMem, (gc->fill_rule == EvenOddRule) ? ALTERNATE
: WINDING);
- oldMemBrush = SelectObject(dcMem, CreateSolidBrush(gc->foreground));
+ oldMemBrush = (HBRUSH)SelectObject(dcMem, CreateSolidBrush(gc->foreground));
MakeAndStrokePath(dcMem, winPoints, npoints, func);
BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYFG);
@@ -902,8 +902,8 @@ RenderObject(
DeleteObject(SelectObject(dcMem, oldBitmap));
DeleteDC(dcMem);
} else {
- oldPen = SelectObject(dc, pen);
- oldBrush = SelectObject(dc, CreateSolidBrush(gc->foreground));
+ oldPen = (HPEN)SelectObject(dc, pen);
+ oldBrush = (HBRUSH)SelectObject(dc, CreateSolidBrush(gc->foreground));
SetROP2(dc, tkpWinRopModes[gc->function]);
SetPolyFillMode(dc, (gc->fill_rule == EvenOddRule) ? ALTERNATE
@@ -995,7 +995,7 @@ XFillPolygon(
dc = TkWinGetDrawableDC(display, d, &state);
- pen = GetStockObject(NULL_PEN);
+ pen = (HPEN)GetStockObject(NULL_PEN);
RenderObject(dc, gc, points, npoints, mode, pen, Polygon);
TkWinReleaseDrawableDC(d, dc, &state);
@@ -1039,8 +1039,8 @@ XDrawRectangle(
pen = SetUpGraphicsPort(gc);
SetBkMode(dc, TRANSPARENT);
- oldPen = SelectObject(dc, pen);
- oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
+ oldPen = (HPEN)SelectObject(dc, pen);
+ oldBrush = (HBRUSH)SelectObject(dc, GetStockObject(NULL_BRUSH));
SetROP2(dc, tkpWinRopModes[gc->function]);
Rectangle(dc, x, y, (int) x+width+1, (int) y+height+1);
@@ -1265,7 +1265,7 @@ DrawOrFillArc(
*/
pen = SetUpGraphicsPort(gc);
- oldPen = SelectObject(dc, pen);
+ oldPen = (HPEN)SelectObject(dc, pen);
if (!fill) {
/*
* Note that this call will leave a gap of one pixel at the end of the
@@ -1278,7 +1278,7 @@ DrawOrFillArc(
xend, yend);
} else {
brush = CreateSolidBrush(gc->foreground);
- oldBrush = SelectObject(dc, brush);
+ oldBrush = (HBRUSH)SelectObject(dc, brush);
if (gc->arc_mode == ArcChord) {
Chord(dc, x, y, (int) (x+width+1), (int) (y+height+1),
xstart, ystart, xend, yend);