Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fill polygon

  • Loading branch information...
commit 99df02eb9a198410947dc0f860c7805853ad0bec 1 parent 5cb5744
@NotFound authored
View
5 GuitorConstants.winxhead
@@ -12,6 +12,11 @@ const int
LineOnOffDash = 1,
LineDoubleDash = 2;
+// Coord modes
+const int
+ CoordModeOrigin = 0,
+ CoordModePrevious = 1;
+
// GC logical function
const int
GXClear = 0x0,
View
23 src/Guitor.winxed
@@ -1158,6 +1158,25 @@ class GraphicContext
getfun("XFillRectangle")(display.xdisplay, xdrawable,
self.xgc, x, y, width, height);
}
+ function FillPolygon(display, drawable, x, y)
+ {
+ int xdrawable = drawable.xdrawable;
+ if (xdrawable != None) {
+ int n = elements(x);
+ var xpointview = new ["StructView"] ( [ DATATYPE_STRUCT, 2,
+ DATATYPE_SHORT, DATATYPE_SHORT ] );
+ var points = xpointview.alloc(n);
+ for (int i = 0; i < n; ++i) {
+ int xi = x[i];
+ int yi = y[i];
+ var point = xpointview.array_offs(points, i);
+ xpointview[point, 0] = xi;
+ xpointview[point, 1] = yi;
+ }
+ getfun("XFillPolygon")(display.xdisplay, xdrawable,
+ self.xgc, points, n, 0, CoordModePrevious);
+ }
+ }
function DrawString(display, drawable, int x, int y, string str)
{
@@ -1285,6 +1304,10 @@ class Drawable
self.getgc()._FillRectangle(self.display, xdrawable,
x, y, width, height);
}
+ function FillPolygon(x, y)
+ {
+ self.getgc().FillPolygon(self.display, self, x, y);
+ }
function SetFunction(int func)
{
self.owngc().SetFunction(self.display, func);
View
6 src/GuitorNci.winxed
@@ -664,6 +664,12 @@ function create_function(string funcname)
case "XFillRectangle":
sig = "ipipiiii";
break;
+ case "XDrawLines":
+ sig = "vpippii";
+ break;
+ case "XFillPolygon":
+ sig = "vpippiii";
+ break;
case "XClearArea":
sig = "ipiiiiii";
break;
Please sign in to comment.
Something went wrong with that request. Please try again.