/usr/include/d/gtkd-3/pango/PgMiscellaneous.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module pango.PgMiscellaneous;
private import core.stdc.stdio;
private import glib.MemorySlice;
private import glib.Str;
private import glib.StringG;
public import gtkc.pangotypes;
private import pango.c.functions;
public import pango.c.types;
/** */
public struct PgMiscellaneous
{
/**
* Do not use. Does not do anything.
*
* Params:
* key = Key to look up, in the form "SECTION/KEY".
*
* Returns: %NULL
*/
public static string configKeyGet(string key)
{
auto retStr = pango_config_key_get(Str.toStringz(key));
scope(exit) Str.freeString(retStr);
return Str.toString(retStr);
}
/**
* Do not use. Does not do anything.
*
* Params:
* key = Key to look up, in the form "SECTION/KEY".
*
* Returns: %NULL
*/
public static string configKeyGetSystem(string key)
{
auto retStr = pango_config_key_get_system(Str.toStringz(key));
scope(exit) Str.freeString(retStr);
return Str.toString(retStr);
}
/**
* Returns the name of the "pango" subdirectory of LIBDIR
* (which is set at compile time).
*
* Returns: the Pango lib directory. The returned string should
* not be freed.
*/
public static string getLibSubdirectory()
{
return Str.toString(pango_get_lib_subdirectory());
}
/**
* Returns the name of the "pango" subdirectory of SYSCONFDIR
* (which is set at compile time).
*
* Returns: the Pango sysconf directory. The returned string should
* not be freed.
*/
public static string getSysconfSubdirectory()
{
return Str.toString(pango_get_sysconf_subdirectory());
}
/**
* Checks @ch to see if it is a character that should not be
* normally rendered on the screen. This includes all Unicode characters
* with "ZERO WIDTH" in their name, as well as <firstterm>bidi</firstterm> formatting characters, and
* a few other ones. This is totally different from g_unichar_iszerowidth()
* and is at best misnamed.
*
* Params:
* ch = a Unicode character
*
* Returns: %TRUE if @ch is a zero-width character, %FALSE otherwise
*
* Since: 1.10
*/
public static bool isZeroWidth(dchar ch)
{
return pango_is_zero_width(ch) != 0;
}
/**
* This will return the bidirectional embedding levels of the input paragraph
* as defined by the Unicode Bidirectional Algorithm available at:
*
* http://www.unicode.org/reports/tr9/
*
* If the input base direction is a weak direction, the direction of the
* characters in the text will determine the final resolved direction.
*
* Params:
* text = the text to itemize.
* length = the number of bytes (not characters) to process, or -1
* if @text is nul-terminated and the length should be calculated.
* pbaseDir = input base direction, and output resolved direction.
*
* Returns: a newly allocated array of embedding levels, one item per
* character (not byte), that should be freed using g_free.
*
* Since: 1.4
*/
public static ubyte* log2visGetEmbeddingLevels(string text, int length, PangoDirection* pbaseDir)
{
return pango_log2vis_get_embedding_levels(Str.toStringz(text), length, pbaseDir);
}
/**
* Look up all user defined aliases for the alias @fontname.
* The resulting font family names will be stored in @families,
* and the number of families in @n_families.
*
* Deprecated: This function is not thread-safe.
*
* Params:
* fontname = an ascii string
* families = will be set to an array of font family names.
* this array is owned by pango and should not be freed.
*/
public static void lookupAliases(string fontname, out string[] families)
{
char** outfamilies = null;
int nFamilies;
pango_lookup_aliases(Str.toStringz(fontname), &outfamilies, &nFamilies);
families = Str.toStringArray(outfamilies, nFamilies);
}
/**
* Parses an enum type and stores the result in @value.
*
* If @str does not match the nick name of any of the possible values for the
* enum and is not an integer, %FALSE is returned, a warning is issued
* if @warn is %TRUE, and a
* string representing the list of possible values is stored in
* @possible_values. The list is slash-separated, eg.
* "none/start/middle/end". If failed and @possible_values is not %NULL,
* returned string should be freed using g_free().
*
* Params:
* type = enum type to parse, eg. %PANGO_TYPE_ELLIPSIZE_MODE.
* str = string to parse. May be %NULL.
* value = integer to store the result in, or %NULL.
* warn = if %TRUE, issue a g_warning() on bad input.
* possibleValues = place to store list of possible values on failure, or %NULL.
*
* Returns: %TRUE if @str was successfully parsed.
*
* Since: 1.16
*/
public static bool parseEnum(GType type, string str, out int value, bool warn, out string possibleValues)
{
char* outpossibleValues = null;
auto p = pango_parse_enum(type, Str.toStringz(str), &value, warn, &outpossibleValues) != 0;
possibleValues = Str.toString(outpossibleValues);
return p;
}
/**
* Parses a font stretch. The allowed values are
* "ultra_condensed", "extra_condensed", "condensed",
* "semi_condensed", "normal", "semi_expanded", "expanded",
* "extra_expanded" and "ultra_expanded". Case variations are
* ignored and the '_' characters may be omitted.
*
* Params:
* str = a string to parse.
* stretch = a #PangoStretch to store the
* result in.
* warn = if %TRUE, issue a g_warning() on bad input.
*
* Returns: %TRUE if @str was successfully parsed.
*/
public static bool parseStretch(string str, out PangoStretch stretch, bool warn)
{
return pango_parse_stretch(Str.toStringz(str), &stretch, warn) != 0;
}
/**
* Parses a font style. The allowed values are "normal",
* "italic" and "oblique", case variations being
* ignored.
*
* Params:
* str = a string to parse.
* style = a #PangoStyle to store the result
* in.
* warn = if %TRUE, issue a g_warning() on bad input.
*
* Returns: %TRUE if @str was successfully parsed.
*/
public static bool parseStyle(string str, out PangoStyle style, bool warn)
{
return pango_parse_style(Str.toStringz(str), &style, warn) != 0;
}
/**
* Parses a font variant. The allowed values are "normal"
* and "smallcaps" or "small_caps", case variations being
* ignored.
*
* Params:
* str = a string to parse.
* variant = a #PangoVariant to store the
* result in.
* warn = if %TRUE, issue a g_warning() on bad input.
*
* Returns: %TRUE if @str was successfully parsed.
*/
public static bool parseVariant(string str, out PangoVariant variant, bool warn)
{
return pango_parse_variant(Str.toStringz(str), &variant, warn) != 0;
}
/**
* Parses a font weight. The allowed values are "heavy",
* "ultrabold", "bold", "normal", "light", "ultraleight"
* and integers. Case variations are ignored.
*
* Params:
* str = a string to parse.
* weight = a #PangoWeight to store the result
* in.
* warn = if %TRUE, issue a g_warning() on bad input.
*
* Returns: %TRUE if @str was successfully parsed.
*/
public static bool parseWeight(string str, out PangoWeight weight, bool warn)
{
return pango_parse_weight(Str.toStringz(str), &weight, warn) != 0;
}
/**
* Quantizes the thickness and position of a line, typically an
* underline or strikethrough, to whole device pixels, that is integer
* multiples of %PANGO_SCALE. The purpose of this function is to avoid
* such lines looking blurry.
*
* Care is taken to make sure @thickness is at least one pixel when this
* function returns, but returned @position may become zero as a result
* of rounding.
*
* Params:
* thickness = pointer to the thickness of a line, in Pango units
* position = corresponding position
*
* Since: 1.12
*/
public static void quantizeLineGeometry(ref int thickness, ref int position)
{
pango_quantize_line_geometry(&thickness, &position);
}
/**
* Scans an integer.
* Leading white space is skipped.
*
* Params:
* pos = in/out string position
* output = an int into which to write the result
*
* Returns: %FALSE if a parse error occurred.
*/
public static bool scanInt(ref string pos, out int output)
{
char* outpos = Str.toStringz(pos);
auto p = pango_scan_int(&outpos, &output) != 0;
pos = Str.toString(outpos);
return p;
}
/**
* Scans a string into a #GString buffer. The string may either
* be a sequence of non-white-space characters, or a quoted
* string with '"'. Instead a quoted string, '\"' represents
* a literal quote. Leading white space outside of quotes is skipped.
*
* Params:
* pos = in/out string position
* output = a #GString into which to write the result
*
* Returns: %FALSE if a parse error occurred.
*/
public static bool scanString(ref string pos, out StringG output)
{
char* outpos = Str.toStringz(pos);
GString* outoutput = sliceNew!GString();
auto p = pango_scan_string(&outpos, outoutput) != 0;
pos = Str.toString(outpos);
output = new StringG(outoutput, true);
return p;
}
/**
* Scans a word into a #GString buffer. A word consists
* of [A-Za-z_] followed by zero or more [A-Za-z_0-9]
* Leading white space is skipped.
*
* Params:
* pos = in/out string position
* output = a #GString into which to write the result
*
* Returns: %FALSE if a parse error occurred.
*/
public static bool scanWord(ref string pos, out StringG output)
{
char* outpos = Str.toStringz(pos);
GString* outoutput = sliceNew!GString();
auto p = pango_scan_word(&outpos, outoutput) != 0;
pos = Str.toString(outpos);
output = new StringG(outoutput, true);
return p;
}
/**
* Skips 0 or more characters of white space.
*
* Params:
* pos = in/out string position
*
* Returns: %FALSE if skipping the white space leaves
* the position at a '\0' character.
*/
public static bool skipSpace(ref string pos)
{
char* outpos = Str.toStringz(pos);
auto p = pango_skip_space(&outpos) != 0;
pos = Str.toString(outpos);
return p;
}
/**
* Splits a %G_SEARCHPATH_SEPARATOR-separated list of files, stripping
* white space and substituting ~/ with $HOME/.
*
* Params:
* str = a %G_SEARCHPATH_SEPARATOR separated list of filenames
*
* Returns: a list of
* strings to be freed with g_strfreev()
*/
public static string[] splitFileList(string str)
{
auto retStr = pango_split_file_list(Str.toStringz(str));
scope(exit) Str.freeStringArray(retStr);
return Str.toStringArray(retStr);
}
/**
* Trims leading and trailing whitespace from a string.
*
* Params:
* str = a string
*
* Returns: A newly-allocated string that must be freed with g_free()
*/
public static string trimString(string str)
{
auto retStr = pango_trim_string(Str.toStringz(str));
scope(exit) Str.freeString(retStr);
return Str.toString(retStr);
}
/**
* Reads an entire line from a file into a buffer. Lines may
* be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter
* is not written into the buffer. Text after a '#' character is treated as
* a comment and skipped. '\' can be used to escape a # character.
* '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding
* any other character is ignored and written into the output buffer
* unmodified.
*
* Params:
* stream = a stdio stream
* str = #GString buffer into which to write the result
*
* Returns: 0 if the stream was already at an %EOF character, otherwise
* the number of lines read (this is useful for maintaining
* a line number counter which doesn't combine lines with '\')
*/
public static int readLine(FILE* stream, out StringG str)
{
GString* outstr = sliceNew!GString();
auto p = pango_read_line(stream, outstr);
str = new StringG(outstr, true);
return p;
}
}
|