[FriBidi-commit] fribidi/lib Headers.mk, 1.5, 1.6 Makefile.am, 1.9, 1.10 common.h, 1.12, 1.13 debug.h, 1.6, 1.7 env.h, 1.2, 1.3 fribidi-bidi-type.c, 1.11, 1.12 fribidi-bidi-types-list.h, 1.4, 1.5 fribidi-bidi-types.c, 1.5, 1.6 fribidi-bidi-types.h, 1.7, 1.8 fribidi-joining-type.c, NONE, 1.1 fribidi-joining-type.h, NONE, 1.1 fribidi-joining-types-list.h, NONE, 1.1 fribidi-joining-types.c, NONE, 1.1 fribidi-joining-types.h, NONE, 1.1 fribidi-joining.c, NONE, 1.1 fribidi-joining.h, NONE, 1.1 fribidi-mirroring.c, 1.10, 1.11 fribidi.def, 1.4, 1.5 joining-types.h, NONE, 1.1 run.h, 1.4, 1.5

Behdad Esfahbod behdad at pdx.freedesktop.org
Sun Jun 13 13:11:44 PDT 2004


Update of /cvs/fribidi/fribidi/lib
In directory pdx:/tmp/cvs-serv32450/lib

Modified Files:
	Headers.mk Makefile.am common.h debug.h env.h 
	fribidi-bidi-type.c fribidi-bidi-types-list.h 
	fribidi-bidi-types.c fribidi-bidi-types.h fribidi-mirroring.c 
	fribidi.def run.h 
Added Files:
	fribidi-joining-type.c fribidi-joining-type.h 
	fribidi-joining-types-list.h fribidi-joining-types.c 
	fribidi-joining-types.h fribidi-joining.c fribidi-joining.h 
	joining-types.h 
Log Message:
First joining stuff checked in.  Generate joining table using my beloved
packtab, in gen-joining-type-tab.c.  Defined FriBidiJoiningType type and wrote
accompanying functions and macros.


Index: Headers.mk
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/Headers.mk,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Headers.mk	4 Jun 2004 09:41:11 -0000	1.5
+++ Headers.mk	13 Jun 2004 20:11:42 -0000	1.6
@@ -5,13 +5,16 @@
 		fribidi-bidi-types.h \
 		fribidi-bidi-types-list.h \
 		fribidi-common.h \
-		fribidi-config.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-types.h \
 		fribidi-unicode.h \
 		fribidi-unicode-version.h \
 		fribidi.h
 
-libfribidi_la_symbols := $(shell cat "$(top_srcdir)/lib/fribidi.def")
+libfribidi_la_symbols = $(shell cat $(top_srcdir)/lib/fribidi.def)

Index: Makefile.am
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Makefile.am	31 May 2004 18:39:39 -0000	1.9
+++ Makefile.am	13 Jun 2004 20:11:42 -0000	1.10
@@ -1,3 +1,5 @@
+EXTRA_DIST = fribidi.def
+
 lib_LTLIBRARIES = libfribidi.la
 
 AM_CPPFLAGS = $(MISC_CFLAGS)
@@ -26,11 +28,11 @@
 endif # FRIBIDI_CHARSETS
 
 include Headers.mk
-pkginclude_HEADERS = $(libfribidi_la_headers)
+pkginclude_HEADERS = $(libfribidi_la_headers) fribidi-config.h
 
 libfribidi_la_SOURCES =	\
-		bidi-types.h \
 		bidi-type.tab.i \
+		bidi-types.h \
 		common.h \
 		debug.h \
 		env.h \
@@ -39,22 +41,35 @@
 		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 \
 		fribidi-run.c \
+		joining-type.tab.i \
+		joining-types.h \
 		mem.h \
 		mirroring.tab.i \
 		run.h
 
 BUILT_SOURCES= \
+		fribidi-unicode-version.h \
 		bidi-type.tab.i \
-		mirroring.tab.i \
-		fribidi-unicode-version.h
+		joining-type.tab.i \
+		mirroring.tab.i
 
 $(BUILT_SOURCES):
