Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / share / examples / bootforth / screen.4th
1 \ Screen manipulation related words.
2 \ $FreeBSD: src/share/examples/bootforth/screen.4th,v 1.2 1999/08/28 00:19:10 peter Exp $
3 \ $DragonFly: src/share/examples/bootforth/screen.4th,v 1.2 2003/06/17 04:36:57 dillon Exp $
4
5 marker task-screen.4th
6
7 : escc  ( -- )  \ emit Esc-[
8         91 27 emit emit
9 ;
10
11 : ho    ( -- )  \ Home cursor
12         escc 72 emit    \ Esc-[H
13 ;
14
15 : cld   ( -- )  \ Clear from current position to end of display
16         escc 74 emit    \ Esc-[J
17 ;
18
19 : clear ( -- )  \ clear screen
20         ho cld
21 ;
22
23 : at-xy ( x y -- )      \ move cursor to x rows, y cols (1-based coords)
24         escc .# 59 emit .# 72 emit      \ Esc-[%d;%dH
25 ;
26
27 : fg    ( x -- )        \ Set foreground color
28         escc 3 .# .# 109 emit   \ Esc-[3%dm
29 ;
30
31 : bg    ( x -- )        \ Set background color
32         escc 4 .# .# 109 emit   \ Esc-[4%dm
33 ;
34
35 : me    ( -- )  \ Mode end (clear attributes)
36         escc 109 emit
37 ;