alternative to assert
[gtkD.git] / src / pango / PgCoverage.d
blob606fea9f11594583e4467ea9611cddcbdaaf5c00
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 = pango-Coverage-Maps.html
26 * outPack = pango
27 * outFile = PgCoverage
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = PgCoverage
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - pango_coverage_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * structWrap:
45 * local aliases:
48 module pango.PgCoverage;
50 private import pango.pangotypes;
52 private import lib.pango;
55 /**
56 * Description
57 * It is often necessary in Pango to determine if a particular font can
58 * represent a particular character, and also how well it can represent
59 * that character. The PangoCoverage is a data structure that is used
60 * to represent that information.
62 public class PgCoverage
65 /**
71 /**
72 * Create a new PangoCoverage
73 * Returns:
74 * the newly allocated PangoCoverage,
75 * initialized to PANGO_COVERAGE_NONE
76 * with a reference count of one, which
77 * should be freed with pango_coverage_unref().
79 public static PangoCoverage* newPgCoverage()
81 // PangoCoverage* pango_coverage_new (void);
82 return pango_coverage_new();
85 /**
86 * Increase the reference count on the PangoCoverage by one
87 * coverage:
88 * a PangoCoverage
89 * Returns:
90 * coverage
92 public static PangoCoverage* ref(PangoCoverage* coverage)
94 // PangoCoverage* pango_coverage_ref (PangoCoverage *coverage);
95 return pango_coverage_ref(coverage);
98 /**
99 * Increase the reference count on the PangoCoverage by one.
100 * if the result is zero, free the coverage and all associated memory.
101 * coverage:
102 * a PangoCoverage
104 public static void unref(PangoCoverage* coverage)
106 // void pango_coverage_unref (PangoCoverage *coverage);
107 pango_coverage_unref(coverage);
111 * Copy an existing PangoCoverage. (This function may now be unecessary
112 * since we refcount the structure. Mail otaylorredhat.com if you
113 * use it.)
114 * coverage:
115 * a PangoCoverage
116 * Returns:
117 * the newly allocated PangoCoverage,
118 * with a reference count of one, which
119 * should be freed with pango_coverage_unref().
121 public static PangoCoverage* copy(PangoCoverage* coverage)
123 // PangoCoverage* pango_coverage_copy (PangoCoverage *coverage);
124 return pango_coverage_copy(coverage);
128 * Determine whether a particular index is covered by coverage
129 * coverage:
130 * a PangoCoverage
131 * index_:
132 * the index to check
133 * Returns:
134 * the coverage level of coverage for character index_.
136 public static PangoCoverageLevel get(PangoCoverage* coverage, int index)
138 // PangoCoverageLevel pango_coverage_get (PangoCoverage *coverage, int index_);
139 return pango_coverage_get(coverage, index);
143 * Set the coverage for each index in coverage to be the max (better)
144 * value of the current coverage for the index and the coverage for
145 * the corresponding index in other.
146 * coverage:
147 * a PangoCoverage
148 * other:
149 * another PangoCoverage
151 public static void max(PangoCoverage* coverage, PangoCoverage* other)
153 // void pango_coverage_max (PangoCoverage *coverage, PangoCoverage *other);
154 pango_coverage_max(coverage, other);
158 * Modify a particular index within coverage
159 * coverage:
160 * a PangoCoverage
161 * index_:
162 * the index to modify
163 * level:
164 * the new level for index_
166 public static void set(PangoCoverage* coverage, int index, PangoCoverageLevel level)
168 // void pango_coverage_set (PangoCoverage *coverage, int index_, PangoCoverageLevel level);
169 pango_coverage_set(coverage, index, level);
173 * Convert a PangoCoverage structure into a flat binary format
174 * coverage:
175 * a PangoCoverage
176 * bytes:
177 * location to store result (must be freed with g_free())
178 * n_bytes:
179 * location to store size of result
181 public static void toBytes(PangoCoverage* coverage, char** bytes, int* nBytes)
183 // void pango_coverage_to_bytes (PangoCoverage *coverage, guchar **bytes, int *n_bytes);
184 pango_coverage_to_bytes(coverage, bytes, nBytes);
188 * Convert data generated from pango_converage_to_bytes() back
189 * to a PangoCoverage
190 * bytes:
191 * binary data representing a PangoCoverage
192 * n_bytes:
193 * the size of bytes in bytes
194 * Returns:
195 * a newly allocated PangoCoverage, or NULL if
196 * the data was invalid.
198 public static PangoCoverage* fromBytes(char* bytes, int nBytes)
200 // PangoCoverage* pango_coverage_from_bytes (guchar *bytes, int n_bytes);
201 return pango_coverage_from_bytes(bytes, nBytes);