summaryrefslogtreecommitdiff
path: root/themes/test2/test.ps
diff options
context:
space:
mode:
authorSteffen Winterfeldt <wfeldt@opensuse.org>2005-02-01 15:05:58 +0000
committerSteffen Winterfeldt <wfeldt@opensuse.org>2005-02-01 15:05:58 +0000
commit61a0e4241f53ef307d62a91f71fa928ed64242f9 (patch)
tree59b760bdab8eb9a822a8f1b76ee5379fa515a864 /themes/test2/test.ps
parentf30a5d88252bd0e8853826e89accc796f5c1c568 (diff)
- memory corruption workaround
- mouse code
Diffstat (limited to 'themes/test2/test.ps')
-rw-r--r--themes/test2/test.ps77
1 files changed, 58 insertions, 19 deletions
diff --git a/themes/test2/test.ps b/themes/test2/test.ps
index 6100594..bf8de73 100644
--- a/themes/test2/test.ps
+++ b/themes/test2/test.ps
@@ -28,6 +28,8 @@
%
/cvp { t_ptr settype } def
+/cvs { t_string settype } def
+
% Allocate and define a new color.
%
@@ -44,12 +46,34 @@
} def
+% ( size ) ==> ( string )
+/string {
+ 1 add malloc cvs
+} def
+
+
+% ( obj_1 ... obj_n string_1 string_2 ) ==> ( )
+%
+/sprintf {
+ dup cvp length exch snprintf
+} def
+
-800 600 16 findmode setmode not { false .end } if
-% 640 480 8 findmode setmode not { false .end } if
+% ( number ) ==> ( )
+%
+/number.print {
+ 32 string
+ exch over
+ "%d" exch sprintf
+ dup show
+ free
+} def
-"test.jpg" findfile
-% "test.pcx" findfile
+
+% 800 600 16 findmode setmode not { false .end } if
+640 480 8 findmode setmode not { false .end } if
+
+"test.pcx" findfile
setimage loadpalette
@@ -60,19 +84,34 @@ setimage loadpalette
white settextmodecolor
-image.size pop pop
-
-/w 400 def
-/h 200 def
-
-white setcolor
-10 200 moveto w 2 add h 2 add fillrect
-11 201 moveto
-
-% 0 0 200 100 image.unpack dup restorescreen free
-0 400 w h image
-% 0 0 moveto 0 0 image.size image
-
-
-dtrace
+0 0 moveto 0 0 image.size image
+
+/mouse xxx def
+
+"16x16.fnt" findfile setfont
+
+mouse .undef eq {
+ white setcolor
+ 0 0 moveto "no mouse" show
+ trace
+} if
+
+
+{
+ black setcolor
+ 0 0 moveto 100 60 fillrect
+ white setcolor
+ 0 0 moveto
+ mouse getdword 16 shl 16 shr "x: " show number.print
+ 0 20 moveto
+ mouse getdword 16 shr "y: " show number.print
+ 0 40 moveto
+ mouse 4 add getdword 7 and
+ "b: " show
+ dup 1 and { "l" show } if
+ dup 2 and { "r" show } if
+ dup 4 and { "m" show } if
+ pop
+ 100000 usleep
+} loop