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