-	(cd $(top_builddir)/gen.tab && \
-	 $(MAKE) $(AM_MAKEFLAGS) $@) && \
-	mv $(top_builddir)/gen.tab/$@ .
+	@(cd $(top_builddir)/gen.tab && \
+	$(MAKE) $(AM_MAKEFLAGS) $@) && \
+	(test -f $@ || mv $(top_builddir)/gen.tab/$@ .)
+
+# re-generate all built sources:
+gen:
+	@(cd $(top_builddir)/gen.tab && \
+	$(MAKE) $(AM_MAKEFLAGS) $@) && \
+	$(RM) $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) $(BUILT_SOURCES)
 
 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
 

Index: common.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/common.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- common.h	9 Jun 2004 14:59:21 -0000	1.12
+++ common.h	13 Jun 2004 20:11:42 -0000	1.13
@@ -155,6 +155,12 @@
 # define FRIBIDI_EMPTY_STMT FRIBIDI_BEGIN_STMT (void) 0; FRIBIDI_END_STMT
 #endif /* !FRIBIDI_EMPTY_STMT */
 
+#if HAVE_STRINGIZE
+# define STRINGIZE(symbol) #symbol
+#else /* !HAVE_STRINGIZE */
+# define STRINGIZE(symbol) "(no stringize operator available)"
+#endif /* !HAVE_STRINGIZE */
+
 /* As per recommendation of GNU Coding Standards. */
 #define _GNU_SOURCE
 

Index: debug.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/debug.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- debug.h	9 Jun 2004 14:59:21 -0000	1.6
+++ debug.h	13 Jun 2004 20:11:42 -0000	1.7
@@ -42,11 +42,6 @@
 #if DEBUG
 
 /* These definitions should only be used in DEBUG mode: */
-#if HAVE_STRINGIZE
-# define STRINGIZE(symbol) #symbol
-#else /* !HAVE_STRINGIZE */
-# define STRINGIZE(symbol)
-#endif /* !HAVE_STRINGIZE */
 #ifndef __LINE__
 # define __LINE__ 0
 #endif /* !__LINE__ */

Index: env.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/env.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- env.h	3 May 2004 22:05:19 -0000	1.2
+++ env.h	13 Jun 2004 20:11:42 -0000	1.3
@@ -40,6 +40,7 @@
 #include <fribidi-bidi-types.h>
 
 #include "mem.h"
+#include "run.h"
 
 #include <fribidi-begindecls.h>
 

Index: fribidi-bidi-type.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi-type.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- fribidi-bidi-type.c	9 Jun 2004 20:01:00 -0000	1.11
+++ fribidi-bidi-type.c	13 Jun 2004 20:11:42 -0000	1.12
@@ -34,9 +34,6 @@
 #include "common.h"
 
 #include <fribidi-bidi-type.h>
