Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

144 linhas
4.7 KiB

  1. /* Pango
  2. * pango-utils.c: Utilities for internal functions and modules
  3. *
  4. * Copyright (C) 2000 Red Hat Software
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __PANGO_UTILS_H__
  22. #define __PANGO_UTILS_H__
  23. #include <stdio.h>
  24. #include <glib.h>
  25. #include <pango/pango-font.h>
  26. G_BEGIN_DECLS
  27. char ** pango_split_file_list (const char *str);
  28. char *pango_trim_string (const char *str);
  29. gint pango_read_line (FILE *stream,
  30. GString *str);
  31. gboolean pango_skip_space (const char **pos);
  32. gboolean pango_scan_word (const char **pos,
  33. GString *out);
  34. gboolean pango_scan_string (const char **pos,
  35. GString *out);
  36. gboolean pango_scan_int (const char **pos,
  37. int *out);
  38. #ifdef PANGO_ENABLE_BACKEND
  39. char * pango_config_key_get (const char *key);
  40. void pango_lookup_aliases (const char *fontname,
  41. char ***families,
  42. int *n_families);
  43. #endif /* PANGO_ENABLE_BACKEND */
  44. gboolean pango_parse_enum (GType type,
  45. const char *str,
  46. int *value,
  47. gboolean warn,
  48. char **possible_values);
  49. /* Functions for parsing textual representations
  50. * of PangoFontDescription fields. They return TRUE if the input string
  51. * contains a valid value, which then has been assigned to the corresponding
  52. * field in the PangoFontDescription. If the warn parameter is TRUE,
  53. * a warning is printed (with g_warning) if the string does not
  54. * contain a valid value.
  55. */
  56. gboolean pango_parse_style (const char *str,
  57. PangoStyle *style,
  58. gboolean warn);
  59. gboolean pango_parse_variant (const char *str,
  60. PangoVariant *variant,
  61. gboolean warn);
  62. gboolean pango_parse_weight (const char *str,
  63. PangoWeight *weight,
  64. gboolean warn);
  65. gboolean pango_parse_stretch (const char *str,
  66. PangoStretch *stretch,
  67. gboolean warn);
  68. #ifdef PANGO_ENABLE_BACKEND
  69. /* On Unix, return the name of the "pango" subdirectory of SYSCONFDIR
  70. * (which is set at compile time). On Win32, return the Pango
  71. * installation directory (which is set at installation time, and
  72. * stored in the registry). The returned string should not be
  73. * g_free'd.
  74. */
  75. G_CONST_RETURN char * pango_get_sysconf_subdirectory (void) G_GNUC_PURE;
  76. /* Ditto for LIBDIR/pango. On Win32, use the same Pango
  77. * installation directory. This returned string should not be
  78. * g_free'd either.
  79. */
  80. G_CONST_RETURN char * pango_get_lib_subdirectory (void) G_GNUC_PURE;
  81. #endif /* PANGO_ENABLE_BACKEND */
  82. /* Hint line position and thickness.
  83. */
  84. void pango_quantize_line_geometry (int *thickness,
  85. int *position);
  86. /* A routine from fribidi that we either wrap or provide ourselves.
  87. */
  88. guint8 * pango_log2vis_get_embedding_levels (const gchar *text,
  89. int length,
  90. PangoDirection *pbase_dir);
  91. /* Unicode characters that are zero-width and should not be rendered
  92. * normally.
  93. */
  94. gboolean pango_is_zero_width (gunichar ch) G_GNUC_CONST;
  95. /* Pango version checking */
  96. /* Encode a Pango version as an integer */
  97. #define PANGO_VERSION_ENCODE(major, minor, micro) ( \
  98. ((major) * 10000) \
  99. + ((minor) * 100) \
  100. + ((micro) * 1))
  101. /* Encoded version of Pango at compile-time */
  102. #define PANGO_VERSION PANGO_VERSION_ENCODE( \
  103. PANGO_VERSION_MAJOR, \
  104. PANGO_VERSION_MINOR, \
  105. PANGO_VERSION_MICRO)
  106. /* Check that compile-time Pango is as new as required */
  107. #define PANGO_VERSION_CHECK(major,minor,micro) \
  108. (PANGO_VERSION >= PANGO_VERSION_ENCODE(major,minor,micro))
  109. /* Return encoded version of Pango at run-time */
  110. int pango_version (void) G_GNUC_CONST;
  111. /* Return run-time Pango version as an string */
  112. G_CONST_RETURN char * pango_version_string (void) G_GNUC_CONST;
  113. /* Check that run-time Pango is as new as required */
  114. G_CONST_RETURN char * pango_version_check (int required_major,
  115. int required_minor,
  116. int required_micro) G_GNUC_CONST;
  117. G_END_DECLS
  118. #endif /* __PANGO_UTILS_H__ */