
@MACRO ZeroReturn[p] = if (x<p> <= 0) { READY_TO_RETURN; return scheme_void; }
@MACRO ZeroBoundary[p] = if (x<p> < 0) x<p> = 0;
@MACRO CheckRadius[name.r.w.h] = { if (x<r> < -0.5)  WITH_VAR_STACK(scheme_arg_mismatch(<name>, "radius must be no less than -0.5: ", p[POFFSET+<r>])); if (x<r> > 0) { if (2 * x<r> > x<w>) WITH_VAR_STACK(scheme_arg_mismatch(<name>, "radius is more than half the width: ", p[POFFSET+<r>])); if (2 * x<r> > x<h>) WITH_VAR_STACK(scheme_arg_mismatch(<name>, "radius is more than half the height: ", p[POFFSET+<r>])); } }

@MACRO CheckRgn[p] = if (x<p> && (x<p>->GetDC() != ((wxDC *)((Scheme_Class_Object *)THEOBJ)->primdata))) WITH_VAR_STACK(scheme_arg_mismatch(METHODNAME("dc<%>","set-clipping-region"), "provided a different dc's region: ", p[POFFSET+<p>]));
@MACRO SetBool[p.v] = x<p> = <v>;

@ Q "clear" : void Clear(); : : /CheckOk[METHODNAME("dc<%>","clear")]

@ Q "draw-line" : void DrawLine(double,double,double,double); : : /CheckOk[METHODNAME("dc<%>","draw-line")]
@ Q "draw-point" : void DrawPoint(double,double); : : /CheckOk[METHODNAME("dc<%>","draw-point")]
@ Q "draw-rectangle" : void DrawRectangle(double,double,nndouble,nndouble); : : /ZeroReturn[2]|ZeroReturn[3]|CheckOk[METHODNAME("dc<%>","draw-rectangle")]
@ Q "draw-rounded-rectangle" : void DrawRoundedRectangle(double,double,nndouble,nndouble,double=-0.25); : : /ZeroReturn[2]|ZeroReturn[3]|CheckRadius[METHODNAME("dc<%>","draw-rounded-rectangle").4.2.3]|CheckOk[METHODNAME("dc<%>","draw-rounded-rectangle")]
@ q "draw-spline" : void DrawSpline(double,double,double,double,double,double); : : /CheckOk[METHODNAME("dc<%>","draw-spline")]
@ Q "draw-text" : void DrawText(mzxstring,double,double,bool=FALSE,-bool=TRUE,nnint=0,double=0.0); : : /CheckStringIndex["draw-text".0.5]|CheckOk[METHODNAME("dc<%>","draw-text")]|SetBool[4.TRUE]

@ Q "draw-arc" : void DrawArc(double,double,nndouble,nndouble,double,double); : : /CheckOk[METHODNAME("dc<%>","draw-arc")]
@ Q "draw-ellipse" : void DrawEllipse(double,double,nndouble,nndouble); : : /ZeroReturn[2]|ZeroReturn[3]|CheckOk[METHODNAME("dc<%>","draw-ellipse")]
@ Q "draw-path" : void DrawPath(wxPath!,double=0.0,double=0.0,SYM[fillKind]=wxODDEVEN_RULE); : : /CheckOk[METHODNAME("dc<%>","draw-path")]

@ Q "draw-lines" : void DrawLines(-int,wxPoint!/bList/ubList/cList,double=0,double=0); : /methListSet[wxPoint.0.1.0]// : / glueListSet[wxPoint.0.1.0.METHODNAME("dc<%>","draw-lines")]|CheckOk[METHODNAME("dc<%>","draw-lines")]//
@ Q "draw-polygon" : void DrawPolygon(-int,wxPoint!/bList/ubList/cList,double=0,double=0,SYM[fillKind]=wxODDEVEN_RULE); : / methListSet[wxPoint.0.1.0]// : /glueListSet[wxPoint.0.1.0.METHODNAME("dc<%>","draw-polygon")]|CheckOk[METHODNAME("dc<%>","draw-polygon")]//

@ Q "set-clipping-rect" : void SetClippingRect(double,double,nndouble,nndouble); : : /ZeroBoundary[2]|ZeroBoundary[3]|CheckOk[METHODNAME("dc<%>","set-clipping-rec")]
@ Q "set-clipping-region" : void SetClippingRegion(wxRegion^) : : /CheckRgn[0]|/CheckOk[METHODNAME("dc<%>","set-clipping-region")]
@ Q "get-clipping-region" : wxRegion^ GetClippingRegion() : : /CheckOk[METHODNAME("dc<%>","set-clipping-region")]

@ Q "set-background" : void SetBackground(wxColour!); : : /CheckOk[METHODNAME("dc<%>","set-background")]
@ Q "set-font" : void SetFont(wxFont!); : : /CheckOk[METHODNAME("dc<%>","set-font")]

@ Q "set-pen" : void SetPen(wxPen!); : : /CheckOk[METHODNAME("dc<%>","set-pen")] <> pen%
@ m "set-pen" : void SetPen(wxColour!,rdouble[0|255],SYM[penStyle]);  : : /CheckOk[METHODNAME("dc<%>","set-pen")] <> color%
@ m "set-pen" : void SetPen(string,rdouble[0|255],SYM[penStyle]);  : : /CheckOk[METHODNAME("dc<%>","set-pen")] <> color name

@ Q "set-brush" : void SetBrush(wxBrush!); : : /CheckOk[METHODNAME("dc<%>","set-brush")] <> brush%
@ m "set-brush" : void SetBrush(wxColour!,SYM[brushStyle]); : : /CheckOk[METHODNAME("dc<%>","set-brush")] <> color%
@ m "set-brush" : void SetBrush(string,SYM[brushStyle]); : : /CheckOk[METHODNAME("dc<%>","set-brush")] <> color name

@ q "set-text-background" : void SetTextBackground(wxColour!); : : /CheckOk[METHODNAME("dc<%>","set-text-background")]
@ q "set-text-foreground" : void SetTextForeground(wxColour!); : : /CheckOk[METHODNAME("dc<%>","set-text-foreground")]

@ Q "set-smoothing" : void SetAntiAlias(SYM[smoothingMode])
@ q "get-smoothing" : SYM[smoothingMode] GetAntiAlias()
