gdk: Add a copy of pango_unichar_direction

This api has been deprecated in pango.
This commit is contained in:
Matthias Clasen 2019-01-31 14:03:49 -05:00 committed by Jakub Steiner
parent 3e5a7bb898
commit 8c973bd837
2 changed files with 21 additions and 0 deletions

View File

@ -41,6 +41,8 @@
#include <string.h>
#include <stdlib.h>
#include <fribidi.h>
/**
* SECTION:general
@ -1113,3 +1115,20 @@ gdk_disable_multidevice (void)
_gdk_disable_multidevice = TRUE;
}
PangoDirection
gdk_unichar_direction (gunichar ch)
{
FriBidiCharType fribidi_ch_type;
G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
fribidi_ch_type = fribidi_get_bidi_type (ch);
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
return PANGO_DIRECTION_NEUTRAL;
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
return PANGO_DIRECTION_RTL;
else
return PANGO_DIRECTION_LTR;
}

View File

@ -558,6 +558,8 @@ cairo_surface_t * _gdk_offscreen_window_create_surface (GdkWindow *window,
gint width,
gint height);
PangoDirection gdk_unichar_direction (gunichar ch);
G_END_DECLS
#endif /* __GDK_INTERNALS_H__ */