]> Pileus Git - ~andy/gtk/blob - modules/input/thai-charprop.h
Merge remote-tracking branch 'origin/master' into gdk-backend-wayland
[~andy/gtk] / modules / input / thai-charprop.h
1 /* Pango
2  * thai-charprop.h:
3  *
4  * Copyright (C) 1999 Red Hat Software
5  * Author: Owen Taylor <otaylor@redhat.com>
6  *
7  * Software and Language Engineering Laboratory, NECTEC
8  * Author: Theppitak Karoonboonyanan <thep@links.nectec.or.th>
9  *
10  * Copyright (c) 1996-2000 by Sun Microsystems, Inc.
11  * Author: Chookij Vanatham <Chookij.Vanatham@Eng.Sun.COM>
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the
25  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  */
28
29 #ifndef __THAI_CHARPROP_H__
30 #define __THAI_CHARPROP_H__
31
32 #include <glib.h>
33
34 #define isthai(wc)      (0x0E00 <= (wc) && (wc) < 0x0E60)
35 #define islao(wc)       (0x0E80 <= (wc) && (wc) < 0x0EE0)
36 /* ucs2tis()
37  * Lao:  [0x0E80..0x0EDF] -> [0x20..0x7F]
38  * Thai: [0x0E00..0x0E5F] -> [0xA0..0xFF]
39  */
40 #define ucs2tis(wc)     (((wc) - 0x0E00 + 0x20)^0x80)
41
42 /* Define TACTIS character classes */
43 #define CTRL            0
44 #define NON             1
45 #define CONS            2
46 #define LV              3
47 #define FV1             4
48 #define FV2             5
49 #define FV3             6
50 #define AM              7
51 #define BV1             8
52 #define BV2             9
53 #define BD              10
54 #define TONE            11
55 #define AD1             12
56 #define AD2             13
57 #define AD3             14
58 #define AD4             15
59 #define AV1             16
60 #define AV2             17
61 #define AV3             18
62 #define BCON            19
63
64 #define _ND             0
65 #define _NC             1
66 #define _UC             (1<<1)
67 #define _BC             (1<<2)
68 #define _SC             (1<<3)
69 #define _AV             (1<<4)
70 #define _BV             (1<<5)
71 #define _TN             (1<<6)
72 #define _AD             (1<<7)
73 #define _BD             (1<<8)
74 #define _AM             (1<<9)
75
76 #define NoTailCons      _NC
77 #define UpTailCons      _UC
78 #define BotTailCons     _BC
79 #define SpltTailCons    _SC
80 #define Cons            (NoTailCons|UpTailCons|BotTailCons|SpltTailCons)
81 #define AboveVowel      _AV
82 #define BelowVowel      _BV
83 #define Tone            _TN
84 #define AboveDiac       _AD
85 #define BelowDiac       _BD
86 #define SaraAm          _AM
87
88 #define is_char_type(wc, mask)  (thai_char_type[ucs2tis ((wc))] & (mask))
89 #define TAC_char_class(wc) \
90         (isthai(wc)||islao(wc) ? thai_TAC_char_class[ucs2tis (wc)] : NON)
91 #define TAC_compose_input(wc1,wc2) \
92         thai_TAC_compose_input[TAC_char_class(wc1)][TAC_char_class(wc2)]
93
94 extern const gshort thai_char_type[256];
95 extern const gshort thai_TAC_char_class[256];
96 extern const gchar  thai_TAC_compose_input[20][20];
97
98 #endif /* __THAI_CHARPROP_H__ */