2009-02-10 23:11:04 -05:00
|
|
|
! Copyright (C) 2009 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2009-09-21 15:35:16 -04:00
|
|
|
USING: assocs classes.predicate fry generic help.topics
|
|
|
|
io.pathnames kernel lexer macros namespaces parser sequences
|
|
|
|
vocabs words words.constant words.symbol ;
|
2009-02-10 23:11:04 -05:00
|
|
|
IN: definitions.icons
|
|
|
|
|
|
|
|
GENERIC: definition-icon ( definition -- path )
|
|
|
|
|
|
|
|
: definition-icon-path ( string -- string' )
|
2009-09-28 15:53:39 -04:00
|
|
|
"vocab:definitions/icons/" prepend-path ".png" append ;
|
2009-02-10 23:11:04 -05:00
|
|
|
|
|
|
|
<<
|
|
|
|
|
2009-03-24 10:11:45 -04:00
|
|
|
SYMBOL: icons
|
|
|
|
|
|
|
|
icons [ H{ } clone ] initialize
|
|
|
|
|
|
|
|
: define-icon ( class name -- )
|
|
|
|
[ swap icons get set-at ]
|
|
|
|
[
|
|
|
|
[ \ definition-icon create-method ]
|
|
|
|
[ '[ drop _ definition-icon-path ] ] bi*
|
|
|
|
define
|
|
|
|
] 2bi ;
|
|
|
|
|
2011-09-27 16:20:07 -04:00
|
|
|
SYNTAX: ICON: scan-word scan-token define-icon ;
|
2009-02-10 23:11:04 -05:00
|
|
|
|
|
|
|
>>
|
|
|
|
|
|
|
|
ICON: predicate-class class-predicate-word
|
|
|
|
ICON: generic generic-word
|
|
|
|
ICON: macro macro-word
|
|
|
|
ICON: parsing-word parsing-word
|
|
|
|
ICON: primitive primitive-word
|
|
|
|
ICON: symbol symbol-word
|
2009-02-11 19:05:45 -05:00
|
|
|
ICON: constant constant-word
|
2009-02-10 23:11:04 -05:00
|
|
|
ICON: word normal-word
|
2009-02-17 15:26:01 -05:00
|
|
|
ICON: word-link word-help-article
|
2009-09-11 21:33:11 -04:00
|
|
|
ICON: topic help-article
|
2009-03-24 10:11:45 -04:00
|
|
|
ICON: runnable-vocab runnable-vocab
|
|
|
|
ICON: vocab open-vocab
|
|
|
|
ICON: vocab-link unopen-vocab
|