Evas font-engine: Moved bidi utils (and added script utils) to a subdir language...
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:35:37 +0000 (10:35 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:35:37 +0000 (10:35 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@56446 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

12 files changed:
src/lib/canvas/evas_object_textblock.c
src/lib/engines/common/Makefile.am
src/lib/engines/common/evas_font.h
src/lib/engines/common/evas_font_draw.c
src/lib/engines/common/evas_font_query.c
src/lib/engines/common/evas_pipe.h
src/lib/engines/common/language/evas_bidi_utils.c [moved from src/lib/engines/common/evas_bidi_utils.c with 100% similarity]
src/lib/engines/common/language/evas_bidi_utils.h [moved from src/lib/engines/common/evas_bidi_utils.h with 100% similarity]
src/lib/engines/common/language/evas_script_utils.c [new file with mode: 0644]
src/lib/engines/common/language/evas_script_utils.h [new file with mode: 0644]
src/lib/include/evas_common.h
src/lib/include/evas_private.h

index 6558b18..6c196bc 100644 (file)
@@ -2477,9 +2477,13 @@ _layout_text_add_and_split_item(Ctxt *c, Evas_Object_Textblock_Format *fmt,
    do
      {
         Evas_Object_Textblock_Text_Item *new_ti;
+        /* FIXME: We assume here that it's ok to have an empty item with
+         * no text nodes, make sure it's the case. */
         if (ti->parent.text_node)
           {
-             cutoff = evas_bidi_end_of_run_get(ti->parent.text_node->bidi_props,
+             cutoff = evas_common_script_end_of_run_get(
+                   eina_ustrbuf_string_get(ti->parent.text_node->unicode),
+                   ti->parent.text_node->bidi_props,
                    ti->parent.text_pos, len);
              if (cutoff > 0)
                {
index 00fbb06..170f5fb 100644 (file)
@@ -59,7 +59,8 @@ evas_scale_span.c \
 evas_tiler.c \
 evas_regionbuf.c \
 evas_pipe.c \
-evas_bidi_utils.c \
+language/evas_bidi_utils.c \
+language/evas_script_utils.c \
 evas_map_image.c \
 evas_map_image.h
 
@@ -98,7 +99,8 @@ evas_scale_smooth_scaler_noscale.c \
 evas_scale_smooth_scaler_up.c \
 evas_scale_span.h \
 evas_pipe.h \
-evas_bidi_utils.h \
+language/evas_bidi_utils.h \
+language/evas_script_utils.h \
 evas_map_image_internal.c \
 evas_map_image_core.c \
 evas_map_image_loop.c
index 5dd93e1..b96f437 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef _EVAS_FONT_H
 #define _EVAS_FONT_H
-#include "evas_bidi_utils.h"
+#include "language/evas_bidi_utils.h"
 
 
 /* main */
index d02c26f..23e92ad 100644 (file)
@@ -2,7 +2,7 @@
 #include "evas_private.h"
 #include "evas_blend_private.h"
 
-#include "evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
+#include "language/evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
 #include "evas_font_private.h" /* for Frame-Queuing support */
 
 #define WORD_CACHE_MAXLEN      50
index b707474..8d80673 100644 (file)
@@ -1,5 +1,5 @@
 #include "evas_common.h"
-#include "evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
+#include "language/evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
 #include "evas_font_private.h" /* for Frame-Queuing support */
 
 EAPI int
index e658e1f..5ee8eed 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef _EVAS_PIPE_H
 #define _EVAS_PIPE_H
-#include "evas_bidi_utils.h"
+#include "language/evas_bidi_utils.h"
 
 #ifdef BUILD_PTHREAD
 typedef struct _Thinfo
similarity index 100%
rename from src/lib/engines/common/evas_bidi_utils.h
rename to src/lib/engines/common/language/evas_bidi_utils.h
index ac89799..37266c6 100644 (file)
@@ -26,7 +26,6 @@
 #endif
 
 #include <Eina.h>
-#include "evas_common.h"
 
 #ifdef USE_FRIBIDI
 # include <fribidi/fribidi.h>
@@ -75,6 +74,7 @@ struct _Evas_BiDi_Paragraph_Props {
 #endif
 };
 
+#include "evas_common.h"
 struct _Evas_BiDi_Props {
    Evas_BiDi_Direction  dir;
 };
diff --git a/src/lib/engines/common/language/evas_script_utils.c b/src/lib/engines/common/language/evas_script_utils.c
new file mode 100644 (file)
index 0000000..a5711ac
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * @internal
+ * @addtogroup Evas_Utils
+ *
+ * @{
+ */
+/**
+ * @internal
+ * @defgroup Evas_Script Evas Script (language) utility functions
+ *
+ * This set of functions and types helps evas handle scripts correctly.
+ * @todo Document types, structures and macros.
+ *
+ * @{
+ */
+#include <Eina.h>
+
+#include "evas_script_utils.h"
+#include "evas_bidi_utils.h" /* Used for fallback. */
+int
+evas_common_script_end_of_run_get(const Eina_Unicode *str,
+      const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, int len)
+{
+   /* FIXME: Currently we fall back to bidi runs, should fix */
+   (void) str;
+#ifdef BIDI_SUPPORT
+   return evas_bidi_end_of_run_get(bidi_props, start, len);
+#else
+   (void) bidi_props;
+   return 0;
+#endif
+}
+
+/*
+ * @}
+ */
+/*
+ * @}
+ */
+
diff --git a/src/lib/engines/common/language/evas_script_utils.h b/src/lib/engines/common/language/evas_script_utils.h
new file mode 100644 (file)
index 0000000..4ee70bf
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _EVAS_SCRIPT_UTILS
+#define _EVAS_SCRIPT_UTILS
+
+#include <Eina.h>
+#include "evas_bidi_utils.h"
+
+int
+evas_common_script_end_of_run_get(const Eina_Unicode *str, const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, int len);
+
+#endif
+
index bd9b44f..fa15f5a 100644 (file)
@@ -688,7 +688,7 @@ struct _RGBA_Draw_Context
 
 #ifdef BUILD_PIPE_RENDER
 #include "../engines/common/evas_map_image.h"
-#include "../engines/common/evas_bidi_utils.h"
+#include "../engines/common/language/evas_bidi_utils.h"
 
 struct _RGBA_Pipe_Op
 {
index 6b839a2..c81ca8f 100644 (file)
@@ -11,7 +11,8 @@
 
 #include "../file/evas_module.h"
 #include "../file/evas_path.h"
-#include "../engines/common/evas_bidi_utils.h"
+#include "../engines/common/language/evas_bidi_utils.h"
+#include "../engines/common/language/evas_script_utils.h"
 
 #ifdef EVAS_MAGIC_DEBUG
 /* complain when peole pass in wrong object types etc. */