aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/unix/graphemes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libui_sdl/libui/unix/graphemes.c')
-rw-r--r--src/libui_sdl/libui/unix/graphemes.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/libui_sdl/libui/unix/graphemes.c b/src/libui_sdl/libui/unix/graphemes.c
deleted file mode 100644
index a2c47b7..0000000
--- a/src/libui_sdl/libui/unix/graphemes.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// 25 may 2016
-#include "uipriv_unix.h"
-
-ptrdiff_t *graphemes(const char *text, PangoContext *context)
-{
- size_t len, lenchars;
- PangoLogAttr *logattrs;
- ptrdiff_t *out;
- ptrdiff_t *op;
- size_t i;
-
- len = strlen(text);
- lenchars = g_utf8_strlen(text, -1);
- logattrs = (PangoLogAttr *) uiAlloc((lenchars + 1) * sizeof (PangoLogAttr), "PangoLogAttr[]");
- pango_get_log_attrs(text, len,
- -1, NULL,
- logattrs, lenchars + 1);
-
- // should be more than enough
- out = (ptrdiff_t *) uiAlloc((lenchars + 2) * sizeof (ptrdiff_t), "ptrdiff_t[]");
- op = out;
- for (i = 0; i < lenchars; i++)
- if (logattrs[i].is_cursor_position != 0)
- // TODO optimize this
- *op++ = g_utf8_offset_to_pointer(text, i) - text;
- // and do the last one
- *op++ = len;
-
- uiFree(logattrs);
- return out;
-}