summaryrefslogtreecommitdiff
path: root/data/keyboards/Makefile.am
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2016-03-04 18:10:29 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2016-03-05 11:18:58 +0900
commitacf25460c6ec11259ce5044c1005a4d620c9ae4c (patch)
tree9eecdd84792a6a0bde584db177325b0eaa461014 /data/keyboards/Makefile.am
parentbf4981327a5d5985b573a2e594c31b455ec59ba6 (diff)
downloadlibhangul-acf25460c6ec11259ce5044c1005a4d620c9ae4c.tar.gz
xml로 작성된 외부의 한글 자판을 로딩하는 기능 구현
한글 자판 파일의 확장성을 고려하여 자판 파일은 xml로 구성하도록 한다. xml 파서는 expat을 사용한다. xml 번역을 위해서 intltool을 사용하고 autopoint대신 intltool로 gettext을 초기화 한다. 한글 자판 관리는 HangulKeyboardList를 통해서 한다. 한글 자판을 로딩하고 언로딩하기 위해서 hangul_init()/hangul_fini()와 같은 함수를 추가로 도입한다. HangulKeyboard는 HangulCombination과 세트로 관리하는 편이 합리적인 것 같다.
Diffstat (limited to 'data/keyboards/Makefile.am')
-rw-r--r--data/keyboards/Makefile.am58
1 files changed, 58 insertions, 0 deletions
diff --git a/data/keyboards/Makefile.am b/data/keyboards/Makefile.am
new file mode 100644
index 0000000..12b5459
--- /dev/null
+++ b/data/keyboards/Makefile.am
@@ -0,0 +1,58 @@
+
+keyboardsdir = $(pkgdatadir)/keyboards
+keyboards_DATA = \
+ hangul-keyboard-2.xml \
+ hangul-keyboard-2y.xml \
+ hangul-keyboard-39.xml \
+ hangul-keyboard-3f.xml \
+ hangul-keyboard-32.xml \
+ hangul-keyboard-3s.xml \
+ hangul-keyboard-3y.xml \
+ hangul-keyboard-ro.xml \
+ hangul-keyboard-ahn.xml \
+ hangul-combination-default.xml \
+ hangul-combination-full.xml \
+ $(NULL)
+
+EXTRA_DIST = \
+ hangul-keyboard-2.xml.template \
+ hangul-keyboard-2y.xml.template \
+ hangul-keyboard-39.xml.template \
+ hangul-keyboard-3f.xml.template \
+ hangul-keyboard-32.xml.template \
+ hangul-keyboard-3s.xml.template \
+ hangul-keyboard-3y.xml.template \
+ hangul-keyboard-ro.xml.template \
+ hangul-keyboard-ahn.xml.template \
+ hangul-combination-default.xml \
+ hangul-combination-full.xml \
+ $(NULL)
+
+# intltool로 xml 파일을 번역하면 주석이 모두 사라지고 attr의 순서도
+# 재정렬된다. 이를 방지하고자 name 부분만 별도의 name.xml로 만들어
+# 번역한후 template과 name.xml을 병합하여 키보드 xml 파일을 생성한다.
+hangul-keyboard-%.xml: hangul-keyboard-%.name.xml hangul-keyboard-%.xml.template
+ sed -i -e '1 D' -e 's/^<name/ <name/' $<
+ sed \
+ -e '/<_name>/r $<' \
+ -e '/<_name>/a\ ' \
+ -e '/<_name>/D' \
+ $(srcdir)/$@.template > $@
+
+hangul-keyboard-%.name.xml.in: hangul-keyboard-%.xml.template
+ grep "xml version=" $< > $@
+ grep "<_name>" $< >> $@
+
+CLEANFILES = \
+ hangul-keyboard-2.xml \
+ hangul-keyboard-2y.xml \
+ hangul-keyboard-39.xml \
+ hangul-keyboard-3f.xml \
+ hangul-keyboard-32.xml \
+ hangul-keyboard-3s.xml \
+ hangul-keyboard-3y.xml \
+ hangul-keyboard-ro.xml \
+ hangul-keyboard-ahn.xml \
+ $(NULL)
+
+@INTLTOOL_XML_RULE@