home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sa104os2.zip
/
SATHR104.ZIP
/
SATHER
/
CONTRIB
/
SCHNETTR
/
XLIB
/
GC.SA
< prev
next >
Wrap
Text File
|
1994-11-21
|
2KB
|
61 lines
-- -*-Sather-*-
-- access to the X window system routines
-- (c) 1994/11/03 - 1994/11/21 by Erik Schnetter
class X_GC_DEFS is
-- constants
const FillSolid := 0;
const FillTiled := 1;
const FillStippled := 2;
const FillOpaqueStippled := 3;
end; -- class X_GC_DEFS
class X_GC is
-- handle a GC (graphical context)
-- internal representation
private attr display: X_DISPLAY;
readonly attr c_gc: EXT_OB;
-- constants
private const int_count := 19;
private const ext_ob_count := 4;;
create: SAME is return new end;
create (display: X_DISPLAY, c_gc: EXT_OB): SAME post ~Void is
res::=new; res.display:=display; res.c_gc:=c_gc; return res end;
-- is this object attached to a GC?
Void: BOOL is return void(self) or void(c_gc) end;
-- set foreground color
foreground (color: INT) pre ~Void is
C_X_GC::X_ChangeGC_foreground (display.c_display, c_gc, color);
end; -- foreground
-- set background color
background (color: INT) pre ~Void is
C_X_GC::X_ChangeGC_background (display.c_display, c_gc, color);
end; -- background
-- set fill style
-- candidate for a bound routine!
fill_style (style: INT) pre ~Void is
C_X_GC::X_ChangeGC_fill_style (display.c_display, c_gc, style);
end; -- fill_style
end; -- class X_GC
external class C_X_GC is
X_ChangeGC_foreground (display: EXT_OB, gc: EXT_OB, color: INT);
X_ChangeGC_background (display: EXT_OB, gc: EXT_OB, color: INT);
X_ChangeGC_fill_style (display: EXT_OB, gc: EXT_OB, style: INT);
end; -- class C_X_GC