2 * fribidi-deprecated.h - Deprecated interfaces
4 * $Id: fribidi-deprecated.h,v 1.4 2009-03-27 16:14:33 behdad Exp $
6 * $Date: 2009-03-27 16:14:33 $
8 * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-deprecated.h,v $
11 * Behdad Esfahbod, 2004, 2005
13 * Copyright (C) 2004 Sharif FarsiWeb, Inc
14 * Copyright (C) 2004, 2005 Behdad Esfahbod
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public License
27 * along with this library, in a file named COPYING; if not, write to the
28 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
29 * Boston, MA 02110-1301, USA
31 * For licensing issues, contact <license@farsiweb.info>.
33 #ifndef _FRIBIDI_DEPRECATED_H
34 #define _FRIBIDI_DEPRECATED_H
36 #include "fribidi-common.h"
38 #include "fribidi-types.h"
40 #include "fribidi-bidi-types.h"
42 #include "fribidi-begindecls.h"
46 #define fribidi_mirroring_status FRIBIDI_NAMESPACE(mirroring_status)
47 /* fribidi_mirroring_status - get current mirroring status
49 * This function is deprecated and only used with other deprecated functions.
51 FRIBIDI_ENTRY fribidi_boolean fribidi_mirroring_status (
53 ) FRIBIDI_GNUC_DEPRECATED;
55 #define fribidi_set_mirroring FRIBIDI_NAMESPACE(set_mirroring)
56 /* fribidi_set_mirroring - set mirroring on or off
58 * This function is used to turn character mirroring on or off.
59 * Character mirroring is the act of replacing a mirrorable glyph
60 * (character), eg. left paranthesis, with the matching glyph,
61 * eg. right paranthesis, in a right-to-left resolved context.
62 * If your rendering engine does mirroring itself, you may want to
65 * This flag is on by default.
66 * This function is deprecated and only used with other deprecated functions.
68 * Returns: the new mirroring status.
70 FRIBIDI_ENTRY fribidi_boolean fribidi_set_mirroring (
71 fribidi_boolean state /* new state to set */
72 ) FRIBIDI_GNUC_DEPRECATED;
75 #define fribidi_reorder_nsm_status FRIBIDI_NAMESPACE(reorder_nsm_status)
76 /* fribidi_reorder_nsm_status - get current marks reordering status
78 * This function is deprecated and only used with other deprecated functions.
80 FRIBIDI_ENTRY fribidi_boolean fribidi_reorder_nsm_status (
82 ) FRIBIDI_GNUC_DEPRECATED;
84 #define fribidi_set_reorder_nsm FRIBIDI_NAMESPACE(set_reorder_nsm)
85 /* fribidi_set_reorder_nsm - set marks reordering on or off
87 * This function is used to turn non-spacing marks reordering on or
88 * off. Reordering non-spacing marks is the act of placing non-spacing
89 * marks (bidi class NSM) after their base character in a right-to-left
90 * resolved context. If your rendering engine expects non-spacing marks
91 * always after the base character in the memory representation of the
92 * visual string, you need this option on. An example of where people
93 * may need it off is when rendering in the console when non-spacing
94 * marks cannot be applied on top of the base character.
96 * This flag is on by default.
97 * This function is deprecated and only used with other deprecated functions.
99 * Returns: the new marks reordering status.
101 FRIBIDI_ENTRY fribidi_boolean fribidi_set_reorder_nsm (
102 fribidi_boolean state /* new state to set */
103 ) FRIBIDI_GNUC_DEPRECATED;
108 /* fribidi_log2vis_get_embedding_levels - get embedding levels
110 * Deprecated. Replaced by fribidi_get_par_embedding_levels.
112 #define fribidi_log2vis_get_embedding_levels FRIBIDI_NAMESPACE(log2vis_get_embedding_levels)
113 FRIBIDI_ENTRY FriBidiLevel
114 fribidi_log2vis_get_embedding_levels (
115 const FriBidiCharType *bidi_types, /* input list of bidi types as returned by
116 fribidi_get_bidi_types() */
117 const FriBidiStrIndex len, /* input string length of the paragraph */
118 FriBidiParType *pbase_dir, /* requested and resolved paragraph
120 FriBidiLevel *embedding_levels /* output list of embedding levels */
121 ) FRIBIDI_GNUC_DEPRECATED;
123 /* fribidi_get_type - get character bidi type
125 * Deprecated. Replaced by fribidi_get_bidi_type.
127 #define fribidi_get_type FRIBIDI_NAMESPACE(get_type)
128 FRIBIDI_ENTRY FriBidiCharType
130 FriBidiChar ch /* input character */
131 ) FRIBIDI_GNUC_DEPRECATED;
133 /* fribidi_get_type_internal - get character bidi type
135 * Deprecated. Replaced by fribidi_get_bidi_type.
137 #define fribidi_get_type_internal FRIBIDI_NAMESPACE(get_type_internal)
138 FRIBIDI_ENTRY FriBidiCharType
139 fribidi_get_type_internal (
140 FriBidiChar ch /* input character */
141 ) FRIBIDI_GNUC_DEPRECATED;
143 #define fribidi_remove_bidi_marks FRIBIDI_NAMESPACE(remove_bidi_marks)
144 /* fribidi_remove_bidi_marks - remove bidi marks out of an string
146 * This function removes the bidi and boundary-neutral marks out of an string
147 * and the accompanying lists. It implements rule X9 of the Unicode
148 * Bidirectional Algorithm available at
149 * http://www.unicode.org/reports/tr9/#X9, with the exception that it removes
150 * U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too.
152 * If any of the input lists are NULL, the list is skipped. If str is the
153 * visual string, then positions_to_this is positions_L_to_V and
154 * position_from_this_list is positions_V_to_L; if str is the logical
155 * string, the other way. Moreover, the position maps should be filled with
158 * A position map pointing to a removed character is filled with \-1. By the
159 * way, you should not use embedding_levels if str is visual string.
161 * For best results this function should be run on a whole paragraph, not
162 * lines; but feel free to do otherwise if you know what you are doing.
163 * Deprecated. Use fribidi_remove_special_chars instead.
165 * Returns: New length of the string, or \-1 if an error occured (memory
166 * allocation failure most probably).
168 FRIBIDI_ENTRY FriBidiStrIndex
169 fribidi_remove_bidi_marks (
170 FriBidiChar *str, /* input string to clean */
171 const FriBidiStrIndex len, /* input string length */
172 FriBidiStrIndex *positions_to_this, /* list mapping positions to the
174 FriBidiStrIndex *position_from_this_list, /* list mapping positions from the
176 FriBidiLevel *embedding_levels /* list of embedding levels */
178 FRIBIDI_GNUC_WARN_UNUSED FRIBIDI_GNUC_DEPRECATED;
181 #define fribidi_log2vis FRIBIDI_NAMESPACE(log2vis)
182 /* fribidi_log2vis - get visual string
184 * This function converts the logical input string to the visual output
185 * strings as specified by the Unicode Bidirectional Algorithm. As a side
186 * effect it also generates mapping lists between the two strings, and the
187 * list of embedding levels as defined by the algorithm.
189 * If NULL is passed as any of the the lists, the list is ignored and not
192 * This function is obsolete because it only handles one-line paragraphs.
193 * Please consider using other functions instead. Deprecated.
195 * Returns: Maximum level found plus one, or zero if any error occured
196 * (memory allocation failure most probably).
198 FRIBIDI_ENTRY FriBidiLevel fribidi_log2vis (
199 const FriBidiChar *str, /* input logical string */
200 const FriBidiStrIndex len, /* input string length */
201 FriBidiParType *pbase_dir, /* requested and resolved paragraph
203 FriBidiChar *visual_str, /* output visual string */
204 FriBidiStrIndex *positions_L_to_V, /* output mapping from logical to
205 * visual string positions */
206 FriBidiStrIndex *positions_V_to_L, /* output mapping from visual string
207 * back to the logical string
209 FriBidiLevel *embedding_levels /* output list of embedding levels */
211 FRIBIDI_GNUC_WARN_UNUSED FRIBIDI_GNUC_DEPRECATED;
214 #define UNI_MAX_BIDI_LEVEL FRIBIDI_BIDI_MAX_EXPLICIT_LEVEL
215 #define UNI_LRM FRIBIDI_CHAR_LRM
216 #define UNI_RLM FRIBIDI_CHAR_RLM
217 #define UNI_LRE FRIBIDI_CHAR_LRE
218 #define UNI_RLE FRIBIDI_CHAR_RLE
219 #define UNI_LRO FRIBIDI_CHAR_LRO
220 #define UNI_RLO FRIBIDI_CHAR_RLO
221 #define UNI_LS FRIBIDI_CHAR_LS
222 #define UNI_PS FRIBIDI_CHAR_PS
223 #define UNI_ZWNJ FRIBIDI_CHAR_ZWNJ
224 #define UNI_ZWJ FRIBIDI_CHAR_ZWJ
225 #define UNI_HEBREW_ALEF FRIBIDI_CHAR_HEBREW_ALEF
226 #define UNI_ARABIC_ALEF FRIBIDI_CHAR_ARABIC_ALEF
227 #define UNI_ARABIC_ZERO FRIBIDI_CHAR_ARABIC_ZERO
228 #define UNI_FARSI_ZERO FRIBIDI_CHAR_PERSIAN_ZERO
230 #define FRIBIDI_TYPE_WL FRIBIDI_PAR_WLTR
231 #define FRIBIDI_TYPE_WR FRIBIDI_PAR_WRTL
232 #define FRIBIDI_TYPE_L FRIBIDI_PAR_LTR
233 #define FRIBIDI_TYPE_R FRIBIDI_PAR_RTL
234 #define FRIBIDI_TYPE_N FRIBIDI_PAR_ON
235 #define FRIBIDI_TYPE_B FRIBIDI_TYPE_BS
236 #define FRIBIDI_TYPE_S FRIBIDI_TYPE_SS
238 #include "fribidi-enddecls.h"
240 #endif /* !_FRIBIDI_DEPRECATED_H */
241 /* Editor directions:
242 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent