]> git.sur5r.net Git - openldap/blob - libraries/liblunicode/ucdata/bidiapi.txt
ITS#8527 - Add additional debug logging on consumer/provider state when the consumer...
[openldap] / libraries / liblunicode / ucdata / bidiapi.txt
1 #
2 # $Id: bidiapi.txt,v 1.2 1999/11/19 15:24:29 mleisher Exp $
3 #
4
5                        "Pretty Good Bidi Algorithm" API
6
7 The PGBA (Pretty Good Bidi Algorithm) is an effective alternative to the
8 Unicode BiDi algorithm.  It currently provides only implicit reordering and
9 does not yet support explicit reordering codes that the Unicode BiDi algorithm
10 supports.  In addition to reordering, the PGBA includes cursor movement
11 support for both visual and logical navigation.
12
13 -----------------------------------------------------------------------------
14
15 #define UCPGBA_LTR 0
16 #define UCPGBA_RTL 1
17
18   These macros appear in the `direction' field of the data structures.
19
20 #define UCPGBA_CURSOR_VISUAL  0
21 #define UCPGBA_CURSOR_LOGICAL 1
22
23   These macros are used to set the cursor movement for each reordered string.
24
25 -----------------------------------------------------------------------------
26
27 ucstring_t *ucstring_create(unsigned long *source, unsigned long start,
28                             unsigned long end, int default_direction,
29                             int cursor_motion)
30
31   This function will create a reordered string by using the implicit
32   directionality of the characters in the specified substring.
33
34   The `default_direction' parameter should be one of UCPGBA_LTR or UCPGBA_RTL
35   and is used only in cases where a string contains no characters with strong
36   directionality.
37
38   The `cursor_motion' parameter should be one of UCPGBA_CURSOR_VISUAL or
39   UCPGBA_CURSOR_LOGICAL, and is used to specify the initial cursor motion
40   behavior.  This behavior can be switched at any time using
41   ustring_set_cursor_motion().
42
43 -----------------------------------------------------------------------------
44
45 void ucstring_free(ucstring_t *string)
46
47   This function will deallocate the memory used by the string, incuding the
48   string itself.
49
50 -----------------------------------------------------------------------------
51
52 void ucstring_cursor_info(ustring_t *string, int *direction,
53                           unsigned long *position)
54
55   This function will return the text position of the internal cursor and the
56   directionality of the text at that position.  The position returned is the
57   original text position of the character.
58
59 -----------------------------------------------------------------------------
60
61 int ucstring_set_cursor_motion(ucstring_t *string, int cursor_motion)
62
63   This function will change the cursor motion type and return the previous
64   cursor motion type.
65
66 -----------------------------------------------------------------------------
67
68 int ucstring_cursor_right(ucstring_t *string, int count)
69
70   This function will move the internal cursor to the right according to the
71   type of cursor motion set for the string.
72
73   If no cursor motion is performed, it returns 0.  Otherwise it will return a
74   1.
75
76 -----------------------------------------------------------------------------
77
78 int ucstring_cursor_left(ucstring_t *string, int count)
79
80   This function will move the internal cursor to the left according to the
81   type of cursor motion set for the string.
82
83   If no cursor motion is performed, it returns 0.  Otherwise it will return a
84   1.