/src/fribidi/lib/fribidi-deprecated.c
Line | Count | Source |
1 | | /* FriBidi |
2 | | * fribidi-deprecated.c - deprecated interfaces. |
3 | | * |
4 | | * Authors: |
5 | | * Behdad Esfahbod, 2001, 2002, 2004 |
6 | | * Dov Grobgeld, 1999, 2000 |
7 | | * |
8 | | * Copyright (C) 2004 Sharif FarsiWeb, Inc |
9 | | * Copyright (C) 2001,2002 Behdad Esfahbod |
10 | | * Copyright (C) 1999,2000 Dov Grobgeld |
11 | | * |
12 | | * This library is free software; you can redistribute it and/or |
13 | | * modify it under the terms of the GNU Lesser General Public |
14 | | * License as published by the Free Software Foundation; either |
15 | | * version 2.1 of the License, or (at your option) any later version. |
16 | | * |
17 | | * This library is distributed in the hope that it will be useful, |
18 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | | * Lesser General Public License for more details. |
21 | | * |
22 | | * You should have received a copy of the GNU Lesser General Public License |
23 | | * along with this library, in a file named COPYING; if not, write to the |
24 | | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 | | * Boston, MA 02110-1301, USA |
26 | | * |
27 | | * For licensing issues, contact <fribidi.license@gmail.com>. |
28 | | */ |
29 | | |
30 | | #include "common.h" |
31 | | |
32 | | #undef FRIBIDI_NO_DEPRECATED |
33 | | |
34 | | #include <fribidi-deprecated.h> |
35 | | #include <fribidi.h> |
36 | | |
37 | | #ifdef FRIBIDI_NO_DEPRECATED |
38 | | #else |
39 | | |
40 | | /* Shared with fribidi_log2vis() in fribidi.c, so that the deprecated |
41 | | fribidi_set_mirroring()/fribidi_set_reorder_nsm() setters actually |
42 | | affect it. */ |
43 | | FriBidiFlags _fribidi_legacy_api_flags = FRIBIDI_FLAGS_DEFAULT | FRIBIDI_FLAGS_ARABIC; |
44 | | |
45 | | FRIBIDI_ENTRY fribidi_boolean |
46 | | fribidi_set_mirroring ( |
47 | | /* input */ |
48 | | fribidi_boolean state |
49 | | ) |
50 | 0 | { |
51 | 0 | return FRIBIDI_ADJUST_AND_TEST_BITS (_fribidi_legacy_api_flags, FRIBIDI_FLAG_SHAPE_MIRRORING, state); |
52 | 0 | } |
53 | | |
54 | | FRIBIDI_ENTRY fribidi_boolean |
55 | | fribidi_mirroring_status ( |
56 | | void |
57 | | ) |
58 | 0 | { |
59 | 0 | return FRIBIDI_TEST_BITS (_fribidi_legacy_api_flags, FRIBIDI_FLAG_SHAPE_MIRRORING); |
60 | 0 | } |
61 | | |
62 | | FRIBIDI_ENTRY fribidi_boolean |
63 | | fribidi_set_reorder_nsm ( |
64 | | /* input */ |
65 | | fribidi_boolean state |
66 | | ) |
67 | 0 | { |
68 | 0 | return FRIBIDI_ADJUST_AND_TEST_BITS (_fribidi_legacy_api_flags, FRIBIDI_FLAG_REORDER_NSM, state); |
69 | 0 | } |
70 | | |
71 | | fribidi_boolean |
72 | | fribidi_reorder_nsm_status ( |
73 | | void |
74 | | ) |
75 | 0 | { |
76 | 0 | return FRIBIDI_TEST_BITS (_fribidi_legacy_api_flags, FRIBIDI_FLAG_REORDER_NSM); |
77 | 0 | } |
78 | | |
79 | | |
80 | | |
81 | | |
82 | | FRIBIDI_ENTRY FriBidiLevel |
83 | | fribidi_log2vis_get_embedding_levels ( |
84 | | const FriBidiCharType *bidi_types, /* input list of bidi types as returned by |
85 | | fribidi_get_bidi_types() */ |
86 | | const FriBidiStrIndex len, /* input string length of the paragraph */ |
87 | | FriBidiParType *pbase_dir, /* requested and resolved paragraph |
88 | | * base direction */ |
89 | | FriBidiLevel *embedding_levels /* output list of embedding levels */ |
90 | | ) |
91 | 0 | { |
92 | 0 | return fribidi_get_par_embedding_levels_ex (bidi_types, NULL, len, pbase_dir, embedding_levels); |
93 | 0 | } |
94 | | |
95 | | FRIBIDI_ENTRY FriBidiCharType |
96 | | fribidi_get_type ( |
97 | | FriBidiChar ch /* input character */ |
98 | | ) |
99 | 0 | { |
100 | 0 | return fribidi_get_bidi_type (ch); |
101 | 0 | } |
102 | | |
103 | | FRIBIDI_ENTRY FriBidiCharType |
104 | | fribidi_get_type_internal ( |
105 | | FriBidiChar ch /* input character */ |
106 | | ) |
107 | 0 | { |
108 | 0 | return fribidi_get_bidi_type (ch); |
109 | 0 | } |
110 | | |
111 | | |
112 | | FRIBIDI_ENTRY FriBidiLevel |
113 | | fribidi_get_par_embedding_levels ( |
114 | | /* input */ |
115 | | const FriBidiCharType *bidi_types, |
116 | | const FriBidiStrIndex len, |
117 | | /* input and output */ |
118 | | FriBidiParType *pbase_dir, |
119 | | /* output */ |
120 | | FriBidiLevel *embedding_levels |
121 | | ) |
122 | 0 | { |
123 | 0 | return fribidi_get_par_embedding_levels_ex (/* input */ |
124 | 0 | bidi_types, |
125 | 0 | NULL, /* No bracket_types */ |
126 | 0 | len, |
127 | | /* input and output */ |
128 | 0 | pbase_dir, |
129 | | /* output */ |
130 | 0 | embedding_levels); |
131 | 0 | } |
132 | | |
133 | | #endif /* !FRIBIDI_NO_DEPRECATED */ |
134 | | |
135 | | /* Editor directions: |
136 | | * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent |
137 | | */ |