summaryrefslogtreecommitdiff
path: root/pango2/pango-utils.h
blob: c5b5e372506b2a855ad72a844fcd2efd644677ab (plain)
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
/*
 * Copyright (C) 2000 Red Hat Software
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 *
 * This library 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 2.1 of the License, or (at your option) any later version.
 *
 * This library 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 this library; if not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include <stdio.h>
#include <glib.h>
#include <pango2/pango-features.h>
#include <pango2/pango-font.h>

G_BEGIN_DECLS

PANGO2_AVAILABLE_IN_ALL
gboolean                pango2_is_zero_width           (gunichar ch) G_GNUC_CONST;

PANGO2_AVAILABLE_IN_ALL
void                    pango2_find_paragraph_boundary (const char *text,
                                                        int         length,
                                                        int        *paragraph_delimiter_index,
                                                        int        *next_paragraph_start);

/* Encode a Pango version as an integer */
/* Pango version checking */

/**
 * PANGO2_VERSION_ENCODE:
 * @major: the major component of the version number
 * @minor: the minor component of the version number
 * @micro: the micro component of the version number
 *
 * This macro encodes the given Pango version into an integer.  The numbers
 * returned by %PANGO2_VERSION and pango2_version() are encoded using this macro.
 * Two encoded version numbers can be compared as integers.
 */
#define PANGO2_VERSION_ENCODE(major, minor, micro) (     \
          ((major) * 10000)                             \
        + ((minor) *   100)                             \
        + ((micro) *     1))

/* Encoded version of Pango at compile-time */
/**
 * PANGO2_VERSION:
 *
 * The version of Pango available at compile-time, encoded using PANGO2_VERSION_ENCODE().
 */

/**
 * PANGO2_VERSION_STRING:
 *
 * A string literal containing the version of Pango available at compile-time.
 */

/**
 * PANGO2_VERSION_MAJOR:
 *
 * The major component of the version of Pango available at compile-time.
 */
/**
 * PANGO2_VERSION_MINOR:
 *
 * The minor component of the version of Pango available at compile-time.
 */
/**
 * PANGO2_VERSION_MICRO:
 *
 * The micro component of the version of Pango available at compile-time.
 */
#define PANGO2_VERSION PANGO2_VERSION_ENCODE(     \
        PANGO2_VERSION_MAJOR,                    \
        PANGO2_VERSION_MINOR,                    \
        PANGO2_VERSION_MICRO)


/* Check that compile-time Pango is as new as required */
/**
 * PANGO2_VERSION_CHECK:
 * @major: the major component of the version number
 * @minor: the minor component of the version number
 * @micro: the micro component of the version number
 *
 * Checks that the version of Pango available at compile-time is not older than
 * the provided version number.
 */
#define PANGO2_VERSION_CHECK(major,minor,micro)    \
        (PANGO2_VERSION >= PANGO2_VERSION_ENCODE(major,minor,micro))

PANGO2_AVAILABLE_IN_ALL
int                     pango2_version        (void) G_GNUC_CONST;

PANGO2_AVAILABLE_IN_ALL
const char *            pango2_version_string (void) G_GNUC_CONST;

PANGO2_AVAILABLE_IN_ALL
const char *            pango2_version_check  (int required_major,
                                               int required_minor,
                                               int required_micro) G_GNUC_CONST;

G_END_DECLS