-#include <fribidi-unicode.h>
-
-#include "bidi-types.h"
 
 enum FriBidiCharTypeLinearEnum
 {

Index: fribidi-bidi-types-list.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi-types-list.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fribidi-bidi-types-list.h	9 Jun 2004 14:59:21 -0000	1.4
+++ fribidi-bidi-types-list.h	13 Jun 2004 20:11:42 -0000	1.5
@@ -54,7 +54,7 @@
 _FRIBIDI_ADD_TYPE (BN, 'b')	/* Boundary Neutral */
 _FRIBIDI_ADD_TYPE (BS, 'B')	/* Block Separator */
 _FRIBIDI_ADD_TYPE (SS, 'S')	/* Segment Separator */
-_FRIBIDI_ADD_TYPE (WS, '_')	/* White-Space */
+_FRIBIDI_ADD_TYPE (WS, '_')	/* WhiteSpace */
 _FRIBIDI_ADD_TYPE (ON, 'n')	/* Other Neutral */
 _FRIBIDI_ADD_TYPE (LRE, '+')	/* Left-to-Right Embedding */
 _FRIBIDI_ADD_TYPE (RLE, '+')	/* Right-to-Left Embedding */

Index: fribidi-bidi-types.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi-types.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fribidi-bidi-types.c	4 Jun 2004 09:41:11 -0000	1.5
+++ fribidi-bidi-types.c	13 Jun 2004 20:11:42 -0000	1.6
@@ -67,7 +67,7 @@
 {
   switch (t)
     {
-#   define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) case FRIBIDI_TYPE_##TYPE: return #TYPE;
+#   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

Index: fribidi-bidi-types.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-bidi-types.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- fribidi-bidi-types.h	9 Jun 2004 20:01:00 -0000	1.7
+++ fribidi-bidi-types.h	13 Jun 2004 20:11:42 -0000	1.8
@@ -41,15 +41,11 @@
 
 typedef signed char FriBidiLevel;
 
-typedef struct _FriBidiRun FriBidiRun;
-
 /* 
- * Define some bit masks, that character types are based on, each one has
- * only one bit on.
+ * Define bit masks that bidi types are based on, each mask has
+ * only one bit set.
  */
 
-/* Do not use enum, because 16bit processors do not allow 32bit enum values. */
-
 #define FRIBIDI_MASK_RTL	0x00000001L	/* Is right to left */
 #define FRIBIDI_MASK_ARABIC	0x00000002L	/* Is arabic */
 
@@ -58,22 +54,22 @@
 #define FRIBIDI_MASK_WEAK	0x00000020L	/* Is weak */
 #define FRIBIDI_MASK_NEUTRAL	0x00000040L	/* Is neutral */
 #define FRIBIDI_MASK_SENTINEL	0x00000080L	/* Is sentinel */
-/* Sentinels are not valid chars, just identify the start and end of strings. */
+/* Sentinels are not valid chars, just identify the start/end of strings. */
 
 /* Each char can be only one of the five following. */
 #define FRIBIDI_MASK_LETTER	0x00000100L	/* Is letter: L, R, AL */
 #define FRIBIDI_MASK_NUMBER	0x00000200L	/* Is number: EN, AN */
-#define FRIBIDI_MASK_NUMSEPTER	0x00000400L	/* Is number separator or terminator: ES, ET, CS */
+#define FRIBIDI_MASK_NUMSEPTER	0x00000400L	/* Is separator or terminator: ES, ET, CS */
 #define FRIBIDI_MASK_SPACE	0x00000800L	/* Is space: BN, BS, SS, WS */
 #define FRIBIDI_MASK_EXPLICIT	0x00001000L	/* Is expilict mark: LRE, RLE, LRO, RLO, PDF */
 
-/* Can be on only if FRIBIDI_MASK_SPACE is also on. */
-#define FRIBIDI_MASK_SEPARATOR	0x00002000L	/* Is test separator: BS, SS */
-/* Can be on only if FRIBIDI_MASK_EXPLICIT is also on. */
+/* Can be set only if FRIBIDI_MASK_SPACE is also set. */
+#define FRIBIDI_MASK_SEPARATOR	0x00002000L	/* Is text separator: BS, SS */
+/* Can be set only if FRIBIDI_MASK_EXPLICIT is also set. */
 #define FRIBIDI_MASK_OVERRIDE	0x00004000L	/* Is explicit override: LRO, RLO */
 
-/* The following must be to make types pairwise different, some of them can
-   be removed but are here because of efficiency (make queries faster). */
+/* The following exist to make types pairwise different, some of them can
+ * be removed but are here because of efficiency (make queries faster). */
 
 #define FRIBIDI_MASK_ES		0x00010000L
 #define FRIBIDI_MASK_ET		0x00020000L
@@ -94,76 +90,75 @@
  * Define values for FriBidiCharType
  */
 
-/* Strong left to right */
-#define FRIBIDI_TYPE_LTR_VAL	( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_LETTER )
-/* Right to left characters */
-#define FRIBIDI_TYPE_RTL_VAL	( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_LETTER \
-				+ FRIBIDI_MASK_RTL)
-/* Arabic characters */
-#define FRIBIDI_TYPE_AL_VAL	( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_LETTER \
-				+ FRIBIDI_MASK_RTL + FRIBIDI_MASK_ARABIC )
-/* Left-To-Right embedding */
-#define FRIBIDI_TYPE_LRE_VAL	(FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT)
-/* Right-To-Left embedding */
-#define FRIBIDI_TYPE_RLE_VAL	( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT \
-				+ FRIBIDI_MASK_RTL )
-/* Left-To-Right override */
-#define FRIBIDI_TYPE_LRO_VAL	( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT \
-				+ FRIBIDI_MASK_OVERRIDE )
-/* Right-To-Left override */
-#define FRIBIDI_TYPE_RLO_VAL	( FRIBIDI_MASK_STRONG + FRIBIDI_MASK_EXPLICIT \
-				+ FRIBIDI_MASK_RTL + FRIBIDI_MASK_OVERRIDE )
+/* Left-To-Right letter */
+#define FRIBIDI_TYPE_LTR_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER )
+/* Right-To-Left letter */
+#define FRIBIDI_TYPE_RTL_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER \
+				| FRIBIDI_MASK_RTL)
+/* Arabic Letter */
+#define FRIBIDI_TYPE_AL_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_LETTER \
+				| FRIBIDI_MASK_RTL | FRIBIDI_MASK_ARABIC )
+/* Left-to-Right Embedding */
+#define FRIBIDI_TYPE_LRE_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT)
+/* Right-to-Left Embedding */
+#define FRIBIDI_TYPE_RLE_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
+				| FRIBIDI_MASK_RTL )
+/* Left-to-Right Override */
+#define FRIBIDI_TYPE_LRO_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
+				| FRIBIDI_MASK_OVERRIDE )
+/* Right-to-Left Override */
+#define FRIBIDI_TYPE_RLO_VAL	( FRIBIDI_MASK_STRONG | FRIBIDI_MASK_EXPLICIT \
+				| FRIBIDI_MASK_RTL | FRIBIDI_MASK_OVERRIDE )
 
