~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to packages/extra/gtk2/pango/pango-break.inc

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// included by pango.pp
 
2
{$IFDEF read_interface_types}
 
3
 
 
4
{ Logical attributes of a character.
 
5
  }
 
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)
 
12
    }
 
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)
 
16
    }
 
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
 
25
     sentences.
 
26
    }
 
27
{ first character in a sentence  }
 
28
{ first non-sentence char after a sentence  }
 
29
   PPangoLogAttr = ^TPangoLogAttr;
 
30
   TPangoLogAttr = record
 
31
        flag0 : word;
 
32
     end;
 
33
{$ENDIF read_interface_types}
 
34
 
 
35
//------------------------------------------------------------------------------
 
36
 
 
37
{$IFDEF read_interface_functions}
 
38
const
 
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;
 
59
 
 
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
 
81
   of Unicode text.
 
82
  }
 
83
 
 
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.
 
93
  }
 
94
 
 
95
procedure pango_default_break(text:Pgchar; length:longint; analysis:PPangoAnalysis; attrs:PPangoLogAttr; attrs_len:longint); cdecl; external pangolib;
 
96
{$endif PANGO_ENABLE_ENGINE}
 
97
 
 
98
{$endif read_interface_functions}
 
99
 
 
100
//------------------------------------------------------------------------------
 
101
 
 
102
{$IFDEF read_implementation}
 
103
function is_line_break(var a : TPangoLogAttr) : guint;
 
104
begin
 
105
  is_line_break:=(a.flag0 and bm_TPangoLogAttr_is_line_break) shr bp_TPangoLogAttr_is_line_break;
 
106
end;
 
107
 
 
108
procedure set_is_line_break(var a : TPangoLogAttr; __is_line_break : guint);
 
109
begin
 
110
  a.flag0:=a.flag0 or ((__is_line_break shl bp_TPangoLogAttr_is_line_break) and bm_TPangoLogAttr_is_line_break);
 
111
end;
 
112
 
 
113
function is_mandatory_break(var a : TPangoLogAttr) : guint;
 
114
begin
 
115
  is_mandatory_break:=(a.flag0 and bm_TPangoLogAttr_is_mandatory_break) shr bp_TPangoLogAttr_is_mandatory_break;
 
116
end;
 
117
 
 
118
procedure set_is_mandatory_break(var a : TPangoLogAttr; __is_mandatory_break : guint);
 
119
begin
 
120
  a.flag0:=a.flag0 or ((__is_mandatory_break shl bp_TPangoLogAttr_is_mandatory_break) and bm_TPangoLogAttr_is_mandatory_break);
 
121
end;
 
122
 
 
123
function is_char_break(var a : TPangoLogAttr) : guint;
 
124
begin
 
125
  is_char_break:=(a.flag0 and bm_TPangoLogAttr_is_char_break) shr bp_TPangoLogAttr_is_char_break;
 
126
end;
 
127
 
 
128
procedure set_is_char_break(var a : TPangoLogAttr; __is_char_break : guint);
 
129
begin
 
130
  a.flag0:=a.flag0 or ((__is_char_break shl bp_TPangoLogAttr_is_char_break) and bm_TPangoLogAttr_is_char_break);
 
131
end;
 
132
 
 
133
function is_white(var a : TPangoLogAttr) : guint;
 
134
begin
 
135
  is_white:=(a.flag0 and bm_TPangoLogAttr_is_white) shr bp_TPangoLogAttr_is_white;
 
136
end;
 
137
 
 
138
procedure set_is_white(var a : TPangoLogAttr; __is_white : guint);
 
139
begin
 
140
  a.flag0:=a.flag0 or ((__is_white shl bp_TPangoLogAttr_is_white) and bm_TPangoLogAttr_is_white);
 
141
end;
 
142
 
 
143
function is_cursor_position(var a : TPangoLogAttr) : guint;
 
144
begin
 
145
  is_cursor_position:=(a.flag0 and bm_TPangoLogAttr_is_cursor_position) shr bp_TPangoLogAttr_is_cursor_position;
 
146
end;
 
147
 
 
148
procedure set_is_cursor_position(var a : TPangoLogAttr; __is_cursor_position : guint);
 
149
begin
 
150
  a.flag0:=a.flag0 or ((__is_cursor_position shl bp_TPangoLogAttr_is_cursor_position) and bm_TPangoLogAttr_is_cursor_position);
 
151
end;
 
152
 
 
153
function is_word_start(var a : TPangoLogAttr) : guint;
 
154
begin
 
155
  is_word_start:=(a.flag0 and bm_TPangoLogAttr_is_word_start) shr bp_TPangoLogAttr_is_word_start;
 
156
end;
 
157
 
 
158
procedure set_is_word_start(var a : TPangoLogAttr; __is_word_start : guint);
 
159
begin
 
160
  a.flag0:=a.flag0 or ((__is_word_start shl bp_TPangoLogAttr_is_word_start) and bm_TPangoLogAttr_is_word_start);
 
161
end;
 
162
 
 
163
function is_word_end(var a : TPangoLogAttr) : guint;
 
164
begin
 
165
  is_word_end:=(a.flag0 and bm_TPangoLogAttr_is_word_end) shr bp_TPangoLogAttr_is_word_end;
 
166
end;
 
167
 
 
168
procedure set_is_word_end(var a : TPangoLogAttr; __is_word_end : guint);
 
169
begin
 
170
  a.flag0:=a.flag0 or ((__is_word_end shl bp_TPangoLogAttr_is_word_end) and bm_TPangoLogAttr_is_word_end);
 
171
end;
 
172
 
 
173
function is_sentence_boundary(var a : TPangoLogAttr) : guint;
 
174
begin
 
175
  is_sentence_boundary:=(a.flag0 and bm_TPangoLogAttr_is_sentence_boundary) shr bp_TPangoLogAttr_is_sentence_boundary;
 
176
end;
 
177
 
 
178
procedure set_is_sentence_boundary(var a : TPangoLogAttr; __is_sentence_boundary : guint);
 
179
begin
 
180
  a.flag0:=a.flag0 or ((__is_sentence_boundary shl bp_TPangoLogAttr_is_sentence_boundary) and bm_TPangoLogAttr_is_sentence_boundary);
 
181
end;
 
182
 
 
183
function is_sentence_start(var a : TPangoLogAttr) : guint;
 
184
begin
 
185
  is_sentence_start:=(a.flag0 and bm_TPangoLogAttr_is_sentence_start) shr bp_TPangoLogAttr_is_sentence_start;
 
186
end;
 
187
 
 
188
procedure set_is_sentence_start(var a : TPangoLogAttr; __is_sentence_start : guint);
 
189
begin
 
190
  a.flag0:=a.flag0 or ((__is_sentence_start shl bp_TPangoLogAttr_is_sentence_start) and bm_TPangoLogAttr_is_sentence_start);
 
191
end;
 
192
 
 
193
function is_sentence_end(var a : TPangoLogAttr) : guint;
 
194
begin
 
195
  is_sentence_end:=(a.flag0 and bm_TPangoLogAttr_is_sentence_end) shr bp_TPangoLogAttr_is_sentence_end;
 
196
end;
 
197
 
 
198
procedure set_is_sentence_end(var a : TPangoLogAttr; __is_sentence_end : guint);
 
199
begin
 
200
  a.flag0:=a.flag0 or ((__is_sentence_end shl bp_TPangoLogAttr_is_sentence_end) and bm_TPangoLogAttr_is_sentence_end);
 
201
end;
 
202
{$ENDIF read_implementation}
 
203