factor/basis/io/styles/styles.factor

55 lines
975 B
Factor
Raw Normal View History

2008-07-28 23:28:13 -04:00
! Copyright (C) 2005, 2008 Slava Pestov.
2007-09-20 18:09:08 -04:00
! See http://factorcode.org/license.txt for BSD license.
2008-12-08 15:58:00 -05:00
USING: hashtables io colors summary make accessors splitting
kernel ;
2007-09-20 18:09:08 -04:00
IN: io.styles
SYMBOL: plain
SYMBOL: bold
SYMBOL: italic
SYMBOL: bold-italic
! Character styles
SYMBOL: foreground
SYMBOL: background
SYMBOL: font
SYMBOL: font-size
SYMBOL: font-style
! Presentation
SYMBOL: presented
SYMBOL: presented-path
SYMBOL: presented-printer
SYMBOL: href
2007-09-20 18:09:08 -04:00
! Paragraph styles
SYMBOL: page-color
SYMBOL: border-color
SYMBOL: border-width
SYMBOL: wrap-margin
! Table styles
SYMBOL: table-gap
SYMBOL: table-border
: standard-table-style ( -- style )
H{
{ table-gap { 5 5 } }
2008-08-01 16:11:42 -04:00
{ table-border T{ rgba f 0.8 0.8 0.8 1.0 } }
2007-09-20 18:09:08 -04:00
} ;
! Input history
TUPLE: input string ;
C: <input> input
2008-07-28 23:28:13 -04:00
2008-12-08 15:58:00 -05:00
M: input summary
[
"Input: " %
string>> "\n" split1 swap %
"..." "" ? %
] "" make ;
2008-07-28 23:28:13 -04:00
: write-object ( str obj -- ) presented associate format ;