alternative to assert
[gtkD.git] / src / pango / PgLayoutIter.d
blob9cfa6b167ca05cea7c70cd9733b04e255d6feded
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile =
26 * outPack = pango
27 * outFile = PgLayoutIter
28 * strct = PangoLayoutIter
29 * realStrct=
30 * ctorStrct=
31 * clss = PgLayoutIter
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - pango_layout_iter_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - pango.PgContext
45 * - pango.PgItem
46 * - pango.PgLayout
47 * - pango.PgFontDescription
48 * - pango.PgFontMetrics
49 * - pango.PgFontFamily
50 * - pango.PgFontFace
51 * - pango.PgFontMap
52 * - pango.PgFontsetSimple
53 * - pango.PgAttribute
54 * - pango.PgAttributeList
55 * - pango.PgLanguage
56 * - pango.PgTabArray
57 * - pango.PgLayout
58 * - pango.PgScriptIter
59 * structWrap:
60 * - PangoAttribute* -> PgAttribute
61 * - PangoAttributeList* -> PgAttributeList
62 * - PangoContext* -> PgContext
63 * - PangoFontDescription* -> PgFontDescription
64 * - PangoFontFace* -> PgFontFace
65 * - PangoFontFamily* -> PgFontFamily
66 * - PangoFontMap* -> PgFontMap
67 * - PangoFontMetrics* -> PgFontMetrics
68 * - PangoFontsetSimple* -> PgFontsetSimple
69 * - PangoItem* -> PgItem
70 * - PangoLanguage* -> PgLanguage
71 * - PangoLayout* -> PgLayout
72 * - PangoScriptIter* -> PgScriptIter
73 * - PangoTabArray* -> PgTabArray
74 * local aliases:
77 module pango.PgLayoutIter;
79 private import pango.pangotypes;
81 private import lib.pango;
83 private import pango.PgContext;
84 private import pango.PgItem;
85 private import pango.PgLayout;
86 private import pango.PgFontDescription;
87 private import pango.PgFontMetrics;
88 private import pango.PgFontFamily;
89 private import pango.PgFontFace;
90 private import pango.PgFontMap;
91 private import pango.PgFontsetSimple;
92 private import pango.PgAttribute;
93 private import pango.PgAttributeList;
94 private import pango.PgLanguage;
95 private import pango.PgTabArray;
96 private import pango.PgLayout;
97 private import pango.PgScriptIter;
99 /**
100 * Description
101 * While complete access to the layout capabilities of Pango is provided
102 * using the detailed interfaces for itemization and shaping, using
103 * that functionality directly involves writing a fairly large amount
104 * of code. The objects and functions in this section provide a
105 * high-level driver for formatting entire paragraphs of text
106 * at once.
108 public class PgLayoutIter
111 /** the main Gtk struct */
112 protected PangoLayoutIter* pangoLayoutIter;
115 public PangoLayoutIter* getPgLayoutIterStruct()
117 return pangoLayoutIter;
121 /** the main Gtk struct as a void* */
122 protected void* getStruct()
124 return cast(void*)pangoLayoutIter;
128 * Sets our main struct and passes it to the parent class
130 public this (PangoLayoutIter* pangoLayoutIter)
132 this.pangoLayoutIter = pangoLayoutIter;
193 * Frees an iterator that's no longer in use.
194 * iter:
195 * a PangoLayoutIter
197 public void free()
199 // void pango_layout_iter_free (PangoLayoutIter *iter);
200 pango_layout_iter_free(pangoLayoutIter);
204 * Moves iter forward to the next run in visual order. If iter was
205 * already at the end of the layout, returns FALSE.
206 * iter:
207 * a PangoLayoutIter
208 * Returns:
209 * whether motion was possible.
211 public int nextRun()
213 // gboolean pango_layout_iter_next_run (PangoLayoutIter *iter);
214 return pango_layout_iter_next_run(pangoLayoutIter);
218 * Moves iter forward to the next character in visual order. If iter was already at
219 * the end of the layout, returns FALSE.
220 * iter:
221 * a PangoLayoutIter
222 * Returns:
223 * whether motion was possible.
225 public int nextChar()
227 // gboolean pango_layout_iter_next_char (PangoLayoutIter *iter);
228 return pango_layout_iter_next_char(pangoLayoutIter);
232 * Moves iter forward to the next cluster in visual order. If iter
233 * was already at the end of the layout, returns FALSE.
234 * iter:
235 * a PangoLayoutIter
236 * Returns:
237 * whether motion was possible.
239 public int nextCluster()
241 // gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter);
242 return pango_layout_iter_next_cluster(pangoLayoutIter);
246 * Moves iter forward to the start of the next line. If iter is
247 * already on the last line, returns FALSE.
248 * iter:
249 * a PangoLayoutIter
250 * Returns:
251 * whether motion was possible.
253 public int nextLine()
255 // gboolean pango_layout_iter_next_line (PangoLayoutIter *iter);
256 return pango_layout_iter_next_line(pangoLayoutIter);
260 * Determines whether iter is on the last line of the layout.
261 * iter:
262 * a PangoLayoutIter
263 * Returns:
264 * TRUE if iter is on the last line.
266 public int atLastLine()
268 // gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter);
269 return pango_layout_iter_at_last_line(pangoLayoutIter);
273 * Gets the current byte index. Note that iterating forward by char
274 * moves in visual order, not logical order, so indexes may not be
275 * sequential. Also, the index may be equal to the length of the text
276 * in the layout, if on the NULL run (see pango_layout_iter_get_run()).
277 * iter:
278 * a PangoLayoutIter
279 * Returns:
280 * current byte index.
282 public int getIndex()
284 // int pango_layout_iter_get_index (PangoLayoutIter *iter);
285 return pango_layout_iter_get_index(pangoLayoutIter);
289 * Gets the Y position of the current line's baseline, in layout
290 * coordinates (origin at top left of the entire layout).
291 * iter:
292 * a PangoLayoutIter
293 * Returns:
294 * baseline of current line.
296 public int getBaseline()
298 // int pango_layout_iter_get_baseline (PangoLayoutIter *iter);
299 return pango_layout_iter_get_baseline(pangoLayoutIter);
303 * Gets the current run. When iterating by run, at the end of each
304 * line, there's a position with a NULL run, so this function can return
305 * NULL. The NULL run at the end of each line ensures that all lines have
306 * at least one run, even lines consisting of only a newline.
307 * iter:
308 * a PangoLayoutIter
309 * Returns:
310 * the current run.
312 public PangoLayoutRun* getRun()
314 // PangoLayoutRun* pango_layout_iter_get_run (PangoLayoutIter *iter);
315 return pango_layout_iter_get_run(pangoLayoutIter);
319 * Gets the current line.
320 * iter:
321 * a PangoLayoutIter
322 * Returns:
323 * the current line.
325 public PangoLayoutLine* getLine()
327 // PangoLayoutLine* pango_layout_iter_get_line (PangoLayoutIter *iter);
328 return pango_layout_iter_get_line(pangoLayoutIter);
332 * Gets the extents of the current character, in layout coordinates
333 * (origin is the top left of the entire layout). Only logical extents
334 * can sensibly be obtained for characters; ink extents make sense only
335 * down to the level of clusters.
336 * iter:
337 * a PangoLayoutIter
338 * logical_rect:
339 * rectangle to fill with logical extents
341 public void getCharExtents(PangoRectangle* logicalRect)
343 // void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, PangoRectangle *logical_rect);
344 pango_layout_iter_get_char_extents(pangoLayoutIter, logicalRect);
348 * Gets the extents of the current cluster, in layout coordinates
349 * (origin is the top left of the entire layout).
350 * iter:
351 * a PangoLayoutIter
352 * ink_rect:
353 * rectangle to fill with ink extents, or NULL
354 * logical_rect:
355 * rectangle to fill with logical extents, or NULL
357 public void getClusterExtents(PangoRectangle* inkRect, PangoRectangle* logicalRect)
359 // void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
360 pango_layout_iter_get_cluster_extents(pangoLayoutIter, inkRect, logicalRect);
364 * Gets the extents of the current run in layout coordinates
365 * (origin is the top left of the entire layout).
366 * iter:
367 * a PangoLayoutIter
368 * ink_rect:
369 * rectangle to fill with ink extents, or NULL
370 * logical_rect:
371 * rectangle to fill with logical extents, or NULL
373 public void getRunExtents(PangoRectangle* inkRect, PangoRectangle* logicalRect)
375 // void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
376 pango_layout_iter_get_run_extents(pangoLayoutIter, inkRect, logicalRect);
380 * Divides the vertical space in the PangoLayout being iterated over
381 * between the lines in the layout, and returns the space belonging to
382 * the current line. A line's range includes the line's logical
383 * extents, plus half of the spacing above and below the line, if
384 * pango_layout_set_spacing() has been called to set layout spacing.
385 * The Y positions are in layout coordinates (origin at top left of the
386 * entire layout).
387 * iter:
388 * a PangoLayoutIter
389 * y0_:
390 * start of line
391 * y1_:
392 * end of line
394 public void getLineYrange(int* y0_, int* y1_)
396 // void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, int *y0_, int *y1_);
397 pango_layout_iter_get_line_yrange(pangoLayoutIter, y0_, y1_);
401 * Obtains the extents of the current line. ink_rect or logical_rect
402 * can be NULL if you aren't interested in them. Extents are in layout
403 * coordinates (origin is the top-left corner of the entire
404 * PangoLayout). Thus the extents returned by this function will be
405 * the same width/height but not at the same x/y as the extents
406 * returned from pango_layout_line_get_extents().
407 * iter:
408 * a PangoLayoutIter
409 * ink_rect:
410 * rectangle to fill with ink extents, or NULL
411 * logical_rect:
412 * rectangle to fill with logical extents, or NULL
414 public void getLineExtents(PangoRectangle* inkRect, PangoRectangle* logicalRect)
416 // void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
417 pango_layout_iter_get_line_extents(pangoLayoutIter, inkRect, logicalRect);
421 * Obtains the extents of the PangoLayout being iterated
422 * over. ink_rect or logical_rect can be NULL if you
423 * aren't interested in them.
424 * iter:
425 * a PangoLayoutIter
426 * ink_rect:
427 * rectangle to fill with ink extents, or NULL
428 * logical_rect:
429 * rectangle to fill with logical extents, or NULL
431 public void getLayoutExtents(PangoRectangle* inkRect, PangoRectangle* logicalRect)
433 // void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
434 pango_layout_iter_get_layout_extents(pangoLayoutIter, inkRect, logicalRect);