-/* Pop directional override */
-#define FRIBIDI_TYPE_PDF_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_EXPLICIT )
-/* European digit */
-#define FRIBIDI_TYPE_EN_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMBER )
-/* Arabic digit */
-#define FRIBIDI_TYPE_AN_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMBER \
-				+ FRIBIDI_MASK_ARABIC )
-/* European number separator */
-#define FRIBIDI_TYPE_ES_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMSEPTER \
-				+ FRIBIDI_MASK_ES )
-/* European number terminator */
-#define FRIBIDI_TYPE_ET_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMSEPTER \
-				+ FRIBIDI_MASK_ET )
+/* Pop Directional Flag*/
+#define FRIBIDI_TYPE_PDF_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_EXPLICIT )
+/* European Numeral */
+#define FRIBIDI_TYPE_EN_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMBER )
+/* Arabic Numeral */
+#define FRIBIDI_TYPE_AN_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMBER \
+				| FRIBIDI_MASK_ARABIC )
+/* European number Separator */
+#define FRIBIDI_TYPE_ES_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
+				| FRIBIDI_MASK_ES )
+/* European number Terminator */
+#define FRIBIDI_TYPE_ET_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
+				| FRIBIDI_MASK_ET )
 /* Common Separator */
-#define FRIBIDI_TYPE_CS_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NUMSEPTER \
-				+ FRIBIDI_MASK_CS )
-/* Non spacing mark */
-#define FRIBIDI_TYPE_NSM_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_NSM )
-/* Boundary neutral */
-#define FRIBIDI_TYPE_BN_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_SPACE \
-				+ FRIBIDI_MASK_BN )
+#define FRIBIDI_TYPE_CS_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NUMSEPTER \
+				| FRIBIDI_MASK_CS )
+/* Non Spacing Mark */
+#define FRIBIDI_TYPE_NSM_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_NSM )
+/* Boundary Neutral */
+#define FRIBIDI_TYPE_BN_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_SPACE \
+				| FRIBIDI_MASK_BN )
 
-/* Block separator */
-#define FRIBIDI_TYPE_BS_VAL	( FRIBIDI_MASK_NEUTRAL + FRIBIDI_MASK_SPACE \
-				+ FRIBIDI_MASK_SEPARATOR + FRIBIDI_MASK_BS )
-/* Segment separator */
-#define FRIBIDI_TYPE_SS_VAL	( FRIBIDI_MASK_NEUTRAL + FRIBIDI_MASK_SPACE \
-				+ FRIBIDI_MASK_SEPARATOR + FRIBIDI_MASK_SS )
-/* Whitespace */
-#define FRIBIDI_TYPE_WS_VAL	( FRIBIDI_MASK_NEUTRAL + FRIBIDI_MASK_SPACE \
-				+ FRIBIDI_MASK_WS )
+/* Block Separator */
+#define FRIBIDI_TYPE_BS_VAL	( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
+				| FRIBIDI_MASK_SEPARATOR | FRIBIDI_MASK_BS )
+/* Segment Separator */
+#define FRIBIDI_TYPE_SS_VAL	( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
+				| FRIBIDI_MASK_SEPARATOR | FRIBIDI_MASK_SS )
+/* WhiteSpace */
+#define FRIBIDI_TYPE_WS_VAL	( FRIBIDI_MASK_NEUTRAL | FRIBIDI_MASK_SPACE \
+				| FRIBIDI_MASK_WS )
 /* Other Neutral */
 #define FRIBIDI_TYPE_ON_VAL	( FRIBIDI_MASK_NEUTRAL )
 
 
 /* The following are used in specifying paragraph direction only. */
 
