1 /* 2 * %W% TriChlor: %G% %U% 3 */ 4 5 #ifndef _VNKEYS_H_ 6 #define _VNKEYS_H_ 7 8 #include "portable.h" 9 #include "vncompos.h" /* for Co_data declaration below */ 10 11 /* maximum number of processing engines going at the same time */ 12 #define VK_MAX_FSMS 3 13 14 #define VK_ST_VIETNAMESE 0 15 #define VK_ST_ENGLISH 1 16 #define VK_ST_LITERAL 2 17 #define VK_ST_ESC_VIETMY 3 18 #define VK_ST_ESC_LITERAL 4 19 #define VK_ST_EXPLICIT_COMPOSE 5 20 21 #define VK_DEFAULT_ESC '\\' 22 #define VK_DEFAULT_BS '\010' /* BS used in IMMEDIATE mode */ 23 24 #define VK_ESC_VIETNAMESE_1 'V' 25 #define VK_ESC_VIETNAMESE_2 'v' 26 #define VK_ESC_ENGLISH_1 'M' 27 #define VK_ESC_ENGLISH_2 'm' 28 #define VK_ESC_LITERAL_1 'L' 29 #define VK_ESC_LITERAL_2 'l' 30 31 #define VK_GET_STATE 0x1 32 #define VK_GET_ESC 0x2 33 #define VK_GET_BS 0x4 34 #define VK_GET_BATCH 0x8 35 36 #define VK_SET_STATE 0x1 37 #define VK_SET_ESC 0x2 38 #define VK_SET_BS 0x4 39 #define VK_SET_BATCH 0x8 40 41 typedef int Vk_Fsm; 42 typedef int Vk_State; 43 44 extern Co_Data FAR Co_data[]; /* storage area for composition machiner */ 45 /* Convenience macro */ 46 #define vk_set_diacritic(id, diacritic, character) vncompose_set(diacritic, character, &(Co_data[id])); 47 #define vk_get_breve(id) (Co_data[id].breve) 48 #define vk_get_circumflex(id) (Co_data[id].circumflex) 49 #define vk_get_horn(id) (Co_data[id].horn) 50 #define vk_get_acute(id) (Co_data[id].acute) 51 #define vk_get_grave(id) (Co_data[id].grave) 52 #define vk_get_hook_above(id) (Co_data[id].hook_above) 53 #define vk_get_tilde(id) (Co_data[id].tilde) 54 #define vk_get_dot_below(id) (Co_data[id].dot_below) 55 56 /* initialize the FSM */ 57 extern Vk_Fsm FAR PASCAL vk_init(); 58 /* step through it */ 59 extern Vk_State FAR PASCAL vk_step(); 60 /* query its status */ 61 extern void FAR PASCAL vk_get(); 62 /* set its status */ 63 extern void FAR PASCAL vk_set(); 64 /* flush it */ 65 extern void FAR PASCAL vk_flush(); 66 extern void FAR PASCAL vk_end(); 67 /* parse standard arguments */ 68 extern void FAR PASCAL vk_parse_args(); 69 70 /* convert VK to 8-bit data */ 71 extern int FAR PASCAL vk_qrto8(); 72 /* convert 8- to VK data */ 73 extern int FAR PASCAL vk_8toqr(); 74 75 #endif /* _VNKEYS_H_ */ 76