Skip to content

Commit

Permalink
Merge pull request #100 from Shallowmallow/DC-Bindings
Browse files Browse the repository at this point in the history
DC bindings
  • Loading branch information
ianharrigan authored Aug 20, 2023
2 parents 167a1de + baab035 commit 5bd45ba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hx/widgets/DC.hx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ class DC extends Object {
dcRef.ptr.drawText(str, x, y);
}

public function drawRectangle(x:Int, y:Int, width:Int, height:Int) {
dcRef.ptr.drawRectangle(x, y, width, height);
}

public function drawPoint(x:Int, y:Int) {
dcRef.ptr.drawPoint(x, y);
}

public function drawRoundedRectangle(x:Int, y:Int, width:Int, height:Int, radius:Float) {
dcRef.ptr.drawRoundedRectangle(x, y, width, height, radius);
}
Expand Down
17 changes: 17 additions & 0 deletions src/wx/widgets/DC.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ extern class DC extends Object {
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Instance functions
//////////////////////////////////////////////////////////////////////////////////////////////////////////

@:native("CalcBoundingBox") public function calcBoundingBox(x:Int, y:Int):Void;
@:native("CanDrawBitmap") public function canDrawBitmap():Bool;
@:native("CanGetTextEvent") public function canGetTextEvent():Bool;
@:native("CanUserTransformMatrix") public function canUserTransformMatrix():Bool;
@:native("CopyAttributes") public function copyAttributes(dc:DC):Void;
@:native("CrossHair") public function crossHair(x:Int, y:Int):Void;
@:native("DestroyClippingRegion") public function destroyClippingRegion():Void;
@:native("DeviceToLogical") public function deviceToLogical(x:Int, y:Int):Point;
@:native("DeviceToLogicalRel") public function deviceToLogicalRel(x:Int, y:Int):Size;
@:native("DrawArc") public function drawArc(xStart:Int, yStart:Int, xEnd:Int, yEnd:Int, xc:Int, yc:Int):Void;
@:native("DrawCheckMark") public function drawCheckMark(x:Int, y:Int, width:Int, height:Int):Void;
@:native("DrawEllipse") public function drawEllipse(x:Int, y:Int, width:Int, height:Int):Void;
@:native("DrawIcon") public function drawIcon(icon:Icon, x:Int, y:Int):Void;
@:native("DrawPoint") public function drawPoint(x:Int, y:Int):Void;
@:native("DrawRectangle") public function drawRectangle(x:Int, y:Int, width:Int, height:Int):Void;
@:native("GetPixel") public function getPixel(x:Int, y:Int, colour:Colour):Bool;
@:native("Clear") public function clear():Void;
@:native("DrawLine") public function drawLine(x1:Int, y1:Int, x2:Int, y2:Int):Void;
@:native("SetPen") public function setPen(pen:Pen):Void;
Expand Down

0 comments on commit 5bd45ba

Please sign in to comment.