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:
27 * outFile = PgLayoutIter
28 * strct = PangoLayoutIter
39 * - pango_layout_iter_
47 * - pango.PgFontDescription
48 * - pango.PgFontMetrics
49 * - pango.PgFontFamily
52 * - pango.PgFontsetSimple
54 * - pango.PgAttributeList
58 * - pango.PgScriptIter
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
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
;
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
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.
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.
209 * whether motion was possible.
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.
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.
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.
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.
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()).
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).
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.
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.
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.
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).
353 * rectangle to fill with ink extents, or NULL
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).
369 * rectangle to fill with ink extents, or NULL
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
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().
410 * rectangle to fill with ink extents, or NULL
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.
427 * rectangle to fill with ink extents, or NULL
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
);