Imported Upstream version 0.19.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  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 <license@farsiweb.info> or write to
24  * Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
25  */
26 /* $Id: fribidi-mirroring.h,v 1.10 2004-09-28 07:58:57 behdad Exp $
27  * $Author: behdad $
28  * $Date: 2004-09-28 07:58:57 $
29  * $Revision: 1.10 $
30  * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-mirroring.h,v $
31  *
32  * Author(s):
33  *   Behdad Esfahbod, 2001, 2002, 2004
34  *   Dov Grobgeld, 1999, 2000
35  */
36 #ifndef _FRIBIDI_MIRRORING_H
37 #define _FRIBIDI_MIRRORING_H
38
39 #include "fribidi-common.h"
40
41 #include "fribidi-types.h"
42 #include "fribidi-bidi-types.h"
43
44 #include "fribidi-begindecls.h"
45
46 #define fribidi_get_mirror_char FRIBIDI_NAMESPACE(get_mirror_char)
47 /* fribidi_get_mirror_char - get mirrored character
48  *
49  * This function finds the mirrored equivalent of a character as defined in
50  * the file BidiMirroring.txt of the Unicode Character Database available at
51  * http://www.unicode.org/Public/UNIDATA/BidiMirroring.txt.
52  *
53  * If  the input character is a declared as a mirroring character in the
54  * Unicode standard and has a mirrored equivalent.  The matching mirrored
55  * character is put in the output, otherwise the input character itself is
56  * put.
57  *
58  * Returns: if the character has a mirroring equivalent or not.
59  */
60 FRIBIDI_ENTRY fribidi_boolean fribidi_get_mirror_char (
61   FriBidiChar ch,               /* input character */
62   FriBidiChar *mirrored_ch      /* output mirrored character */
63 );
64
65 #define fribidi_shape_mirroring FRIBIDI_NAMESPACE(shape_mirroring)
66 /* fribidi_shape_mirroring - do mirroring shaping
67  *
68  * This functions replaces mirroring characters on right-to-left embeddings in
69  * string with their mirrored equivalent as returned by
70  * fribidi_get_mirror_char().
71  *
72  * This function implements rule L4 of the Unicode Bidirectional Algorithm
73  * available at http://www.unicode.org/reports/tr9/#L4.
74  */
75 FRIBIDI_ENTRY void fribidi_shape_mirroring (
76   const FriBidiLevel *embedding_levels, /* input list of embedding
77                                            levels, as returned by
78                                            fribidi_get_par_embedding_levels */
79   const FriBidiStrIndex len,    /* input string length */
80   FriBidiChar *str              /* string to shape */
81 );
82
83 #include "fribidi-enddecls.h"
84
85 #endif /* !_FRIBIDI_MIRRORING_H */
86 /* Editor directions:
87  * Local Variables:
88  *   mode: c
89  *   c-basic-offset: 2
90  *   indent-tabs-mode: t
91  *   tab-width: 8
92  * End:
93  * vim: textwidth=78: autoindent: cindent: shiftwidth=2: tabstop=8:
94  */