Add dictionaries logo. Goldendict supports PNG format and by default display
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 02 Nov 2016 21:16:39 +0200
changeset 624 934a2a6cbe27
parent 623 bd16f79296e6
child 625 8262d384a0e9
Add dictionaries logo. Goldendict supports PNG format and by default display 16x16 images in "Result navigation pane" and "Dictionary bar".
Makefile
gadict_en-ru+uk.xpm
gadict_voa.xpm
--- a/Makefile	Tue Nov 01 21:10:55 2016 +0200
+++ b/Makefile	Wed Nov 02 21:16:39 2016 +0200
@@ -136,8 +136,9 @@
 
 GADICT_FILES := $(wildcard *.gadict)
 
-C5_FILES := dist/dictd/gadict_en-ru+uk.c5 dist/dictd/gadict_voa.c5
+C5_FILES := $(patsubst %.gadict,dist/dictd/%.c5,$(GADICT_FILES))
 ALL_C5_FILES := $(C5_FILES) dist/dictd/gadict_en-ru.c5 dist/dictd/gadict_en-uk.c5
+PNG_FILES := $(patsubst %.gadict,dist/dictd/%.png,$(GADICT_FILES))
 DICT_FILES := $(C5_FILES:.c5=.dict)
 DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
 INDEX_FILES := $(C5_FILES:.c5=.index)
@@ -379,6 +380,9 @@
 dist/dictd/%.dict.dz: dist/dictd/%.dict
 	dictzip -c $< >$@
 
+dist/dictd/%.png: %.xpm | dist/dictd/
+	convert $< $@
+
 GADICT_SUFFIXES := en-ru+uk en-ru en-uk voa
 .SECONDARY: $(patsubst %,dist/dictd/gadict_%.c5.name,$(GADICT_SUFFIXES))
 .SECONDARY: $(patsubst %,dist/dictd/gadict_%.c5.url,$(GADICT_SUFFIXES))
@@ -387,8 +391,6 @@
 	:
 
 # -B  suppress __pycache__ dir
-dist/dictd/gadict_en-ru+uk.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
-	python3 -B py/gadict_c5.py  $< $@
 
 dist/dictd/gadict_en-ru.c5: gadict_en-ru+uk.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
 	python3 -B py/gadict_c5.py  $< $@ ru
@@ -401,6 +403,9 @@
 dist/dictd/gadict_voa.c5: gadict_voa.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
 	python3 -B py/gadict_c5.py  $< $@ en
 
+dist/dictd/%.c5: %.gadict py/gadict.py py/gadict_c5.py | dist/dictd/
+	python3 -B py/gadict_c5.py  $< $@
+
 dist/dictd/:
 	mkdir -p $@
 
@@ -429,9 +434,9 @@
 # Install/uninstall targets.
 
 .PHONY: install
-install: $(DICTDZ_FILES) $(INDEX_FILES)
+install: $(DICTDZ_FILES) $(INDEX_FILES) $(PNG_FILES)
 	mkdir -p $(datadir) $(elispdir)
-	for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
+	for f in $(DICTDZ_FILES) $(INDEX_FILES) $(PNG_FILES); do \
 		$(INSTALL_DATA) $$f $(datadir); \
 	done
 	$(INSTALL_DATA) contrib/gadict.el $(elispdir)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gadict_en-ru+uk.xpm	Wed Nov 02 21:16:39 2016 +0200
@@ -0,0 +1,25 @@
+/* XPM */
+static char * gadict_en_ru_uk_xpm[] = {
+"16 16 6 1",
+" 	c None",
+".	c #FFFFFF",
+"+	c #005BBB",
+"@	c #0039A6",
+"#	c #FFD500",
+"$	c #D52B1E",
+"........++++++++",
+"........++++++++",
+"........++++++++",
+"........++++++++",
+"@@@@@@@@++++++++",
+"@@@@@@@@++++++++",
+"@@@@@@@@++++++++",
+"@@@@@@@@++++++++",
+"@@@@@@@@########",
+"@@@@@@@@########",
+"$$$$$$$$########",
+"$$$$$$$$########",
+"$$$$$$$$########",
+"$$$$$$$$########",
+"$$$$$$$$########",
+"$$$$$$$$########"};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gadict_voa.xpm	Wed Nov 02 21:16:39 2016 +0200
@@ -0,0 +1,22 @@
+/* XPM */
+static char * gadict_voa_xpm[] = {
+"16 16 3 1",
+" 	c #FFFFFF",
+".	c #BF0000",
+"+	c #000000",
+"                ",
+" .  .  ..   ..  ",
+" .  . .... .... ",
+" +  + +  + +  + ",
+" +  + +  + +  + ",
+" .  . .  . .  . ",
+" .  . .  . .  . ",
+" +  + +  + +  + ",
+" +  + +  + ++++ ",
+" .  . .  . .  . ",
+" .  . .  . .  . ",
+" +  + +  + +  + ",
+" +  + +  + +  + ",
+" .... .... .  . ",
+"  ..   ..  .  . ",
+"                "};