]> Pileus Git - ~andy/gtk/blob - modules/input/thai-charprop.h
stylecontext: Do invalidation on first resize container
[~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, see <http://www.gnu.org/licenses/>.
25  */
26
27 #ifndef __THAI_CHARPROP_H__
28 #define __THAI_CHARPROP_H__
29
30 #include <glib.h>
31
32 #define isthai(wc)      (0x0E00 <= (wc) && (wc) < 0x0E60)
33 #define islao(wc)       (0x0E80 <= (wc) && (wc) < 0x0EE0)
34 /* ucs2tis()
35  * Lao:  [0x0E80..0x0EDF] -> [0x20..0x7F]
36  * Thai: [0x0E00..0x0E5F] -> [0xA0..0xFF]
37  */
38 #define ucs2tis(wc)     (((wc) - 0x0E00 + 0x20)^0x80)
39
40 /* Define TACTIS character classes */
41 #define CTRL            0
42 #define NON             1
43 #define CONS            2
44 #define LV              3
45 #define FV1             4
46 #define FV2             5
47 #define FV3             6
48 #define AM              7
49 #define BV1             8
50 #define BV2             9
51 #define BD              10
52 #define TONE            11
53 #define AD1             12
54 #define AD2             13
55 #define AD3             14
56 #define AD4             15
57 #define AV1             16
58 #define AV2             17
59 #define AV3             18
60 #define BCON            19
61
62 #define _ND             0
63 #define _NC             1
64 #define _UC             (1<<1)
65 #define _BC             (1<<2)
66 #define _SC             (1<<3)
67 #define _AV             (1<<4)
68 #define _BV             (1<<5)
69 #define _TN             (1<<6)
70 #define _AD             (1<<7)
71 #define _BD             (1<<8)
72 #define _AM             (1<<9)
73
74 #define NoTailCons      _NC
75 #define UpTailCons      _UC
76 #define BotTailCons     _BC
77 #define SpltTailCons    _SC
78 #define Cons            (NoTailCons|UpTailCons|BotTailCons|SpltTailCons)
79 #define AboveVowel      _AV
80 #define BelowVowel      _BV
81 #define Tone            _TN
82 #define AboveDiac       _AD
83 #define BelowDiac       _BD
84 #define SaraAm          _AM
85
86 #define is_char_type(wc, mask)  (thai_char_type[ucs2tis ((wc))] & (mask))
87 #define TAC_char_class(wc) \
88         (isthai(wc)||islao(wc) ? thai_TAC_char_class[ucs2tis (wc)] : NON)
89 #define TAC_compose_input(wc1,wc2) \
90         thai_TAC_compose_input[TAC_char_class(wc1)][TAC_char_class(wc2)]
91
92 extern const gshort thai_char_type[256];
93 extern const gshort thai_TAC_char_class[256];
94 extern const gchar  thai_TAC_compose_input[20][20];
95
96 #endif /* __THAI_CHARPROP_H__ */