]> gitweb.factorcode.org Git - factor.git/blob - basis/definitions/icons/icons.factor
Switch to https urls
[factor.git] / basis / definitions / icons / icons.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: assocs classes.predicate fry generic help.topics
4 io.pathnames kernel lexer macros namespaces parser sequences
5 vocabs words words.constant words.symbol ;
6 IN: definitions.icons
7
8 GENERIC: definition-icon ( definition -- path )
9
10 : definition-icon-path ( string -- string' )
11     "vocab:definitions/icons/" prepend-path ".png" append ;
12
13 <<
14
15 SYMBOL: icons
16
17 icons [ H{ } clone ] initialize
18
19 : define-icon ( class name -- )
20     [ swap icons get set-at ]
21     [
22         [ \ definition-icon create-method ]
23         [ '[ drop _ definition-icon-path ] ] bi*
24         define
25     ] 2bi ;
26
27 SYNTAX: ICON: scan-word scan-token define-icon ;
28
29 >>
30
31 ICON: predicate-class class-predicate-word
32 ICON: generic generic-word
33 ICON: macro macro-word
34 ICON: parsing-word parsing-word
35 ICON: primitive primitive-word
36 ICON: symbol symbol-word
37 ICON: constant constant-word
38 ICON: word normal-word
39 ICON: word-link word-help-article
40 ICON: topic help-article
41 ICON: runnable-vocab runnable-vocab
42 ICON: vocab open-vocab
43 ICON: vocab-link unopen-vocab