1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/******************************************************************** 2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * COPYRIGHT: 3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Copyright (c) 1997-2007, International Business Machines Corporation and 4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * others. All Rights Reserved. 5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru ********************************************************************/ 6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* file name: cbiditst.h 7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* encoding: US-ASCII 8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* tab size: 8 (not used) 9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* indentation:4 10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* 11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* created on: 1999sep22 12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* created by: Markus W. Scherer 13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/ 14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef CBIDITST_H 16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define CBIDITST_H 17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/utypes.h" 19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/uchar.h" 20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/ubidi.h" 21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifdef XP_CPLUSPLUS 23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruextern "C" { 24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif 25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define MAX_STRING_LENGTH 200 27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* length of an array */ 29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) 30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* Comparing the description of the BiDi algorithm with this implementation 32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru is easier with the same names for the BiDi types in the code as there. 33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru See UCharDirection in uchar.h . 34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/ 35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define L U_LEFT_TO_RIGHT 36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define R U_RIGHT_TO_LEFT 37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define EN U_EUROPEAN_NUMBER 38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define ES U_EUROPEAN_NUMBER_SEPARATOR 39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define ET U_EUROPEAN_NUMBER_TERMINATOR 40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define AN U_ARABIC_NUMBER 41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define CS U_COMMON_NUMBER_SEPARATOR 42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define B U_BLOCK_SEPARATOR 43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define S U_SEGMENT_SEPARATOR 44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define WS U_WHITE_SPACE_NEUTRAL 45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define ON U_OTHER_NEUTRAL 46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define LRE U_LEFT_TO_RIGHT_EMBEDDING 47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define LRO U_LEFT_TO_RIGHT_OVERRIDE 48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define AL U_RIGHT_TO_LEFT_ARABIC 49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define RLE U_RIGHT_TO_LEFT_EMBEDDING 50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define RLO U_RIGHT_TO_LEFT_OVERRIDE 51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define PDF U_POP_DIRECTIONAL_FORMAT 52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define NSM U_DIR_NON_SPACING_MARK 53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define BN U_BOUNDARY_NEUTRAL 54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruextern const char * const 56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QuerudirPropNames[U_CHAR_DIRECTION_COUNT]; 57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruextern UChar 59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QuerucharFromDirProp[U_CHAR_DIRECTION_COUNT]; 60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querutypedef struct { 62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru const uint8_t *text; 63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru int32_t length; 64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UBiDiLevel paraLevel; 65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru int32_t lineStart, lineLimit; 66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UBiDiDirection direction; 67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UBiDiLevel resultLevel; 68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru const UBiDiLevel *levels; 69ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru const uint8_t *visualMap; 70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} BiDiTestData; 71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruextern const BiDiTestData 73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querutests[]; 74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruextern const int 76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QuerubidiTestCount; 77ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifdef XP_CPLUSPLUS 79ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif 81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif 83