-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathicon_resources_compiled.e
executable file
·50 lines (40 loc) · 1.14 KB
/
icon_resources_compiled.e
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
note
description: "Icon loader class"
keywords: "Embedded icons"
author: "Thomas Beale <[email protected]>"
support: "http://www.openehr.org/issues/browse/AWB"
copyright: "Copyright (c) 2013- Ocean Informatics Pty Ltd"
license: "Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>"
class ICON_RESOURCES_COMPILED
inherit
ICON_RESOURCES
redefine
can_lazy_load, lazy_load
end
create
make
feature -- Commands
add_icons (icon_resources: APPLICATION_ICON_RESOURCES)
-- merge generated `icon_resources'
do
load_icon_agents.merge (icon_resources.icon_load_agents)
end
feature {NONE} -- Implementation
can_lazy_load (key: STRING): BOOLEAN
-- True if icon resource `key' can be lazy-loaded
do
Result := load_icon_agents.has (key)
end
lazy_load (key: STRING)
-- load icon into main table
do
check attached load_icon_agents.item (key) as load_agt then
icon_pixmaps.put (load_agt.item ([]), key)
end
end
load_icon_agents: HASH_TABLE [FUNCTION [ANY, TUPLE, EV_PIXMAP], STRING]
-- create pixmap table from pixmap classes
once
create Result.make (0)
end
end