-/* Weak left to right */
+/* Weak Left-To-Right */
 #define FRIBIDI_TYPE_WLTR_VAL	( FRIBIDI_MASK_WEAK )
-/* Weak right to left */
-#define FRIBIDI_TYPE_WRTL_VAL	( FRIBIDI_MASK_WEAK + FRIBIDI_MASK_RTL )
+/* Weak Right-To-Left */
+#define FRIBIDI_TYPE_WRTL_VAL	( FRIBIDI_MASK_WEAK | FRIBIDI_MASK_RTL )
 
-/* Start or end of text (run list).  Only used internally */
+/* start or end of text (run list) SENTINEL.  Only used internally */
 #define FRIBIDI_TYPE_SENTINEL	( FRIBIDI_MASK_SENTINEL )
 
 /* Private types for applications.  More private types can be obtained by
  * summing up from this one. */
 #define FRIBIDI_TYPE_PRIVATE	( FRIBIDI_MASK_PRIVATE )
 
-/* Define values for FriBidiCharType. */
 
 /* Define Enums only if sizeof(int) == 4 (UTF-32), and not compiling C++.
  * The problem with C++ is that then casts between int32 and enum will fail!
@@ -334,9 +329,6 @@
 
 /* Functions finally */
 
-/* fribidi_type_name is the old name of fribidi_bidi_type_name */
-#define fribidi_type_name fribidi_bidi_type_name
-
 #define fribidi_bidi_type_name FRIBIDI_NAMESPACE(bidi_type_name)
 /* fribidi_bidi_type_name - get bidi type name
  *

--- NEW FILE: fribidi-joining-type.c ---
/* 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: /cvs/fribidi/fribidi/lib/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 at 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);
}

--- NEW FILE: fribidi-joining-type.h ---
/* 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: /cvs/fribidi/fribidi/lib/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 at 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
 */

--- NEW FILE: fribidi-joining-types-list.h ---
#ifndef __FRIBIDI_DOC
/* FriBidi
 * fribidi-joining-types-list.h - list of joining types
 *
 * $Id: fribidi-joining-types-list.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: /cvs/fribidi/fribidi/lib/fribidi-joining-types-list.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 at farsiweb.info>.
 */
/* *INDENT-OFF* */
#endif /* !__FRIBIDI_DOC */
#ifndef _FRIBIDI_ADD_TYPE
# define _FRIBIDI_ADD_TYPE(x,y)
#endif

_FRIBIDI_ADD_TYPE (U, '|')	/* nUn-joining, e.g. Full Stop */
_FRIBIDI_ADD_TYPE (R, '>')	/* Right-joining, e.g. Arabic Letter Dal */
_FRIBIDI_ADD_TYPE (D, '+')	/* Dual-joining, e.g. Arabic Letter Ain */
_FRIBIDI_ADD_TYPE (C, '-')	/* join-Causing, e.g. Tatweel, ZWJ */
_FRIBIDI_ADD_TYPE (T, '^')	/* Transparent, e.g. Arabic Fatha */
_FRIBIDI_ADD_TYPE (L, '<')	/* Left-joining, i.e. fictional */
_FRIBIDI_ADD_TYPE (G, '~')	/* iGnored, e.g. LRE, RLE, ZWNBSP */

#ifndef __FRIBIDI_DOC
/* *INDENT-ON* */
#endif /* !__FRIBIDI_DOC */

--- NEW FILE: fribidi-joining-types.c ---
/* FriBidi
 * fribidi-joining-types.c - character joining types
 *
 * $Id: fribidi-joining-types.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: /cvs/fribidi/fribidi/lib/fribidi-joining-types.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 at farsiweb.info>.
 */

