home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / cintltst / cbiditst.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-01  |  2.4 KB  |  91 lines

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