1/* Pango
2 * pango-bidi-type.h: Bidirectional Character Types
3 *
4 * Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
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
22#ifndef __PANGO_BIDI_TYPE_H__
23#define __PANGO_BIDI_TYPE_H__
24
25#include <glib.h>
26
27#include <pango/pango-version-macros.h>
28G_BEGIN_DECLS
29
30/**
31 * PangoBidiType:
32 * @PANGO_BIDI_TYPE_L: Left-to-Right
33 * @PANGO_BIDI_TYPE_LRE: Left-to-Right Embedding
34 * @PANGO_BIDI_TYPE_LRO: Left-to-Right Override
35 * @PANGO_BIDI_TYPE_R: Right-to-Left
36 * @PANGO_BIDI_TYPE_AL: Right-to-Left Arabic
37 * @PANGO_BIDI_TYPE_RLE: Right-to-Left Embedding
38 * @PANGO_BIDI_TYPE_RLO: Right-to-Left Override
39 * @PANGO_BIDI_TYPE_PDF: Pop Directional Format
40 * @PANGO_BIDI_TYPE_EN: European Number
41 * @PANGO_BIDI_TYPE_ES: European Number Separator
42 * @PANGO_BIDI_TYPE_ET: European Number Terminator
43 * @PANGO_BIDI_TYPE_AN: Arabic Number
44 * @PANGO_BIDI_TYPE_CS: Common Number Separator
45 * @PANGO_BIDI_TYPE_NSM: Nonspacing Mark
46 * @PANGO_BIDI_TYPE_BN: Boundary Neutral
47 * @PANGO_BIDI_TYPE_B: Paragraph Separator
48 * @PANGO_BIDI_TYPE_S: Segment Separator
49 * @PANGO_BIDI_TYPE_WS: Whitespace
50 * @PANGO_BIDI_TYPE_ON: Other Neutrals
51 *
52 * The #PangoBidiType type represents the bidirectional character
53 * type of a Unicode character as specified by the
54 * <ulink url="http://www.unicode.org/reports/tr9/">Unicode bidirectional algorithm</ulink>.
55 *
56 * Since: 1.22
57 **/
58typedef enum {
59 /* Strong types */
60 PANGO_BIDI_TYPE_L,
61 PANGO_BIDI_TYPE_LRE,
62 PANGO_BIDI_TYPE_LRO,
63 PANGO_BIDI_TYPE_R,
64 PANGO_BIDI_TYPE_AL,
65 PANGO_BIDI_TYPE_RLE,
66 PANGO_BIDI_TYPE_RLO,
67
68 /* Weak types */
69 PANGO_BIDI_TYPE_PDF,
70 PANGO_BIDI_TYPE_EN,
71 PANGO_BIDI_TYPE_ES,
72 PANGO_BIDI_TYPE_ET,
73 PANGO_BIDI_TYPE_AN,
74 PANGO_BIDI_TYPE_CS,
75 PANGO_BIDI_TYPE_NSM,
76 PANGO_BIDI_TYPE_BN,
77
78 /* Neutral types */
79 PANGO_BIDI_TYPE_B,
80 PANGO_BIDI_TYPE_S,
81 PANGO_BIDI_TYPE_WS,
82 PANGO_BIDI_TYPE_ON
83} PangoBidiType;
84
85PANGO_AVAILABLE_IN_1_22
86PangoBidiType pango_bidi_type_for_unichar (gunichar ch) G_GNUC_CONST;
87
88/**
89 * PangoDirection:
90 * @PANGO_DIRECTION_LTR: A strong left-to-right direction
91 * @PANGO_DIRECTION_RTL: A strong right-to-left direction
92 * @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the
93 * same as %PANGO_DIRECTION_RTL.
94 * @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the
95 * same as %PANGO_DIRECTION_LTR
96 * @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction
97 * @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction
98 * @PANGO_DIRECTION_NEUTRAL: No direction specified
99 *
100 * The #PangoDirection type represents a direction in the
101 * Unicode bidirectional algorithm; not every value in this
102 * enumeration makes sense for every usage of #PangoDirection;
103 * for example, the return value of pango_unichar_direction()
104 * and pango_find_base_dir() cannot be %PANGO_DIRECTION_WEAK_LTR
105 * or %PANGO_DIRECTION_WEAK_RTL, since every character is either
106 * neutral or has a strong direction; on the other hand
107 * %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
108 * to pango_itemize_with_base_dir().
109 *
110 * The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL
111 * values come from an earlier interpretation of this
112 * enumeration as the writing direction of a block of
113 * text and are no longer used; See #PangoGravity for how
114 * vertical text is handled in Pango.
115 **/
116typedef enum {
117 PANGO_DIRECTION_LTR,
118 PANGO_DIRECTION_RTL,
119 PANGO_DIRECTION_TTB_LTR,
120 PANGO_DIRECTION_TTB_RTL,
121 PANGO_DIRECTION_WEAK_LTR,
122 PANGO_DIRECTION_WEAK_RTL,
123 PANGO_DIRECTION_NEUTRAL
124} PangoDirection;
125
126PANGO_AVAILABLE_IN_ALL
127PangoDirection pango_unichar_direction (gunichar ch) G_GNUC_CONST;
128PANGO_AVAILABLE_IN_1_4
129PangoDirection pango_find_base_dir (const gchar *text,
130 gint length);
131
132#ifndef PANGO_DISABLE_DEPRECATED
133PANGO_DEPRECATED_FOR(g_unichar_get_mirror_char)
134gboolean pango_get_mirror_char (gunichar ch,
135 gunichar *mirrored_ch);
136#endif
137
138G_END_DECLS
139
140#endif /* __PANGO_BIDI_TYPE_H__ */
141