Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

constants for GC logical functions - use constants consistently in ex…

…amples
  • Loading branch information...
commit 7d438ceb36fada8228bb7e1a96fa9ba9e0e7970d 1 parent e069557
@NotFound authored
View
24 GuitorConstants.winxhead
@@ -12,6 +12,30 @@ const int
LineOnOffDash = 1,
LineDoubleDash = 2;
+// GC logical function
+const int
+ GXClear = 0x0,
+ GXand = 0x1,
+ GXandReverse = 0x2,
+ GXcopy = 0x3,
+ GXandInverted = 0x4,
+ GXnoop = 0x5,
+ GXxor = 0x6,
+ GXor = 0x7,
+ GXnor = 0x8,
+ GXequiv = 0x9,
+ GXinvert = 0xa,
+ GXorReverse = 0xb,
+ GXcopyInverted = 0xc,
+ GXorInverted = 0xd,
+ GXnand = 0xe,
+ GXset = 0xf;
+
+// Subwindow modes
+const int
+ ClipByChildren = 0,
+ IncludeInferiors = 1;
+
namespace Events
{
View
29 examples/boxes.winxed
@@ -173,9 +173,9 @@ class Boxes : TopLevelWindow
self.y =: y;
self.x1 =: x;
self.y1 =: y;
- self.SetFunction(0xa);
- self.SetLineAttributes(0, 1, 0, 0);
- self.SetSubwindowMode(1);
+ self.SetFunction(GXinvert);
+ self.SetLineAttributes(0, LineOnOffDash, 0, 0);
+ self.SetSubwindowMode(IncludeInferiors);
}
function onButtonRelease(event)
{
@@ -203,23 +203,6 @@ class Boxes : TopLevelWindow
if (width == 0 || height == 0)
return;
var boxlist = self.boxlist;
-/*
- string color;
- switch (self.numcolor) {
- case 0: color = "yellow"; break;
- case 1: color = "red"; break;
- case 2: color = "blue"; break;
- case 3: color = "light steel blue"; break;
- case 4: color = "orange"; break;
- case 5: color = "green"; break;
- case 6: color = "maroon"; break;
- case 7: color = "aquamarine"; break;
- case 8: color = "coral"; break;
- default: color = "violet";
- }
- var box = new Box(self, x, y, width, height,
- { "background_color" : self.display.ParseColor(color) } );
-*/
var color = self.colors[self.numcolor];
var box = new Box(self, x, y, width, height,
{ "background_color" : color } );
@@ -228,9 +211,9 @@ class Boxes : TopLevelWindow
int active = elements(boxlist);
push(boxlist, box);
self.activebox =: active;
- self.SetFunction(0x3);
- self.SetLineAttributes(0, 0, 0, 0);
- self.SetSubwindowMode(0);
+ self.SetFunction(GXcopy);
+ self.SetLineAttributes(0, LineSolid, 0, 0);
+ self.SetSubwindowMode(ClipByChildren);
}
function onMotion(event)
{
View
12 examples/graph.winxed
@@ -213,9 +213,9 @@ class Graph : TopLevelWindow
self.yp0 = y;
self.xp1 = x;
self.yp1 = y;
- self.SetFunction(0xa);
- self.SetLineAttributes(0, 1, 0, 0);
- self.SetSubwindowMode(1);
+ self.SetFunction(GXinvert);
+ self.SetLineAttributes(0, LineOnOffDash, 0, 0);
+ self.SetSubwindowMode(IncludeInferiors);
}
function onButtonRelease(event)
{
@@ -228,9 +228,9 @@ class Graph : TopLevelWindow
int nxp1 = self.xp1;
int nyp1 = self.yp1;
self.rectangle(xp0, yp0, nxp1, nyp1);
- self.SetFunction(0x3);
- self.SetLineAttributes(0, 0, 0, 0);
- self.SetSubwindowMode(0);
+ self.SetFunction(GXcopy);
+ self.SetLineAttributes(0, LineSolid, 0, 0);
+ self.SetSubwindowMode(ClipByChildren);
int nxp0 = xp0;
if (nxp0 > nxp1) {
nxp0 = nxp1;
View
12 examples/pizarra.winxed
@@ -367,9 +367,9 @@ class Board : ChildWindow
switch (self.mode) {
case RECTANGLE:
case FILLRECT:
- self.SetFunction(0xa);
- self.SetLineAttributes(0, 1, 0, 0);
- self.SetSubwindowMode(1);
+ self.SetFunction(GXinvert);
+ self.SetLineAttributes(0, LineOnOffDash, 0, 0);
+ self.SetSubwindowMode(IncludeInferiors);
break;
}
}
@@ -388,9 +388,9 @@ class Board : ChildWindow
case RECTANGLE:
case FILLRECT:
self.hintrectangle(initx, inity, oldx, oldy);
- self.SetFunction(0x3);
- self.SetLineAttributes(0, 0, 0, 0);
- self.SetSubwindowMode(0);
+ self.SetFunction(GXcopy);
+ self.SetLineAttributes(0, LineSolid, 0, 0);
+ self.SetSubwindowMode(ClipByChildren);
var r = self.mode == RECTANGLE ?
new Rectangle(colorspec, initx, inity, oldx, oldy) :
new FillRectangle(colorspec, initx, inity, oldx, oldy);

0 comments on commit 7d438ce

Please sign in to comment.
Something went wrong with that request. Please try again.