Blame modules/input/thai-charprop.h

Packit Service fb6fa5
/* Pango
Packit Service fb6fa5
 * thai-charprop.h:
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Copyright (C) 1999 Red Hat Software
Packit Service fb6fa5
 * Author: Owen Taylor <otaylor@redhat.com>
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Software and Language Engineering Laboratory, NECTEC
Packit Service fb6fa5
 * Author: Theppitak Karoonboonyanan <thep@links.nectec.or.th>
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Copyright (c) 1996-2000 by Sun Microsystems, Inc.
Packit Service fb6fa5
 * Author: Chookij Vanatham <Chookij.Vanatham@Eng.Sun.COM>
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Library General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
Packit Service fb6fa5
 * Library General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Library General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef __THAI_CHARPROP_H__
Packit Service fb6fa5
#define __THAI_CHARPROP_H__
Packit Service fb6fa5
Packit Service fb6fa5
#include <glib.h>
Packit Service fb6fa5
Packit Service fb6fa5
#define isthai(wc)      (0x0E00 <= (wc) && (wc) < 0x0E60)
Packit Service fb6fa5
#define islao(wc)       (0x0E80 <= (wc) && (wc) < 0x0EE0)
Packit Service fb6fa5
/* ucs2tis()
Packit Service fb6fa5
 * Lao:  [0x0E80..0x0EDF] -> [0x20..0x7F]
Packit Service fb6fa5
 * Thai: [0x0E00..0x0E5F] -> [0xA0..0xFF]
Packit Service fb6fa5
 */
Packit Service fb6fa5
#define ucs2tis(wc)     (((wc) - 0x0E00 + 0x20)^0x80)
Packit Service fb6fa5
Packit Service fb6fa5
/* Define TACTIS character classes */
Packit Service fb6fa5
#define CTRL		0
Packit Service fb6fa5
#define NON		1
Packit Service fb6fa5
#define CONS		2
Packit Service fb6fa5
#define LV		3
Packit Service fb6fa5
#define FV1		4
Packit Service fb6fa5
#define FV2		5
Packit Service fb6fa5
#define FV3		6
Packit Service fb6fa5
#define AM		7
Packit Service fb6fa5
#define BV1		8
Packit Service fb6fa5
#define BV2		9
Packit Service fb6fa5
#define BD		10
Packit Service fb6fa5
#define TONE		11
Packit Service fb6fa5
#define AD1		12
Packit Service fb6fa5
#define AD2		13
Packit Service fb6fa5
#define AD3		14
Packit Service fb6fa5
#define AD4		15
Packit Service fb6fa5
#define AV1		16
Packit Service fb6fa5
#define AV2		17
Packit Service fb6fa5
#define AV3		18
Packit Service fb6fa5
#define BCON		19
Packit Service fb6fa5
Packit Service fb6fa5
#define _ND		0
Packit Service fb6fa5
#define _NC		1
Packit Service fb6fa5
#define _UC		(1<<1)
Packit Service fb6fa5
#define _BC		(1<<2)
Packit Service fb6fa5
#define _SC		(1<<3)
Packit Service fb6fa5
#define _AV		(1<<4)
Packit Service fb6fa5
#define _BV		(1<<5)
Packit Service fb6fa5
#define _TN		(1<<6)
Packit Service fb6fa5
#define _AD		(1<<7)
Packit Service fb6fa5
#define _BD		(1<<8)
Packit Service fb6fa5
#define _AM		(1<<9)
Packit Service fb6fa5
Packit Service fb6fa5
#define NoTailCons	_NC
Packit Service fb6fa5
#define UpTailCons	_UC
Packit Service fb6fa5
#define BotTailCons	_BC
Packit Service fb6fa5
#define SpltTailCons	_SC
Packit Service fb6fa5
#define Cons		(NoTailCons|UpTailCons|BotTailCons|SpltTailCons)
Packit Service fb6fa5
#define AboveVowel	_AV
Packit Service fb6fa5
#define BelowVowel	_BV
Packit Service fb6fa5
#define Tone		_TN
Packit Service fb6fa5
#define AboveDiac	_AD
Packit Service fb6fa5
#define BelowDiac	_BD
Packit Service fb6fa5
#define SaraAm		_AM
Packit Service fb6fa5
Packit Service fb6fa5
#define is_char_type(wc, mask)	(thai_char_type[ucs2tis ((wc))] & (mask))
Packit Service fb6fa5
#define TAC_char_class(wc) \
Packit Service fb6fa5
	(isthai(wc)||islao(wc) ? thai_TAC_char_class[ucs2tis (wc)] : NON)
Packit Service fb6fa5
#define TAC_compose_input(wc1,wc2) \
Packit Service fb6fa5
	thai_TAC_compose_input[TAC_char_class(wc1)][TAC_char_class(wc2)]
Packit Service fb6fa5
Packit Service fb6fa5
extern const gshort thai_char_type[256];
Packit Service fb6fa5
extern const gshort thai_TAC_char_class[256];
Packit Service fb6fa5
extern const gchar  thai_TAC_compose_input[20][20];
Packit Service fb6fa5
Packit Service fb6fa5
#endif /* __THAI_CHARPROP_H__ */