Imported Upstream version 1.0.5
[platform/upstream/fribidi.git] / lib / fribidi-mirroring.h
1 /* fribidi-mirroring.h - get mirrored character
2  *
3  * Copyright (C) 2004  Sharif FarsiWeb, Inc
4  * Copyright (C) 2001, 2002, 2004  Behdad Esfahbod
5  * Copyright (C) 1999, 2000, 2017  Dov Grobgeld
6  * 
7  * This file is part of GNU FriBidi.
8  * 
9  * GNU FriBidi is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  * 
14  * GNU FriBidi is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License for more details.
18  * 
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with GNU FriBidi; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22  * 
23  * For licensing issues, contact <fribidi.license@gmail.com> or write to
24  * Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
25  *
26  * Author(s):
27  *   Behdad Esfahbod, 2001, 2002, 2004
28  *   Dov Grobgeld, 1999, 2000
29  */
30 #ifndef _FRIBIDI_MIRRORING_H
31 #define _FRIBIDI_MIRRORING_H
32
33 #include "fribidi-common.h"
34
35 #include "fribidi-types.h"
36 #include "fribidi-bidi-types.h"
37
38 #include "fribidi-begindecls.h"
39
40 /* fribidi_get_mirror_char - get mirrored character
41  *
42  * This function finds the mirrored equivalent of a character as defined in
43  * the file BidiMirroring.txt of the Unicode Character Database available at
44  * http://www.unicode.org/Public/UNIDATA/BidiMirroring.txt.
45  *
46  * If  the input character is a declared as a mirroring character in the
47  * Unicode standard and has a mirrored equivalent.  The matching mirrored
48  * character is put in the output, otherwise the input character itself is
49  * put.
50  *
51  * Returns: if the character has a mirroring equivalent or not.
52  */
53 FRIBIDI_ENTRY fribidi_boolean fribidi_get_mirror_char (
54   FriBidiChar ch,               /* input character */
55   FriBidiChar *mirrored_ch      /* output mirrored character */
56 );
57
58 /* fribidi_shape_mirroring - do mirroring shaping
59  *
60  * This functions replaces mirroring characters on right-to-left embeddings in
61  * string with their mirrored equivalent as returned by
62  * fribidi_get_mirror_char().
63  *
64  * This function implements rule L4 of the Unicode Bidirectional Algorithm
65  * available at http://www.unicode.org/reports/tr9/#L4.
66  */
67 FRIBIDI_ENTRY void fribidi_shape_mirroring (
68   const FriBidiLevel *embedding_levels, /* input list of embedding
69                                            levels, as returned by
70                                            fribidi_get_par_embedding_levels */
71   const FriBidiStrIndex len,    /* input string length */
72   FriBidiChar *str              /* string to shape */
73 );
74
75 #include "fribidi-enddecls.h"
76
77 #endif /* !_FRIBIDI_MIRRORING_H */
78 /* Editor directions:
79  * Local Variables:
80  *   mode: c
81  *   c-basic-offset: 2
82  *   indent-tabs-mode: t
83  *   tab-width: 8
84  * End:
85  * vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8:
86  */