summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-19 20:49:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-19 20:49:22 (GMT)
commitdff6d16fcad7edb9640b8459ddd29d6415c6625e (patch)
tree9f82f5fcbf0cd8f6fd4375065c961edc06a5f339 /macosx/tkMacOSXDraw.c
parent0a4a93860c0f8ca3f7eb4196ea9ae0bfd3029ed0 (diff)
downloadtk-dff6d16fcad7edb9640b8459ddd29d6415c6625e.zip
tk-dff6d16fcad7edb9640b8459ddd29d6415c6625e.tar.gz
tk-dff6d16fcad7edb9640b8459ddd29d6415c6625e.tar.bz2
Fix more X11 function signatures in MacOSX port
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index b0603ca..314ca35 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -222,7 +222,7 @@ TkMacOSXBitmapRepFromDrawableRect(
*----------------------------------------------------------------------
*/
-void
+int
XCopyArea(
Display *display, /* Display. */
Drawable src, /* Source drawable. */
@@ -243,17 +243,17 @@ XCopyArea(
display->request++;
if (!width || !height) {
- return;
+ return BadDrawable;
}
if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) {
TkMacOSXDbgMsg("Failed to setup drawing context.");
- return;
+ return BadDrawable;
}
if (!dc.context) {
TkMacOSXDbgMsg("Invalid destination drawable - no context.");
- return;
+ return BadDrawable;
}
if (srcDraw->flags & TK_IS_PIXMAP) {
@@ -280,6 +280,7 @@ XCopyArea(
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
/*
@@ -300,7 +301,7 @@ XCopyArea(
*----------------------------------------------------------------------
*/
-void
+int
XCopyPlane(
Display *display, /* Display. */
Drawable src, /* Source drawable. */
@@ -321,14 +322,14 @@ XCopyPlane(
display->request++;
if (!width || !height) {
/* TkMacOSXDbgMsg("Drawing of empty area requested"); */
- return;
+ return BadDrawable;
}
if (plane != 1) {
Tcl_Panic("Unexpected plane specified for XCopyPlane");
}
if (srcDraw->flags & TK_IS_PIXMAP) {
if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) {
- return;
+ return BadDrawable;
}
CGContextRef context = dc.context;
@@ -401,12 +402,13 @@ XCopyPlane(
"could not get a bitmap context.");
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
} else {
/*
* Source drawable is a Window, not a Pixmap.
*/
- XCopyArea(display, src, dst, gc, src_x, src_y, width, height,
+ return XCopyArea(display, src, dst, gc, src_x, src_y, width, height,
dest_x, dest_y);
}
}
@@ -848,7 +850,7 @@ XDrawSegments(
*----------------------------------------------------------------------
*/
-void
+int
XFillPolygon(
Display *display, /* Display. */
Drawable d, /* Draw on this. */
@@ -864,7 +866,7 @@ XFillPolygon(
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
double prevx, prevy;
@@ -888,6 +890,7 @@ XFillPolygon(
CGContextEOFillPath(dc.context);
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
/*
@@ -1116,7 +1119,7 @@ TkMacOSXDrawSolidBorder(
*----------------------------------------------------------------------
*/
-void
+int
XDrawArc(
Display *display, /* Display. */
Drawable d, /* Draw on this. */
@@ -1132,12 +1135,12 @@ XDrawArc(
int lw = gc->line_width;
if (width == 0 || height == 0 || angle2 == 0) {
- return;
+ return BadDrawable;
}
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
CGRect rect;
@@ -1167,6 +1170,7 @@ XDrawArc(
}
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
#ifdef TK_MACOSXDRAW_UNUSED
@@ -1192,7 +1196,7 @@ XDrawArc(
*----------------------------------------------------------------------
*/
-void
+int
XDrawArcs(
Display *display,
Drawable d,
@@ -1207,7 +1211,7 @@ XDrawArcs(
display->request++;
if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
- return;
+ return BadDrawable;
}
if (dc.context) {
CGRect rect;
@@ -1248,6 +1252,7 @@ XDrawArcs(
}
}
TkMacOSXRestoreDrawingContext(&dc);
+ return Success;
}
#endif