icons.anubis
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Created by PyramIDE.
* User: フランスのトトロ aka (David RENÉ)
* Date: 13/02/2016
* Time: 10:31
* © David RENÉ
*/
transmit tools/basis.anubis
transmit system/muscle.anubis
transmit xlib/message_constants.anubis
transmit xlib/web/json.anubis
transmit hayamiki_lib/model/types/hk_icon.anubis
public define String
/* Return the Anubis source of the type component
*/
to_Anubis_source
(
HK_Icon icon
)=
if icon is
{
no_icon then "no_icon",
icon16(icn_str) then "icon16(\""+icn_str+"\")"
}.
public define String
/* Return the Anubis source of the type component
*/
to_String
(
HK_Icon icon
)=
if icon is
{
no_icon then "\"\"",
icon16(icn_str) then "\""+icn_str+"_icon\""
}.
/* *
_HK_ICON message format:
=======================
+-----------+-----------+--------------------------------
| name | type | description
+-----------+-----------+--------------------------------
| "hk_icon" | String | type of the icon. It sould be
"no_icon"
"icon_16" __
______________________________________|
|
--> icon_16:
+-----------+-----------+--------------------------------
| name | type | description
+-----------+-----------+--------------------------------
| "icn_str" | String | String name of the 16x16 icon.
*/
public define JsonValue
to_JSON
(
HK_Icon hk_icon
)=
with members =
if hk_icon is
{
no_icon then [ json_member("hk_icon", json_string("no_icon"))
],
icon16(icn_str) then [ json_member("hk_icon", json_string("icon_16")),
json_member("icn_str", json_string(icn_str))
]
},
json_object("_HK_ICON", members).