#include "common.h"

#include <fribidi-joining-types.h>

#include "joining-types.h"

#ifdef DEBUG

char
fribidi_char_from_joining_type (
  /* input */
  FriBidiJoiningType j
)
{
  switch (j)
    {
#   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 '?';
    }
}

#endif

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 STRINGIZE(TYPE);
#   include "fribidi-joining-types-list.h"
#   undef _FRIBIDI_ADD_TYPE
    default:
      return "?";
    }
}

/* Editor directions:
 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
 */

--- NEW FILE: fribidi-joining-types.h ---
/* FriBidi
 * fribidi-joining-types.h - character joining types
 *
 * $Id: fribidi-joining-types.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: /cvs/fribidi/fribidi/lib/fribidi-joining-types.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 at farsiweb.info>.
 */
#ifndef _FRIBIDI_JOINING_TYPES_H
#define _FRIBIDI_JOINING_TYPES_H

#include "fribidi-common.h"

#include "fribidi-types.h"

#include "fribidi-begindecls.h"

/* 
 * Define bit masks that joining types are based on, each mask has
 * only one bit set.
 */

#define FRIBIDI_MASK_JOINS_RIGHT	0x01	/* May join to right */
#define FRIBIDI_MASK_JOINS_LEFT		0x02	/* May join to right */
#define FRIBIDI_MASK_ARAB_SHAPES	0x04	/* May Arabic shape */
#define FRIBIDI_MASK_TRANSPARENT	0x10	/* Is transparent */
#define FRIBIDI_MASK_IGNORED		0x20	/* Is ignored */
#define FRIBIDI_MASK_LIGATURED		0x40	/* Is ligatured */

/*
 * Define values for FriBidiJoiningType
 */

/* nUn-joining */
#define FRIBIDI_JOINING_TYPE_U_VAL	( 0 )

/* Right-joining */
#define FRIBIDI_JOINING_TYPE_R_VAL	\
	( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_ARAB_SHAPES )

/* Dual-joining */
#define FRIBIDI_JOINING_TYPE_D_VAL	\
	( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT \
	| FRIBIDI_MASK_ARAB_SHAPES )

/* join-Causing */
#define FRIBIDI_JOINING_TYPE_C_VAL	\
	( FRIBIDI_MASK_JOINS_RIGHT | FRIBIDI_MASK_JOINS_LEFT )

/* Left-joining */
#define FRIBIDI_JOINING_TYPE_L_VAL	\
	( FRIBIDI_MASK_JOINS_LEFT | FRIBIDI_MASK_ARAB_SHAPES )

/* Transparent */
#define FRIBIDI_JOINING_TYPE_T_VAL	\
	( FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_ARAB_SHAPES )

/* iGnored */
#define FRIBIDI_JOINING_TYPE_G_VAL	( FRIBIDI_MASK_IGNORED )


enum _FriBidiJoiningTypeEnum
{
# define _FRIBIDI_ADD_TYPE(TYPE,SYMBOL) \
	FRIBIDI_JOINING_TYPE_##TYPE = FRIBIDI_JOINING_TYPE_##TYPE##_VAL,
# include "fribidi-joining-types-list.h"
# undef _FRIBIDI_ADD_TYPE
  _FRIBIDI_JOINING_TYPE_JUNK	/* Don't use this */
};

#ifdef __FRIBIDI_DOC
typedef enum _FriBidiJoiningTypeEnum FriBidiJoiningType;
#else /* !__FRIBIDI_DOC */
typedef fribidi_uint8 FriBidiJoiningType;
#endif /* !__FRIBIDI_DOC */


/*
 * Defining macros for needed queries, It is fully dependent on the 
 * implementation of FriBidiJoiningType.
 */

/* Joins to right? */
#define FRIBIDI_JOINS_RIGHT(p)	((p) & FRIBIDI_MASK_JOINS_RIGHT)

/* Joins to left? */
#define FRIBIDI_JOINS_LEFT(p)	((p) & FRIBIDI_MASK_JOINS_LEFT)

/* Joins to left? */
#define FRIBIDI_ARAB_SHAPES(p)	((p) & FRIBIDI_MASK_ARAB_SHAPES)

