1
// included by pango.pp
2
{$IFDEF read_interface_types}
4
{ Logical attributes of a character.
6
{ Can break line in front of character }
7
{ Must break line in front of character }
8
{ Can break here when doing char wrap }
9
{ Whitespace character }
10
{ cursor can appear in front of character (i.e. this is a grapheme
11
boundary, or the first character in the text)
13
{ Note that in degenerate cases, you could have both start/theEnd set on
14
some text, most likely for sentences (e.g. no space after a period, so
15
the next sentence starts right away)
17
{ first character in a word }
18
{ is first non-word char after a word }
19
{ There are two ways to divide sentences. The first assigns all
20
intersentence whitespace/control/format chars to some sentence,
21
so all chars are in some sentence; is_sentence_boundary denotes
22
the boundaries there. The second way doesn't assign
23
between-sentence spaces, etc. to any sentence, so
24
is_sentence_start/is_sentence_end mark the boundaries of those
27
{ first character in a sentence }
28
{ first non-sentence char after a sentence }
29
PPangoLogAttr = ^TPangoLogAttr;
30
TPangoLogAttr = record
33
{$ENDIF read_interface_types}
35
//------------------------------------------------------------------------------
37
{$IFDEF read_interface_functions}
39
bm_TPangoLogAttr_is_line_break = $1;
40
bp_TPangoLogAttr_is_line_break = 0;
41
bm_TPangoLogAttr_is_mandatory_break = $2;
42
bp_TPangoLogAttr_is_mandatory_break = 1;
43
bm_TPangoLogAttr_is_char_break = $4;
44
bp_TPangoLogAttr_is_char_break = 2;
45
bm_TPangoLogAttr_is_white = $8;
46
bp_TPangoLogAttr_is_white = 3;
47
bm_TPangoLogAttr_is_cursor_position = $10;
48
bp_TPangoLogAttr_is_cursor_position = 4;
49
bm_TPangoLogAttr_is_word_start = $20;
50
bp_TPangoLogAttr_is_word_start = 5;
51
bm_TPangoLogAttr_is_word_end = $40;
52
bp_TPangoLogAttr_is_word_end = 6;
53
bm_TPangoLogAttr_is_sentence_boundary = $80;
54
bp_TPangoLogAttr_is_sentence_boundary = 7;
55
bm_TPangoLogAttr_is_sentence_start = $100;
56
bp_TPangoLogAttr_is_sentence_start = 8;
57
bm_TPangoLogAttr_is_sentence_end = $200;
58
bp_TPangoLogAttr_is_sentence_end = 9;
60
function is_line_break(var a : TPangoLogAttr) : guint;
61
procedure set_is_line_break(var a : TPangoLogAttr; __is_line_break : guint);
62
function is_mandatory_break(var a : TPangoLogAttr) : guint;
63
procedure set_is_mandatory_break(var a : TPangoLogAttr; __is_mandatory_break : guint);
64
function is_char_break(var a : TPangoLogAttr) : guint;
65
procedure set_is_char_break(var a : TPangoLogAttr; __is_char_break : guint);
66
function is_white(var a : TPangoLogAttr) : guint;
67
procedure set_is_white(var a : TPangoLogAttr; __is_white : guint);
68
function is_cursor_position(var a : TPangoLogAttr) : guint;
69
procedure set_is_cursor_position(var a : TPangoLogAttr; __is_cursor_position : guint);
70
function is_word_start(var a : TPangoLogAttr) : guint;
71
procedure set_is_word_start(var a : TPangoLogAttr; __is_word_start : guint);
72
function is_word_end(var a : TPangoLogAttr) : guint;
73
procedure set_is_word_end(var a : TPangoLogAttr; __is_word_end : guint);
74
function is_sentence_boundary(var a : TPangoLogAttr) : guint;
75
procedure set_is_sentence_boundary(var a : TPangoLogAttr; __is_sentence_boundary : guint);
76
function is_sentence_start(var a : TPangoLogAttr) : guint;
77
procedure set_is_sentence_start(var a : TPangoLogAttr; __is_sentence_start : guint);
78
function is_sentence_end(var a : TPangoLogAttr) : guint;
79
procedure set_is_sentence_end(var a : TPangoLogAttr; __is_sentence_end : guint);
80
{ Determine information about cluster/word/line breaks in a string
84
procedure pango_break(text:Pgchar; length:longint; analysis:PPangoAnalysis; attrs:PPangoLogAttr; attrs_len:longint); cdecl; external pangolib;
85
procedure pango_find_paragraph_boundary(text:Pgchar; length:gint; paragraph_delimiter_index:Pgint; next_paragraph_start:Pgint); cdecl; external pangolib;
86
procedure pango_get_log_attrs(text:Pchar; length:longint; level:longint; language:PPangoLanguage; log_attrs:PPangoLogAttr;
87
attrs_len:longint); cdecl; external pangolib;
88
{$ifdef PANGO_ENABLE_ENGINE}
89
{ This is the default break algorithm, used if no language
90
engine overrides it. Normally you should use pango_break()
91
instead; this function is mostly useful for chaining up
92
from a language engine override.
95
procedure pango_default_break(text:Pgchar; length:longint; analysis:PPangoAnalysis; attrs:PPangoLogAttr; attrs_len:longint); cdecl; external pangolib;
96
{$endif PANGO_ENABLE_ENGINE}
98
{$endif read_interface_functions}
100
//------------------------------------------------------------------------------
102
{$IFDEF read_implementation}
103
function is_line_break(var a : TPangoLogAttr) : guint;
105
is_line_break:=(a.flag0 and bm_TPangoLogAttr_is_line_break) shr bp_TPangoLogAttr_is_line_break;
108
procedure set_is_line_break(var a : TPangoLogAttr; __is_line_break : guint);
110
a.flag0:=a.flag0 or ((__is_line_break shl bp_TPangoLogAttr_is_line_break) and bm_TPangoLogAttr_is_line_break);
113
function is_mandatory_break(var a : TPangoLogAttr) : guint;
115
is_mandatory_break:=(a.flag0 and bm_TPangoLogAttr_is_mandatory_break) shr bp_TPangoLogAttr_is_mandatory_break;
118
procedure set_is_mandatory_break(var a : TPangoLogAttr; __is_mandatory_break : guint);
120
a.flag0:=a.flag0 or ((__is_mandatory_break shl bp_TPangoLogAttr_is_mandatory_break) and bm_TPangoLogAttr_is_mandatory_break);
123
function is_char_break(var a : TPangoLogAttr) : guint;
125
is_char_break:=(a.flag0 and bm_TPangoLogAttr_is_char_break) shr bp_TPangoLogAttr_is_char_break;
128
procedure set_is_char_break(var a : TPangoLogAttr; __is_char_break : guint);
130
a.flag0:=a.flag0 or ((__is_char_break shl bp_TPangoLogAttr_is_char_break) and bm_TPangoLogAttr_is_char_break);
133
function is_white(var a : TPangoLogAttr) : guint;
135
is_white:=(a.flag0 and bm_TPangoLogAttr_is_white) shr bp_TPangoLogAttr_is_white;
138
procedure set_is_white(var a : TPangoLogAttr; __is_white : guint);
140
a.flag0:=a.flag0 or ((__is_white shl bp_TPangoLogAttr_is_white) and bm_TPangoLogAttr_is_white);
143
function is_cursor_position(var a : TPangoLogAttr) : guint;
145
is_cursor_position:=(a.flag0 and bm_TPangoLogAttr_is_cursor_position) shr bp_TPangoLogAttr_is_cursor_position;
148
procedure set_is_cursor_position(var a : TPangoLogAttr; __is_cursor_position : guint);
150
a.flag0:=a.flag0 or ((__is_cursor_position shl bp_TPangoLogAttr_is_cursor_position) and bm_TPangoLogAttr_is_cursor_position);
153
function is_word_start(var a : TPangoLogAttr) : guint;
155
is_word_start:=(a.flag0 and bm_TPangoLogAttr_is_word_start) shr bp_TPangoLogAttr_is_word_start;
158
procedure set_is_word_start(var a : TPangoLogAttr; __is_word_start : guint);
160
a.flag0:=a.flag0 or ((__is_word_start shl bp_TPangoLogAttr_is_word_start) and bm_TPangoLogAttr_is_word_start);
163
function is_word_end(var a : TPangoLogAttr) : guint;
165
is_word_end:=(a.flag0 and bm_TPangoLogAttr_is_word_end) shr bp_TPangoLogAttr_is_word_end;
168
procedure set_is_word_end(var a : TPangoLogAttr; __is_word_end : guint);
170
a.flag0:=a.flag0 or ((__is_word_end shl bp_TPangoLogAttr_is_word_end) and bm_TPangoLogAttr_is_word_end);
173
function is_sentence_boundary(var a : TPangoLogAttr) : guint;
175
is_sentence_boundary:=(a.flag0 and bm_TPangoLogAttr_is_sentence_boundary) shr bp_TPangoLogAttr_is_sentence_boundary;
178
procedure set_is_sentence_boundary(var a : TPangoLogAttr; __is_sentence_boundary : guint);
180
a.flag0:=a.flag0 or ((__is_sentence_boundary shl bp_TPangoLogAttr_is_sentence_boundary) and bm_TPangoLogAttr_is_sentence_boundary);
183
function is_sentence_start(var a : TPangoLogAttr) : guint;
185
is_sentence_start:=(a.flag0 and bm_TPangoLogAttr_is_sentence_start) shr bp_TPangoLogAttr_is_sentence_start;
188
procedure set_is_sentence_start(var a : TPangoLogAttr; __is_sentence_start : guint);
190
a.flag0:=a.flag0 or ((__is_sentence_start shl bp_TPangoLogAttr_is_sentence_start) and bm_TPangoLogAttr_is_sentence_start);
193
function is_sentence_end(var a : TPangoLogAttr) : guint;
195
is_sentence_end:=(a.flag0 and bm_TPangoLogAttr_is_sentence_end) shr bp_TPangoLogAttr_is_sentence_end;
198
procedure set_is_sentence_end(var a : TPangoLogAttr; __is_sentence_end : guint);
200
a.flag0:=a.flag0 or ((__is_sentence_end shl bp_TPangoLogAttr_is_sentence_end) and bm_TPangoLogAttr_is_sentence_end);
202
{$ENDIF read_implementation}