]> gitweb.factorcode.org Git - factor.git/blob - basis/io/styles/styles.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / basis / io / styles / styles.factor
1 ! Copyright (C) 2005, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: hashtables io colors summary make accessors splitting
4 kernel ;
5 IN: io.styles
6
7 SYMBOL: plain
8 SYMBOL: bold
9 SYMBOL: italic
10 SYMBOL: bold-italic
11
12 ! Character styles
13 SYMBOL: foreground
14 SYMBOL: background
15 SYMBOL: font
16 SYMBOL: font-size
17 SYMBOL: font-style
18
19 ! Presentation
20 SYMBOL: presented
21 SYMBOL: presented-path
22 SYMBOL: presented-printer
23
24 SYMBOL: href
25
26 ! Paragraph styles
27 SYMBOL: page-color
28 SYMBOL: border-color
29 SYMBOL: border-width
30 SYMBOL: wrap-margin
31
32 ! Table styles
33 SYMBOL: table-gap
34 SYMBOL: table-border
35
36 : standard-table-style ( -- style )
37     H{
38         { table-gap { 5 5 } }
39         { table-border T{ rgba f 0.8 0.8 0.8 1.0 } }
40     } ;
41
42 ! Input history
43 TUPLE: input string ;
44
45 C: <input> input
46
47 M: input summary
48     [
49         "Input: " %
50         string>> "\n" split1 swap %
51         "..." "" ? %
52     ] "" make ;
53
54 : write-object ( str obj -- ) presented associate format ;