/* Is transparent in joining? */
#define FRIBIDI_IS_JOIN_TRANSPARENT(p)	((p) & FRIBIDI_MASK_TRANSPARENT)

/* Is ignored in joining? */
#define FRIBIDI_IS_JOIN_IGNORED(p)	((p) & FRIBIDI_MASK_IGNORED)

/* Is skipped in joining? */
#define FRIBIDI_IS_JOIN_SKIPPED(p)	\
	((p) & (FRIBIDI_MASK_TRANSPARENT | FRIBIDI_MASK_IGNORED))


#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 (
  FriBidiJoiningType j		/* input joining type */
) FRIBIDI_GNUC_CONST;

#include "fribidi-enddecls.h"

#endif /* !_FRIBIDI_JOINING_TYPES_H */
/* Editor directions:
 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
 */

--- NEW FILE: fribidi-joining.c ---

--- NEW FILE: fribidi-joining.h ---
/* FriBidi
 * fribidi-joining.h - Arabic joining algorithm
 *
 * $Id: fribidi-joining.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: /cvs/fribidi/fribidi/lib/fribidi-joining.h,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 at farsiweb.info>.
 */
#ifndef _FRIBIDI_JOINING_H
#define _FRIBIDI_JOINING_H

#include "fribidi-common.h"

#include "fribidi-types.h"
#include "fribidi-joining-types.h"

#include "fribidi-begindecls.h"



#include "fribidi-enddecls.h"

#endif /* !_FRIBIDI_JOINING_H */
/* Editor directions:
 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
 */

Index: fribidi-mirroring.c
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi-mirroring.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fribidi-mirroring.c	9 Jun 2004 20:01:00 -0000	1.10
+++ fribidi-mirroring.c	13 Jun 2004 20:11:42 -0000	1.11
@@ -49,10 +49,10 @@
 )
 {
   register FriBidiChar result;
-  result = FRIBIDI_GET_MIRRORING_DELTA (ch);
+  result = FRIBIDI_GET_MIRRORING (ch);
   if (mirrored_ch)
-    *mirrored_ch = ch + result;
-  return result ? true : false;
+    *mirrored_ch = result;
+  return ch != result ? true : false;
 }
 
 /* Editor directions:

Index: fribidi.def
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/fribidi.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fribidi.def	9 Jun 2004 14:59:21 -0000	1.4
+++ fribidi.def	13 Jun 2004 20:11:42 -0000	1.5
@@ -1,9 +1,12 @@
-fribidi_bidi_type_name
 fribidi_get_bidi_type
-fribidi_log2vis
+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_get_mirror_char
+fribidi_log2vis
 fribidi_debug_status
 fribidi_set_debug
 fribidi_mirroring_status

--- NEW FILE: joining-types.h ---
/* FriBidi
 * joining-types.h - define internal joining types
 *
 * $Id: joining-types.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: /cvs/fribidi/fribidi/lib/joining-types.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 at farsiweb.info>.
 */
#ifndef _JOINING_TYPES_H
#define _JOINING_TYPES_H

#include "common.h"

#include <fribidi-types.h>
#include <fribidi-joining-types.h>

#include <fribidi-begindecls.h>

#if DEBUG

#define fribidi_char_from_joining_type FRIBIDI_PRIVATESPACE(char_from_joining_type)
char
fribidi_char_from_joining_type (
  FriBidiJoiningType j		/* input joining type */
) FRIBIDI_GNUC_HIDDEN;

#endif /* DEBUG */

#include <fribidi-enddecls.h>

#endif /* !_JOINING_TYPES_H */
/* Editor directions:
 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
 */

Index: run.h
===================================================================
RCS file: /cvs/fribidi/fribidi/lib/run.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- run.h	4 Jun 2004 16:43:51 -0000	1.4
+++ run.h	13 Jun 2004 20:11:42 -0000	1.5
@@ -44,7 +44,9 @@
 
 #include <fribidi-begindecls.h>
 
-struct _FriBidiRun
+typedef struct _FriBidiRunStruct FriBidiRun;
+
+struct _FriBidiRunStruct
 {
   FriBidiRun *prev;
   FriBidiRun *next;




More information about the FriBidi-Commit mailing list