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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
#
# Makefile rules for building all kinds of icons.
# This file should be included in all iconset-specific Makefiles.
#
# Version of the iconsets
VERSION=0.6
# Image format we're using
SUFFIX=png
#################################### Misc. Rules ###############################
TMP=icongen.tmp
ICONS=$(STATUSES)
ALL_ICONS=$(foreach icon,$(ICONS),$(addsuffix .$(SUFFIX),$(icon)))
all: icondef.xml
clean:
-rm -rf $(ALL_ICONS) icondef.xml $(TMP)
# Fallback rule for when *.in.* file doesn't exist
%.in.$(SUFFIX): %.$(SUFFIX)
cp $< $@
################################### Status Icons ###############################
ONLINE_OVERLAYED_STATUSES=away dnd invisible xa chatty
OFFLINE_OVERLAYED_STATUSES=ask noauth
OTHER_STATUSES=offline
OVERLAY_DIR=../overlays
STATUSES=$(ONLINE_OVERLAYED_STATUSES) $(OFFLINE_OVERLAYED_STATUSES) $(OTHER_STATUSES)
ONLINE_OVERLAYED_STATUS_ICONS=$(foreach status,$(ONLINE_OVERLAYED_STATUSES), \
$(addsuffix .$(SUFFIX),$(status)))
OFFLINE_OVERLAYED_STATUS_ICONS=$(foreach status,$(OFFLINE_OVERLAYED_STATUSES), \
$(addsuffix .$(SUFFIX),$(status)))
$(ONLINE_OVERLAYED_STATUS_ICONS): % : $(OVERLAY_DIR)/% online.$(SUFFIX)
composite $< online.$(SUFFIX) $@
$(OFFLINE_OVERLAYED_STATUS_ICONS): % : $(OVERLAY_DIR)/% offline.$(SUFFIX)
composite $< offline.$(SUFFIX) $@
offline.$(SUFFIX): online.$(SUFFIX)
convert -modulate 100,0 $< $@
################################# Dimming icon ################################
# FIXME: Quick & Dirty implementation
%.dimming.$(SUFFIX): %.in.$(SUFFIX)
-mkdir $(TMP)
all_files=$<; \
for i in 90 80 70 60 50 40 30 20 10; do \
target=$(TMP)/$*.$$i.$(SUFFIX); \
all_files="$$all_files $$target"; \
all_files_inv="$$target $$all_files_inv"; \
cp $< $$target; \
mogrify -modulate 100,$$i $$target; \
done; \
target=$(TMP)/$*.0.$(SUFFIX); \
all_files="$$all_files $$target"; \
cp $< $$target; \
mogrify -modulate 100,0 $$target; \
all_files="$$all_files $$all_files_inv"; \
montage -background none -geometry 16x16 -tile 21 $$all_files $@
-rm -rf $(TMP)
################################# Spinning icon ###############################
# FIXME: Even quicker & dirtier implementation
%.spinning.$(SUFFIX): %.in.$(SUFFIX)
-mkdir $(TMP)
cp $< $(TMP)/0.png
convert -scale 15! $< $(TMP)/tmp.png
composite -gravity Center $(TMP)/tmp.png $(OVERLAY_DIR)/empty.png $(TMP)/1.png
convert -scale 12! $< $(TMP)/tmp.png
composite -gravity Center $(TMP)/tmp.png $(OVERLAY_DIR)/empty.png $(TMP)/2.png
convert -scale 8! $< $(TMP)/tmp.png
composite -gravity Center $(TMP)/tmp.png $(OVERLAY_DIR)/empty.png $(TMP)/3.png
convert -scale 3! $< $(TMP)/tmp.png
composite -gravity Center $(TMP)/tmp.png $(OVERLAY_DIR)/empty.png $(TMP)/4.png
convert -flop $(TMP)/4.png $(TMP)/5.png
convert -flop $(TMP)/3.png $(TMP)/6.png
convert -flop $(TMP)/2.png $(TMP)/7.png
convert -flop $(TMP)/1.png $(TMP)/8.png
cd $(TMP) ; montage -background none -geometry 16x16 -tile 16 0.png 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 7.png 6.png 5.png 4.png 3.png 2.png 1.png ../$@
-rm -rf $(TMP)
#################################### Icondef ##################################
CREATION=$(shell date +"%Y-%m-%d")
ICONDEF_HEAD=<!-- WARNING!!!!!!!!!!!!!!! \n\
\tTHIS FILE IS AUTOMATICALLY GENERATED. ALL MODIFICATIONS WILL BE LOST. -->\n\
<version>$(VERSION)<\/version>\n\
\t\t<creation>$(CREATION)<\/creation>\n\
\t\t<author www='http:\/\/el-tramo.be'>Remko Tronçon<\/author>\n\
\t\t<author www='http:\/\/www.everaldo.com'>Everaldo Coelho \(Base icons\)<\/author>\n\
\t\t<copyright>\n\
\t\t\tThe icons in this iconset are copyright by Remko Tronçon, and\n\
\t\t\tare made available under the terms of Lesser General Public License.\n\
\t\t\tThey are based on the 'Crystal project icons', copyright 2006-2007\n\
\t\t\tEveraldo Coelho, under the same license.\n\
\t\t<\/copyright>
icondef.xml: icondef.xml.in ../Makefile
cat $< | perl -p -e "s/\*\*HEAD\*\*/$(ICONDEF_HEAD)/" > $@
|