fribidi-joining-type.[ch] merged into fribidi-joining-types.[ch].
/* FriBidi
* fribidi-char-sets-cap-rtl.c - CapRTL character set conversion routines
*
- * $Id: fribidi-char-sets-cap-rtl.c,v 1.7 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-char-sets-cap-rtl.c,v 1.8 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.7 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.8 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/charset/fribidi-char-sets-cap-rtl.c,v $
*
* Authors:
#include <fribidi-unicode.h>
#include <fribidi-mirroring.h>
-#include <fribidi-bidi-type.h>
+#include <fribidi-bidi-types.h>
#include <bidi-types.h>
## Use autoupdate to update this file for newer versions of autoconf.
## Use autoscan to check if you need to add something to this file.
##############################################################################
-## $Id: configure.ac,v 1.14 2004-06-09 20:01:00 behdad Exp $
+## $Id: configure.ac,v 1.15 2004-06-14 18:43:48 behdad Exp $
## $Auther: behdad $
-## $Date: 2004-06-09 20:01:00 $
-## $Revision: 1.14 $
+## $Date: 2004-06-14 18:43:48 $
+## $Revision: 1.15 $
## $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/configure.ac,v $
##############################################################################
fribidi_major_version.fribidi_minor_version.fribidi_micro_version))dnl
AC_INIT([GNU FriBidi],fribidi_version(),[http://freedesktop.org/cgi-bin/bugzilla/enter_bug.cgi?product=FriBidi])
-AC_REVISION([$Id: configure.ac,v 1.14 2004-06-09 20:01:00 behdad Exp $])
+AC_REVISION([$Id: configure.ac,v 1.15 2004-06-14 18:43:48 behdad Exp $])
AC_CONFIG_SRCDIR(lib/fribidi.h)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([gnits])
# --disable-charsets
AC_ARG_ENABLE(charsets,
AC_HELP_STRING([--disable-charsets],
- [exclude charset conversion routines from the library]))
+ [exclude charset conversion routines from library]))
if test x$enable_charsets = xno; then
FRIBIDI_CHARSETS=0
else
AC_SUBST(FRIBIDI_CHARSETS)
AM_CONDITIONAL(FRIBIDI_CHARSETS, test x$FRIBIDI_CHARSETS = x1)
+# --disable-arabic
+AC_ARG_ENABLE(arabic,
+ AC_HELP_STRING([--disable-arabic],
+ [exclude Arabic joining/shaping code from library]))
+if test x$enable_arabic = xno; then
+ FRIBIDI_NO_ARABIC=1
+else
+ FRIBIDI_NO_ARABIC=0
+fi
+AC_SUBST(FRIBIDI_NO_ARABIC)
+AM_CONDITIONAL(FRIBIDI_NO_ARABIC, test x$FRIBIDI_NO_ARABIC = x1)
+
# --with[out]-glib
AC_ARG_WITH(glib,
AC_HELP_STRING([--with-glib=@<:@no/auto/yes@:>@],
inst_symbols =
noinst_symbols =
-include $(top_srcdir)/lib/Headers.mk
-headers += $(libfribidi_la_headers)
-includepath += -I$(top_builddir)/lib -I$(top_srcdir)/lib
-includevpath += :$(top_builddir)/lib:$(top_srcdir)/lib
-inst_symbols += $(libfribidi_la_symbols)
-
include $(top_srcdir)/charset/Headers.mk
headers += $(libfribidi_char_sets_la_headers)
includepath += -I$(top_srcdir)/charset
noinst_symbols += $(libfribidi_char_sets_la_symbols)
endif # !FRIBIDI_CHARSETS
-# name of the header to include in the manual
-headers += fribidi.h
+# The lib/Headers.mk stuff should come after all optional stuff.
+include $(top_srcdir)/lib/Headers.mk
+headers += $(libfribidi_la_headers)
+includepath += -I$(top_builddir)/lib -I$(top_srcdir)/lib
+includevpath += :$(top_builddir)/lib:$(top_srcdir)/lib
+inst_symbols += $(libfribidi_la_symbols)
dist_man_MANS += $(inst_symbols:=.3)
dist_noinst_MANS += $(noinst_symbols:=.3)
libfribidi_la_headers = \
fribidi-begindecls.h \
fribidi-bidi.h \
- fribidi-bidi-type.h \
fribidi-bidi-types.h \
fribidi-bidi-types-list.h \
fribidi-common.h \
fribidi-enddecls.h \
fribidi-env.h \
fribidi-joining.h \
- fribidi-joining-type.h \
fribidi-joining-types.h \
fribidi-joining-types-list.h \
fribidi-mirroring.h \
fribidi-unicode.h \
fribidi-unicode-version.h \
fribidi.h
+# fribidi.h should be the last entry in the list above.
libfribidi_la_symbols = $(shell cat $(top_srcdir)/lib/fribidi.def)
env.h \
fribidi.c \
fribidi-bidi.c \
- fribidi-bidi-type.c \
fribidi-bidi-types.c \
fribidi-env.c \
fribidi-joining.c \
- fribidi-joining-type.c \
fribidi-joining-types.c \
fribidi-mem.c \
fribidi-mirroring.c \
+++ /dev/null
-/* FriBidi
- * fribidi-bidi-type.c - get character bidi type
- *
- * $Id: fribidi-bidi-type.c,v 1.13 2004-06-14 17:00:33 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.13 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-bidi-type.c,v $
- *
- * Authors:
- * Behdad Esfahbod, 2001, 2002, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2001,2002 Behdad Esfahbod
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- *
- * For licensing issues, contact <license@farsiweb.info>.
- */
-
-#include "common.h"
-
-#include <fribidi-bidi-type.h>
-
-enum FriBidiCharTypeLinearEnum
-{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE,
-# include "fribidi-bidi-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
- _FRIBIDI_NUM_TYPES
-};
-
-#include "bidi-type.tab.i"
-
-/* Map FriBidiCharTypeLinearEnum to FriBidiCharType. */
-static const FriBidiCharType linear_enum_to_char_type[] = {
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE,
-# include "fribidi-bidi-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
-};
-
-FRIBIDI_ENTRY FriBidiCharType
-fribidi_get_bidi_type (
- /* input */
- FriBidiChar ch
-)
-{
- return linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (ch)];
-}
-
-FRIBIDI_ENTRY void
-fribidi_get_bidi_types (
- /* input */
- const FriBidiChar *str,
- FriBidiStrIndex len,
- /* output */
- FriBidiCharType *type
-)
-{
- register FriBidiStrIndex i = len;
- for (; i; i--)
- *type++ = fribidi_get_bidi_type (*str++);
-}
-
-/* Editor directions:
- * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
- */
+++ /dev/null
-/* FriBidi
- * fribidi-bidi-type.h - get character bidi type
- *
- * $Id: fribidi-bidi-type.h,v 1.6 2004-06-14 17:00:33 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.6 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-bidi-type.h,v $
- *
- * Author:
- * Behdad Esfahbod, 2001, 2002, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2001,2002 Behdad Esfahbod
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- *
- * For licensing issues, contact <license@farsiweb.info>.
- */
-#ifndef _FRIBIDI_BIDI_TYPE_H
-#define _FRIBIDI_BIDI_TYPE_H
-
-#include "fribidi-common.h"
-
-#include "fribidi-types.h"
-#include "fribidi-bidi-types.h"
-
-#include "fribidi-begindecls.h"
-
-#define fribidi_get_bidi_type FRIBIDI_NAMESPACE(get_bidi_type)
-/* fribidi_get_bidi_type - get character bidi type
- *
- * This function returns the bidi type of a character. There are a few macros
- * defined in fribidi-bidi-types.h for querying a bidi type.
- */
-FRIBIDI_ENTRY FriBidiCharType
-fribidi_get_bidi_type (
- FriBidiChar ch /* input character */
-) FRIBIDI_GNUC_CONST;
-
-#define fribidi_get_bidi_types FRIBIDI_NAMESPACE(get_bidi_types)
-/* fribidi_get_bidi_types - get bidi types for an string of characters
- *
- * This function finds the bidi types of an string of characters. See
- * fribidi_get_bidi_type for more about the bidi types returned by this
- * function.
- */
- FRIBIDI_ENTRY void fribidi_get_bidi_types (
- const FriBidiChar *str, /* input string */
- FriBidiStrIndex len, /* input string length */
- FriBidiCharType *type /* output bidi types */
-);
-
-#include "fribidi-enddecls.h"
-
-#endif /* !_FRIBIDI_BIDI_TYPE_H */
-/* Editor directions:
- * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
- */
/* FriBidi
* fribidi-bidi-types.c - character bidi types
*
- * $Id: fribidi-bidi-types.c,v 1.6 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-bidi-types.c,v 1.7 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.6 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.7 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types.c,v $
*
* Authors:
#include "bidi-types.h"
-#ifdef DEBUG
+enum FriBidiCharTypeLinearEnum
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE,
+# include "fribidi-bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+ _FRIBIDI_NUM_TYPES
+};
-char
-fribidi_char_from_bidi_type (
+#include "bidi-type.tab.i"
+
+/* Map FriBidiCharTypeLinearEnum to FriBidiCharType. */
+static const FriBidiCharType linear_enum_to_char_type[] = {
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) FRIBIDI_TYPE_##TYPE,
+# include "fribidi-bidi-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+};
+
+FRIBIDI_ENTRY FriBidiCharType
+fribidi_get_bidi_type (
+ /* input */
+ FriBidiChar ch
+)
+{
+ return linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (ch)];
+}
+
+FRIBIDI_ENTRY void
+fribidi_get_bidi_types (
+ /* input */
+ const FriBidiChar *str,
+ const FriBidiStrIndex len,
+ /* output */
+ FriBidiCharType *type
+)
+{
+ register FriBidiStrIndex i = len;
+ for (; i; i--)
+ {
+ *type++ = linear_enum_to_char_type[FRIBIDI_GET_BIDI_TYPE (*str)];
+ str++;
+ }
+}
+
+FRIBIDI_ENTRY const char *
+fribidi_bidi_type_name (
/* input */
FriBidiCharType t
)
{
switch (t)
{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return SYMBOL;
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return STRINGIZE(TYPE);
# define _FRIBIDI_ALL_TYPES
# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ALL_TYPES
# undef _FRIBIDI_ADD_TYPE
default:
- return '?';
+ return "?";
}
}
-#endif
+#ifdef DEBUG
-FRIBIDI_ENTRY const char *
-fribidi_bidi_type_name (
+char
+fribidi_char_from_bidi_type (
/* input */
FriBidiCharType t
)
{
switch (t)
{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return STRINGIZE(TYPE);
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return SYMBOL;
# define _FRIBIDI_ALL_TYPES
# include "fribidi-bidi-types-list.h"
# undef _FRIBIDI_ALL_TYPES
# undef _FRIBIDI_ADD_TYPE
default:
- return "?";
+ return '?';
}
}
+#endif /* DEBUG */
+
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/
/* FriBidi
* fribidi-bidi-types.h - character bidi types
*
- * $Id: fribidi-bidi-types.h,v 1.8 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-bidi-types.h,v 1.9 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.8 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.9 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi-types.h,v $
*
* Author:
/* Functions finally */
+
+#define fribidi_get_bidi_type FRIBIDI_NAMESPACE(get_bidi_type)
+/* fribidi_get_bidi_type - get character bidi type
+ *
+ * This function returns the bidi type of a character. There are a few macros
+ * defined in fribidi-bidi-types.h for querying a bidi type.
+ */
+FRIBIDI_ENTRY FriBidiCharType
+fribidi_get_bidi_type (
+ FriBidiChar ch /* input character */
+) FRIBIDI_GNUC_CONST;
+
+#define fribidi_get_bidi_types FRIBIDI_NAMESPACE(get_bidi_types)
+/* fribidi_get_bidi_types - get bidi types for an string of characters
+ *
+ * This function finds the bidi types of an string of characters. See
+ * fribidi_get_bidi_type for more information about the bidi types returned
+ * by this function.
+ */
+ FRIBIDI_ENTRY void fribidi_get_bidi_types (
+ const FriBidiChar *str, /* input string */
+ const FriBidiStrIndex len, /* input string length */
+ FriBidiCharType *type /* output bidi types */
+);
+
#define fribidi_bidi_type_name FRIBIDI_NAMESPACE(bidi_type_name)
/* fribidi_bidi_type_name - get bidi type name
*
* This function returns the bidi type name of a character type. The
* returned string is a static string and should not be freed.
*/
-FRIBIDI_ENTRY const char *
-fribidi_bidi_type_name (
+ FRIBIDI_ENTRY const char *fribidi_bidi_type_name (
FriBidiCharType t /* input bidi type */
) FRIBIDI_GNUC_CONST;
/* FriBidi
* fribidi-bidi.c - bidirectional algorithm
*
- * $Id: fribidi-bidi.c,v 1.11 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi-bidi.c,v 1.12 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.11 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.12 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi.c,v $
*
* Authors:
#include "common.h"
#include <fribidi-bidi.h>
-#include <fribidi-bidi-type.h>
+#include <fribidi-bidi-types.h>
#include <fribidi-mirroring.h>
#include <fribidi-unicode.h>
#include <fribidi-env.h>
MSG (" Org. types : ");
if (bidi_types)
- for (i = 0; i < len; i++)
- MSG2 ("%c", fribidi_char_from_bidi_type (BIDI_TYPE(i)));
+ for (i = 0; i < len; i++)
+ MSG2 ("%c", fribidi_char_from_bidi_type (BIDI_TYPE (i)));
MSG ("\n");
}
#endif /* DEBUG */
{
/* if state is on at the very first of the string, do this too. */
if (j >= 0)
- {
- char_type = BIDI_TYPE(j);
- }
+ {
+ char_type = BIDI_TYPE (j);
+ }
else
char_type = FRIBIDI_TYPE_ON;
if (!state && FRIBIDI_IS_SEPARATOR (char_type))
}
-FRIBIDI_ENTRY void
-fribidi_shape_mirroring (
- /* input */
- const FriBidiLevel *embedding_level_list,
- const FriBidiStrIndex len,
- /* input and output */
- FriBidiChar *str
-)
-{
- register FriBidiStrIndex i;
-
- fribidi_assert (embedding_level_list);
-
- if UNLIKELY
- (len == 0 || !str) return;
-
- /* L4. Mirror all characters that are in odd levels and have mirrors. */
- for (i = len - 1; i >= 0; i--)
- if (FRIBIDI_LEVEL_IS_RTL (embedding_level_list[i]))
- {
- FriBidiChar mirrored_ch;
-
- if (fribidi_get_mirror_char (str[i], &mirrored_ch))
- str[i] = mirrored_ch;
- }
-}
-
-
static void
bidi_string_reverse (
FriBidiChar *str,
/* L3. Reorder NSMs. */
for (i = off + len - 1; i >= off; i--)
if (FRIBIDI_LEVEL_IS_RTL (embedding_level_list[i])
- && BIDI_TYPE(i) == FRIBIDI_TYPE_NSM)
+ && BIDI_TYPE (i) == FRIBIDI_TYPE_NSM)
{
register FriBidiStrIndex seq_end = i;
level = embedding_level_list[i];
/* FriBidi
* fribidi-bidi.h - bidirectional algorithm
*
- * $Id: fribidi-bidi.h,v 1.8 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi-bidi.h,v 1.9 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.8 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.9 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-bidi.h,v $
*
* Authors:
fribidi_get_par_embedding_levels (
const FriBidiChar *str, /* input paragraph string */
const FriBidiStrIndex len, /* input string length of the paragraph */
- const FriBidiCharType *bidi_types, /* input bidi types */
+ const FriBidiCharType *bidi_types, /* input bidi types */
FriBidiParType *pbase_dir, /* requested and resolved paragraph
* base direction */
FriBidiLevel *embedding_level_list /* output list of embedding levels */
) FRIBIDI_GNUC_WARN_UNUSED;
-#define fribidi_shape_mirroring FRIBIDI_NAMESPACE(shape_mirroring)
-/* fribidi_shape - do mirroring shaping
- *
- * This functions replaces mirroring characters on right-to-left embeddings in
- * string str with their mirrored equivalent as returned by
- * fribidi_get_mirror_char().
- */
- FRIBIDI_ENTRY void fribidi_shape_mirroring (
- const FriBidiLevel *embedding_level_list, /* input list of embedding
- levels, as returned by
- fribidi_get_par_embedding_levels */
- const FriBidiStrIndex len, /* input string length */
- FriBidiChar *str /* string to shape */
-);
-
#define fribidi_reorder_line FRIBIDI_NAMESPACE(reorder_line)
/* fribidi_reorder_line - reorder a line of logical string to visual
*
*/
FRIBIDI_ENTRY FriBidiLevel fribidi_reorder_line (
const FriBidiLevel *embedding_level_list, /* input list of embedding levels,
- as returned by
- fribidi_get_par_embedding_levels */
+ as returned by
+ fribidi_get_par_embedding_levels */
const FriBidiStrIndex len, /* input length of the line */
const FriBidiStrIndex off, /* input offset of the beginning of the line
in the paragraph */
#define FRIBIDI_INTERFACE_VERSION @FRIBIDI_INTERFACE_VERSION@
#define FRIBIDI_INTERFACE_VERSION_STRING "@FRIBIDI_INTERFACE_VERSION@"
+/* Define to 1 if you don't want Arabic joining/shaping code in the library */
+#define FRIBIDI_NO_ARABIC @FRIBIDI_NO_ARABIC@
+
/* Define to 1 if you want charset conversion codes in the library */
#define FRIBIDI_CHARSETS @FRIBIDI_CHARSETS@
+++ /dev/null
-/* FriBidi
- * fribidi-joining-type.c - get character joining type
- *
- * $Id: fribidi-joining-type.c,v 1.1 2004-06-13 20:11:42 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-joining-type.c,v $
- *
- * Authors:
- * Behdad Esfahbod, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2004 Behdad Esfahbod
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- *
- * For licensing issues, contact <license@farsiweb.info>.
- */
-
-#include "common.h"
-
-#include <fribidi-joining-type.h>
-#include <fribidi-joining-types.h>
-
-enum FriBidiJoiningTypeShortEnum
-{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE = FRIBIDI_JOINING_TYPE_##TYPE,
-# include "fribidi-joining-types-list.h"
-# undef _FRIBIDI_ADD_TYPE
- _FRIBIDI_NUM_TYPES
-};
-
-#include "joining-type.tab.i"
-
-FRIBIDI_ENTRY FriBidiJoiningType
-fribidi_get_joining_type (
- /* input */
- FriBidiChar ch
-)
-{
- return FRIBIDI_GET_JOINING_TYPE (ch);
-}
+++ /dev/null
-/* FriBidi
- * fribidi-joining-type.h - get character joining type
- *
- * $Id: fribidi-joining-type.h,v 1.1 2004-06-13 20:11:42 behdad Exp $
- * $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
- * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/Attic/fribidi-joining-type.h,v $
- *
- * Author:
- * Behdad Esfahbod, 2004
- *
- * Copyright (C) 2004 Sharif FarsiWeb, Inc
- * Copyright (C) 2004 Behdad Esfahbod
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library, in a file named COPYING; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA
- *
- * For licensing issues, contact <license@farsiweb.info>.
- */
-#ifndef _FRIBIDI_JOINING_TYPE_H
-#define _FRIBIDI_JOINING_TYPE_H
-
-#include "fribidi-common.h"
-
-#include "fribidi-types.h"
-#include "fribidi-joining-types.h"
-
-#include "fribidi-begindecls.h"
-
-#define fribidi_get_joining_type FRIBIDI_NAMESPACE(get_joining_type)
-/* fribidi_get_joining_type - get character joining type
- *
- * This function returns the joining type of a character. There are a few
- * macros defined in fribidi-joining-types.h for querying a joining type.
- */
-FRIBIDI_ENTRY FriBidiJoiningType
-fribidi_get_joining_type (
- FriBidiChar ch /* input character */
-) FRIBIDI_GNUC_CONST;
-
-#include "fribidi-enddecls.h"
-
-#endif /* !_FRIBIDI_JOINING_TYPE_H */
-/* Editor directions:
- * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
- */
/* FriBidi
* fribidi-joining-types.c - character joining types
*
- * $Id: fribidi-joining-types.c,v 1.1 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-joining-types.c,v 1.2 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.2 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-joining-types.c,v $
*
* Authors:
#include "common.h"
+#if !FRIBIDI_NO_ARABIC
+
#include <fribidi-joining-types.h>
#include "joining-types.h"
-#ifdef DEBUG
+enum FriBidiJoiningTypeShortEnum
+{
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE = FRIBIDI_JOINING_TYPE_##TYPE,
+# include "fribidi-joining-types-list.h"
+# undef _FRIBIDI_ADD_TYPE
+ _FRIBIDI_NUM_TYPES
+};
-char
-fribidi_char_from_joining_type (
+#include "joining-type.tab.i"
+
+FRIBIDI_ENTRY FriBidiJoiningType
+fribidi_get_joining_type (
+ /* input */
+ FriBidiChar ch
+)
+{
+ return FRIBIDI_GET_JOINING_TYPE (ch);
+}
+
+FRIBIDI_ENTRY void
+fribidi_get_joining_types (
+ /* input */
+ const FriBidiChar *str,
+ const FriBidiStrIndex len,
+ /* output */
+ FriBidiJoiningType *type
+)
+{
+ register FriBidiStrIndex i = len;
+ for (; i; i--)
+ {
+ *type++ = FRIBIDI_GET_JOINING_TYPE (*str);
+ str++;
+ }
+}
+
+FRIBIDI_ENTRY const char *
+fribidi_joining_type_name (
/* input */
FriBidiJoiningType j
)
{
switch (j)
{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return SYMBOL;
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return STRINGIZE(TYPE);
# include "fribidi-joining-types-list.h"
# undef _FRIBIDI_ADD_TYPE
default:
- return '?';
+ return "?";
}
}
-#endif
+#ifdef DEBUG
-FRIBIDI_ENTRY const char *
-fribidi_joining_type_name (
+char
+fribidi_char_from_joining_type (
/* input */
FriBidiJoiningType j
)
{
switch (j)
{
-# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return STRINGIZE(TYPE);
+# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_JOINING_TYPE_##TYPE: return SYMBOL;
# include "fribidi-joining-types-list.h"
# undef _FRIBIDI_ADD_TYPE
default:
- return "?";
+ return '?';
}
}
+#endif /* DEBUG */
+
+#endif /* !FRIBIDI_NO_ARABIC */
+
/* Editor directions:
* vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
*/
/* FriBidi
* fribidi-joining-types.h - character joining types
*
- * $Id: fribidi-joining-types.h,v 1.1 2004-06-13 20:11:42 behdad Exp $
+ * $Id: fribidi-joining-types.h,v 1.2 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.1 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.2 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-joining-types.h,v $
*
* Author:
((p) & (FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED))
+/* Functions finally */
+
+
+#define fribidi_get_joining_type FRIBIDI_NAMESPACE(get_joining_type)
+/* fribidi_get_joining_type - get character joining type
+ *
+ * This function returns the joining type of a character. There are a few
+ * macros defined in fribidi-joining-types.h for querying a joining type.
+ */
+FRIBIDI_ENTRY FriBidiJoiningType
+fribidi_get_joining_type (
+ FriBidiChar ch /* input character */
+) FRIBIDI_GNUC_CONST;
+
+#define fribidi_get_joining_types FRIBIDI_NAMESPACE(get_joining_types)
+/* fribidi_get_joining_types - get joining types for an string of characters
+ *
+ * This function finds the joining types of an string of characters. See
+ * fribidi_get_joining_type for more information about the joining types
+ * returned by this function.
+ */
+ FRIBIDI_ENTRY void fribidi_get_joining_types (
+ const FriBidiChar *str, /* input string */
+ const FriBidiStrIndex len, /* input string length */
+ FriBidiJoiningType *type /* output bidi types */
+);
+
#define fribidi_joining_type_name FRIBIDI_NAMESPACE(joining_type_name)
/* fribidi_joining_type_name - get joining type name
*
* This function returns the joining type name of a joining type. The
* returned string is a static string and should not be freed.
*/
-FRIBIDI_ENTRY const char *
-fribidi_joining_type_name (
+ FRIBIDI_ENTRY const char *fribidi_joining_type_name (
FriBidiJoiningType j /* input joining type */
) FRIBIDI_GNUC_CONST;
* For licensing issues, contact <license@farsiweb.info> or write to
* Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
*/
-/* $Id: fribidi-mirroring.c,v 1.11 2004-06-13 20:11:42 behdad Exp $
+/* $Id: fribidi-mirroring.c,v 1.12 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-13 20:11:42 $
- * $Revision: 1.11 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.12 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-mirroring.c,v $
*
* Authors:
return ch != result ? true : false;
}
+
+FRIBIDI_ENTRY void
+fribidi_shape_mirroring (
+ /* input */
+ const FriBidiLevel *embedding_level_list,
+ const FriBidiStrIndex len,
+ /* input and output */
+ FriBidiChar *str
+)
+{
+ register FriBidiStrIndex i;
+
+ fribidi_assert (embedding_level_list);
+
+ if UNLIKELY
+ (len == 0 || !str) return;
+
+ /* L4. Mirror all characters that are in odd levels and have mirrors. */
+ for (i = len - 1; i >= 0; i--)
+ if (FRIBIDI_LEVEL_IS_RTL (embedding_level_list[i]))
+ {
+ FriBidiChar mirrored_ch;
+
+ if (fribidi_get_mirror_char (str[i], &mirrored_ch))
+ str[i] = mirrored_ch;
+ }
+}
+
/* Editor directions:
* Local Variables:
* mode: c
* For licensing issues, contact <license@farsiweb.info> or write to
* Sharif FarsiWeb, Inc., PO Box 13445-389, Tehran, Iran.
*/
-/* $Id: fribidi-mirroring.h,v 1.7 2004-06-09 14:59:21 behdad Exp $
+/* $Id: fribidi-mirroring.h,v 1.8 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 14:59:21 $
- * $Revision: 1.7 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.8 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-mirroring.h,v $
*
* Authors:
#include "fribidi-common.h"
#include "fribidi-types.h"
+#include "fribidi-bidi-types.h"
#include "fribidi-begindecls.h"
FriBidiChar *mirrored_ch /* output mirrored character */
);
+#define fribidi_shape_mirroring FRIBIDI_NAMESPACE(shape_mirroring)
+/* fribidi_shape_mirroring - do mirroring shaping
+ *
+ * This functions replaces mirroring characters on right-to-left embeddings in
+ * string with their mirrored equivalent as returned by
+ * fribidi_get_mirror_char().
+ */
+FRIBIDI_ENTRY void fribidi_shape_mirroring (
+ const FriBidiLevel *embedding_level_list, /* input list of embedding
+ levels, as returned by
+ fribidi_get_par_embedding_levels */
+ const FriBidiStrIndex len, /* input string length */
+ FriBidiChar *str /* string to shape */
+);
+
#include "fribidi-enddecls.h"
#endif /* !_FRIBIDI_MIRRORING_H */
/* FriBidi
* fribidi-run.c - text run data type
*
- * $Id: fribidi-run.c,v 1.4 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi-run.c,v 1.5 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.4 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.5 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi-run.c,v $
*
* Authors:
#include "common.h"
-#include <fribidi-bidi-type.h>
+#include <fribidi-bidi-types.h>
#include "run.h"
#include "env.h"
/* FriBidi
* fribidi.c - Unicode bidirectional and Arabic joining/shaping algorithms
*
- * $Id: fribidi.c,v 1.9 2004-06-14 17:00:33 behdad Exp $
+ * $Id: fribidi.c,v 1.10 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-14 17:00:33 $
- * $Revision: 1.9 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.10 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi.c,v $
*
* Authors:
fribidi_shape (embedding_level_list, len, visual_str);
- status = fribidi_reorder_line (embedding_level_list, len, 0, NULL, visual_str,
- position_L_to_V_list, position_V_to_L_list);
+ status =
+ fribidi_reorder_line (embedding_level_list, len, 0, NULL, visual_str,
+ position_L_to_V_list, position_V_to_L_list);
out:
-fribidi_get_bidi_type
-fribidi_get_mirror_char
-fribidi_bidi_type_name
fribidi_get_par_embedding_levels
fribidi_reorder_line
-fribidi_shape_mirroring
-fribidi_shape
-fribidi_remove_bidi_marks
-fribidi_log2vis
+fribidi_get_bidi_type
+fribidi_get_bidi_types
+fribidi_bidi_type_name
fribidi_debug_status
fribidi_set_debug
fribidi_mirroring_status
fribidi_set_mirroring
fribidi_reorder_nsm_status
fribidi_set_reorder_nsm
+fribidi_get_joining_type
+fribidi_get_joining_types
+fribidi_joining_type_name
+fribidi_get_mirror_char
+fribidi_shape_mirroring
+fribidi_shape
+fribidi_remove_bidi_marks
+fribidi_log2vis
/* FriBidi
* fribidi.h - Unicode bidirectional and Arabic joining/shaping algorithms
*
- * $Id: fribidi.h,v 1.5 2004-06-09 20:01:00 behdad Exp $
+ * $Id: fribidi.h,v 1.6 2004-06-14 18:43:53 behdad Exp $
* $Author: behdad $
- * $Date: 2004-06-09 20:01:00 $
- * $Revision: 1.5 $
+ * $Date: 2004-06-14 18:43:53 $
+ * $Revision: 1.6 $
* $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/lib/fribidi.h,v $
*
* Author:
#include "fribidi-unicode.h"
#include "fribidi-types.h"
#include "fribidi-env.h"
-#include "fribidi-bidi-type.h"
-#include "fribidi-bidi.h"
#include "fribidi-mirroring.h"
+#include "fribidi-bidi-types.h"
+#include "fribidi-bidi.h"
+#if !FRIBIDI_NO_ARABIC
+#include "fribidi-joining-types.h"
+#include "fribidi-joining.h"
+#endif /* !FRIBIDI_NO_ARABIC */
#if FRIBIDI_CHARSETS
# include "fribidi-char-sets.h"
#endif /* FRIBIDI_CHARSETS */