2 * fribidi-deprecated.h - Deprecated interfaces
5 * Behdad Esfahbod, 2004, 2005
7 * Copyright (C) 2004 Sharif FarsiWeb, Inc
8 * Copyright (C) 2004, 2005 Behdad Esfahbod
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library, in a file named COPYING; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA
25 * For licensing issues, contact <fribidi.license@gmail.com>.
27 #ifndef _FRIBIDI_DEPRECATED_H
28 #define _FRIBIDI_DEPRECATED_H
30 #include "fribidi-common.h"
32 #include "fribidi-types.h"
34 #include "fribidi-bidi-types.h"
36 #include "fribidi-begindecls.h"
40 /* fribidi_mirroring_status - get current mirroring status
42 * This function is deprecated and only used with other deprecated functions.
44 FRIBIDI_ENTRY fribidi_boolean fribidi_mirroring_status (
46 ) FRIBIDI_GNUC_DEPRECATED;
48 /* fribidi_set_mirroring - set mirroring on or off
50 * This function is used to turn character mirroring on or off.
51 * Character mirroring is the act of replacing a mirrorable glyph
52 * (character), eg. left parenthesis, with the matching glyph,
53 * eg. right parenthesis, in a right-to-left resolved context.
54 * If your rendering engine does mirroring itself, you may want to
57 * This flag is on by default.
58 * This function is deprecated and only used with other deprecated functions.
60 * Returns: the new mirroring status.
62 FRIBIDI_ENTRY fribidi_boolean fribidi_set_mirroring (
63 fribidi_boolean state /* new state to set */
64 ) FRIBIDI_GNUC_DEPRECATED;
67 /* fribidi_reorder_nsm_status - get current marks reordering status
69 * This function is deprecated and only used with other deprecated functions.
71 FRIBIDI_ENTRY fribidi_boolean fribidi_reorder_nsm_status (
73 ) FRIBIDI_GNUC_DEPRECATED;
75 /* fribidi_set_reorder_nsm - set marks reordering on or off
77 * This function is used to turn non-spacing marks reordering on or
78 * off. Reordering non-spacing marks is the act of placing non-spacing
79 * marks (bidi class NSM) after their base character in a right-to-left
80 * resolved context. If your rendering engine expects non-spacing marks
81 * always after the base character in the memory representation of the
82 * visual string, you need this option on. An example of where people
83 * may need it off is when rendering in the console when non-spacing
84 * marks cannot be applied on top of the base character.
86 * This flag is on by default.
87 * This function is deprecated and only used with other deprecated functions.
89 * Returns: the new marks reordering status.
91 FRIBIDI_ENTRY fribidi_boolean fribidi_set_reorder_nsm (
92 fribidi_boolean state /* new state to set */
93 ) FRIBIDI_GNUC_DEPRECATED;
98 /* fribidi_log2vis_get_embedding_levels - get embedding levels
100 * Deprecated. Replaced by fribidi_get_par_embedding_levels_ex.
102 FRIBIDI_ENTRY FriBidiLevel
103 fribidi_log2vis_get_embedding_levels (
104 const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
105 fribidi_get_bidi_types() */
106 const FriBidiStrIndex len, /* input string length of the paragraph */
107 FriBidiParType *pbase_dir, /* requested and resolved paragraph
109 FriBidiLevel *embedding_levels /* output list of embedding levels */
110 ) FRIBIDI_GNUC_DEPRECATED;
112 /* fribidi_get_type - get character bidi type
114 * Deprecated. Replaced by fribidi_get_bidi_type.
116 FRIBIDI_ENTRY FriBidiCharType
118 FriBidiChar ch /* input character */
119 ) FRIBIDI_GNUC_DEPRECATED;
121 /* fribidi_get_type_internal - get character bidi type
123 * Deprecated. Replaced by fribidi_get_bidi_type.
125 FRIBIDI_ENTRY FriBidiCharType
126 fribidi_get_type_internal (
127 FriBidiChar ch /* input character */
128 ) FRIBIDI_GNUC_DEPRECATED;
130 /* fribidi_remove_bidi_marks - remove bidi marks out of an string
132 * This function removes the bidi and boundary-neutral marks out of an string
133 * and the accompanying lists. It implements rule X9 of the Unicode
134 * Bidirectional Algorithm available at
135 * http://www.unicode.org/reports/tr9/#X9, with the exception that it removes
136 * U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too.
138 * If any of the input lists are NULL, the list is skipped. If str is the
139 * visual string, then positions_to_this is positions_L_to_V and
140 * position_from_this_list is positions_V_to_L; if str is the logical
141 * string, the other way. Moreover, the position maps should be filled with
144 * A position map pointing to a removed character is filled with \-1. By the
145 * way, you should not use embedding_levels if str is visual string.
147 * For best results this function should be run on a whole paragraph, not
148 * lines; but feel free to do otherwise if you know what you are doing.
149 * Deprecated. Use fribidi_remove_special_chars instead.
151 * Returns: New length of the string, or \-1 if an error occurred (memory
152 * allocation failure most probably).
154 FRIBIDI_ENTRY FriBidiStrIndex
155 fribidi_remove_bidi_marks (
156 FriBidiChar *str, /* input string to clean */
157 const FriBidiStrIndex len, /* input string length */
158 FriBidiStrIndex *positions_to_this, /* list mapping positions to the
160 FriBidiStrIndex *position_from_this_list, /* list mapping positions from the
162 FriBidiLevel *embedding_levels /* list of embedding levels */
164 FRIBIDI_GNUC_WARN_UNUSED FRIBIDI_GNUC_DEPRECATED;
167 /* fribidi_log2vis - get visual string
169 * This function converts the logical input string to the visual output
170 * strings as specified by the Unicode Bidirectional Algorithm. As a side
171 * effect it also generates mapping lists between the two strings, and the
172 * list of embedding levels as defined by the algorithm.
174 * If NULL is passed as any of the the lists, the list is ignored and not
177 * This function is obsolete because it only handles one-line paragraphs.
178 * Please consider using other functions instead. Deprecated.
180 * Returns: Maximum level found plus one, or zero if any error occurred
181 * (memory allocation failure most probably).
183 FRIBIDI_ENTRY FriBidiLevel fribidi_log2vis (
184 const FriBidiChar *str, /* input logical string */
185 const FriBidiStrIndex len, /* input string length */
186 FriBidiParType *pbase_dir, /* requested and resolved paragraph
188 FriBidiChar *visual_str, /* output visual string */
189 FriBidiStrIndex *positions_L_to_V, /* output mapping from logical to
190 * visual string positions */
191 FriBidiStrIndex *positions_V_to_L, /* output mapping from visual string
192 * back to the logical string
194 FriBidiLevel *embedding_levels /* output list of embedding levels */
196 FRIBIDI_GNUC_WARN_UNUSED FRIBIDI_GNUC_DEPRECATED;
199 /* fribidi_get_par_embedding_levels - get bidi embedding levels of a paragraph
201 * Deprecated interface to fribidi_get_par_embedding_levels_ex(). Refer to
202 * it for documentation.
204 FRIBIDI_ENTRY FriBidiLevel
205 fribidi_get_par_embedding_levels (
206 const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
207 fribidi_get_bidi_types() */
208 const FriBidiStrIndex len, /* input string length of the paragraph */
209 FriBidiParType *pbase_dir, /* requested and resolved paragraph
211 FriBidiLevel *embedding_levels /* output list of embedding levels */
213 FRIBIDI_GNUC_WARN_UNUSED FRIBIDI_GNUC_DEPRECATED;
215 #define UNI_MAX_BIDI_LEVEL FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL
216 #define UNI_LRM FRIBIDI_CHAR_LRM
217 #define UNI_RLM FRIBIDI_CHAR_RLM
218 #define UNI_LRE FRIBIDI_CHAR_LRE
219 #define UNI_RLE FRIBIDI_CHAR_RLE
220 #define UNI_LRO FRIBIDI_CHAR_LRO
221 #define UNI_RLO FRIBIDI_CHAR_RLO
222 #define UNI_LS FRIBIDI_CHAR_LS
223 #define UNI_PS FRIBIDI_CHAR_PS
224 #define UNI_ZWNJ FRIBIDI_CHAR_ZWNJ
225 #define UNI_ZWJ FRIBIDI_CHAR_ZWJ
226 #define UNI_HEBREW_ALEF FRIBIDI_CHAR_HEBREW_ALEF
227 #define UNI_ARABIC_ALEF FRIBIDI_CHAR_ARABIC_ALEF
228 #define UNI_ARABIC_ZERO FRIBIDI_CHAR_ARABIC_ZERO
229 #define UNI_FARSI_ZERO FRIBIDI_CHAR_PERSIAN_ZERO
231 #define FRIBIDI_TYPE_WL FRIBIDI_PAR_WLTR
232 #define FRIBIDI_TYPE_WR FRIBIDI_PAR_WRTL
233 #define FRIBIDI_TYPE_L FRIBIDI_PAR_LTR
234 #define FRIBIDI_TYPE_R FRIBIDI_PAR_RTL
235 #define FRIBIDI_TYPE_N FRIBIDI_PAR_ON
236 #define FRIBIDI_TYPE_B FRIBIDI_TYPE_BS
237 #define FRIBIDI_TYPE_S FRIBIDI_TYPE_SS
239 #include "fribidi-enddecls.h"
241 #endif /* !_FRIBIDI_DEPRECATED_H */
242 /* Editor directions:
243 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent