Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 10:28:16

0001 /* Pango
0002  * pango-utils.c: Utilities for internal functions and modules
0003  *
0004  * Copyright (C) 2000 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGO_UTILS_H__
0023 #define __PANGO_UTILS_H__
0024 
0025 #include <stdio.h>
0026 #include <glib.h>
0027 #include <pango/pango-font.h>
0028 
0029 G_BEGIN_DECLS
0030 
0031 PANGO_DEPRECATED
0032 char **  pango_split_file_list (const char *str);
0033 
0034 PANGO_DEPRECATED
0035 char    *pango_trim_string     (const char *str);
0036 PANGO_DEPRECATED
0037 gint     pango_read_line      (FILE        *stream,
0038                    GString     *str);
0039 PANGO_DEPRECATED
0040 gboolean pango_skip_space     (const char **pos);
0041 PANGO_DEPRECATED
0042 gboolean pango_scan_word      (const char **pos,
0043                    GString     *out);
0044 PANGO_DEPRECATED
0045 gboolean pango_scan_string    (const char **pos,
0046                    GString     *out);
0047 PANGO_DEPRECATED
0048 gboolean pango_scan_int       (const char **pos,
0049                    int         *out);
0050 
0051 PANGO_DEPRECATED
0052 gboolean pango_parse_enum     (GType       type,
0053                    const char *str,
0054                    int        *value,
0055                    gboolean    warn,
0056                    char      **possible_values);
0057 
0058 /* Functions for parsing textual representations
0059  * of PangoFontDescription fields. They return TRUE if the input string
0060  * contains a valid value, which then has been assigned to the corresponding
0061  * field in the PangoFontDescription. If the warn parameter is TRUE,
0062  * a warning is printed (with g_warning) if the string does not
0063  * contain a valid value.
0064  */
0065 PANGO_AVAILABLE_IN_ALL
0066 gboolean pango_parse_style   (const char   *str,
0067                   PangoStyle   *style,
0068                   gboolean      warn);
0069 PANGO_AVAILABLE_IN_ALL
0070 gboolean pango_parse_variant (const char   *str,
0071                   PangoVariant *variant,
0072                   gboolean      warn);
0073 PANGO_AVAILABLE_IN_ALL
0074 gboolean pango_parse_weight  (const char   *str,
0075                   PangoWeight  *weight,
0076                   gboolean      warn);
0077 PANGO_AVAILABLE_IN_ALL
0078 gboolean pango_parse_stretch (const char   *str,
0079                   PangoStretch *stretch,
0080                   gboolean      warn);
0081 
0082 
0083 /* Hint line position and thickness.
0084  */
0085 PANGO_AVAILABLE_IN_1_12
0086 void pango_quantize_line_geometry (int *thickness,
0087                    int *position);
0088 
0089 /* A routine from fribidi that we either wrap or provide ourselves.
0090  */
0091 PANGO_AVAILABLE_IN_1_4
0092 guint8 * pango_log2vis_get_embedding_levels (const gchar    *text,
0093                          int             length,
0094                          PangoDirection *pbase_dir);
0095 
0096 /* Unicode characters that are zero-width and should not be rendered
0097  * normally.
0098  */
0099 PANGO_AVAILABLE_IN_1_10
0100 gboolean pango_is_zero_width (gunichar ch) G_GNUC_CONST;
0101 
0102 PANGO_AVAILABLE_IN_ALL
0103 void     pango_find_paragraph_boundary (const char *text,
0104                                         int         length,
0105                                         int        *paragraph_delimiter_index,
0106                                         int        *next_paragraph_start);
0107 
0108 /* Pango version checking */
0109 
0110 /* Encode a Pango version as an integer */
0111 /**
0112  * PANGO_VERSION_ENCODE:
0113  * @major: the major component of the version number
0114  * @minor: the minor component of the version number
0115  * @micro: the micro component of the version number
0116  *
0117  * This macro encodes the given Pango version into an integer.  The numbers
0118  * returned by %PANGO_VERSION and pango_version() are encoded using this macro.
0119  * Two encoded version numbers can be compared as integers.
0120  */
0121 #define PANGO_VERSION_ENCODE(major, minor, micro) (     \
0122       ((major) * 10000)                             \
0123     + ((minor) *   100)                             \
0124     + ((micro) *     1))
0125 
0126 /* Encoded version of Pango at compile-time */
0127 /**
0128  * PANGO_VERSION:
0129  *
0130  * The version of Pango available at compile-time, encoded using PANGO_VERSION_ENCODE().
0131  */
0132 /**
0133  * PANGO_VERSION_STRING:
0134  *
0135  * A string literal containing the version of Pango available at compile-time.
0136  */
0137 /**
0138  * PANGO_VERSION_MAJOR:
0139  *
0140  * The major component of the version of Pango available at compile-time.
0141  */
0142 /**
0143  * PANGO_VERSION_MINOR:
0144  *
0145  * The minor component of the version of Pango available at compile-time.
0146  */
0147 /**
0148  * PANGO_VERSION_MICRO:
0149  *
0150  * The micro component of the version of Pango available at compile-time.
0151  */
0152 #define PANGO_VERSION PANGO_VERSION_ENCODE(     \
0153     PANGO_VERSION_MAJOR,                    \
0154     PANGO_VERSION_MINOR,                    \
0155     PANGO_VERSION_MICRO)
0156 
0157 /* Check that compile-time Pango is as new as required */
0158 /**
0159  * PANGO_VERSION_CHECK:
0160  * @major: the major component of the version number
0161  * @minor: the minor component of the version number
0162  * @micro: the micro component of the version number
0163  *
0164  * Checks that the version of Pango available at compile-time is not older than
0165  * the provided version number.
0166  */
0167 #define PANGO_VERSION_CHECK(major,minor,micro)    \
0168     (PANGO_VERSION >= PANGO_VERSION_ENCODE(major,minor,micro))
0169 
0170 
0171 /* Return encoded version of Pango at run-time */
0172 PANGO_AVAILABLE_IN_1_16
0173 int pango_version (void) G_GNUC_CONST;
0174 
0175 /* Return run-time Pango version as an string */
0176 PANGO_AVAILABLE_IN_1_16
0177 const char * pango_version_string (void) G_GNUC_CONST;
0178 
0179 /* Check that run-time Pango is as new as required */
0180 PANGO_AVAILABLE_IN_1_16
0181 const char * pango_version_check (int required_major,
0182                                   int required_minor,
0183                                   int required_micro) G_GNUC_CONST;
0184 
0185 G_END_DECLS
0186 
0187 #endif /* __PANGO_UTILS_H__ */