summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2021-08-17 18:40:44 +0200
committerMatthias Clasen <mclasen@redhat.com>2021-08-18 00:03:22 -0400
commitec5b05649e9816765e942100ede9e0cb3fb6e794 (patch)
tree3de1b2c096a82289a2f289161498b6a1a089b575
parent4a54dcb8ab1f0316e400fa59a2600080bb2e16ef (diff)
downloadpango-ec5b05649e9816765e942100ede9e0cb3fb6e794.tar.gz
bidi: Cleanup FriBiDi API usage
Since FriBiDi 1.x is now required, we can remove use of pre-1.x API.
-rw-r--r--pango/pango-bidi-type.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c
index f978d8e5..32858f7e 100644
--- a/pango/pango-bidi-type.c
+++ b/pango/pango-bidi-type.c
@@ -30,10 +30,6 @@
#include "pango-bidi-type.h"
#include "pango-utils.h"
-#if FRIBIDI_MAJOR_VERSION >= 1
-#define USE_FRIBIDI_EX_API
-#endif
-
/**
* pango_bidi_type_for_unichar:
* @ch: a Unicode character
@@ -122,9 +118,7 @@ pango_log2vis_get_embedding_levels (const gchar *text,
const gchar *p;
FriBidiParType fribidi_base_dir;
FriBidiCharType *bidi_types;
-#ifdef USE_FRIBIDI_EX_API
FriBidiBracketType *bracket_types;
-#endif
FriBidiLevel max_level;
FriBidiCharType ored_types = 0;
FriBidiCharType anded_strongs = FRIBIDI_TYPE_RLE;
@@ -158,9 +152,7 @@ pango_log2vis_get_embedding_levels (const gchar *text,
n_chars = g_utf8_strlen (text, length);
bidi_types = g_new (FriBidiCharType, n_chars);
-#ifdef USE_FRIBIDI_EX_API
bracket_types = g_new (FriBidiBracketType, n_chars);
-#endif
embedding_levels_list = g_new (guint8, n_chars);
for (i = 0, p = text; p < text + length; p = g_utf8_next_char(p), i++)
@@ -175,12 +167,10 @@ pango_log2vis_get_embedding_levels (const gchar *text,
ored_types |= char_type;
if (FRIBIDI_IS_STRONG (char_type))
anded_strongs &= char_type;
-#ifdef USE_FRIBIDI_EX_API
if (G_UNLIKELY(bidi_types[i] == FRIBIDI_TYPE_ON))
bracket_types[i] = fribidi_get_bracket (ch);
else
bracket_types[i] = FRIBIDI_NO_BRACKET;
-#endif
}
/* Short-circuit (malloc-expensive) FriBidi call for unidirectional
@@ -190,9 +180,6 @@ pango_log2vis_get_embedding_levels (const gchar *text,
* https://bugzilla.gnome.org/show_bug.cgi?id=590183
*/
-#ifndef FRIBIDI_IS_ISOLATE
-#define FRIBIDI_IS_ISOLATE(x) 0
-#endif
/* The case that all resolved levels will be ltr.
* No isolates, all strongs be LTR, there should be no Arabic numbers
* (or letters for that matter), and one of the following:
@@ -235,15 +222,9 @@ pango_log2vis_get_embedding_levels (const gchar *text,
}
-#ifdef USE_FRIBIDI_EX_API
max_level = fribidi_get_par_embedding_levels_ex (bidi_types, bracket_types, n_chars,
&fribidi_base_dir,
(FriBidiLevel*)embedding_levels_list);
-#else
- max_level = fribidi_get_par_embedding_levels (bidi_types, n_chars,
- &fribidi_base_dir,
- (FriBidiLevel*)embedding_levels_list);
-#endif
if (G_UNLIKELY(max_level == 0))
{
@@ -253,10 +234,7 @@ pango_log2vis_get_embedding_levels (const gchar *text,
resolved:
g_free (bidi_types);
-
-#ifdef USE_FRIBIDI_EX_API
g_free (bracket_types);
-#endif
*pbase_dir = (fribidi_base_dir == FRIBIDI_PAR_LTR) ? PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL;