From 7507ad3e1816f3bc9004dceb39bb303804287438 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 30 Aug 2024 04:15:36 +0200 Subject: Unicode support for the Q-Register commands (refs #5) * this required adding several Q-Register vtable methods * it should still be investigated whether the repeated calling of SCI_ALLOCATELINECHARACTERINDEX causes any overhead. --- src/interface.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/interface.h') diff --git a/src/interface.h b/src/interface.h index 6a391aa..c975525 100644 --- a/src/interface.h +++ b/src/interface.h @@ -154,16 +154,30 @@ void teco_interface_process_notify(SCNotification *notify); /** @pure */ void teco_interface_cleanup(void); +static inline gssize +teco_glyphs2bytes(teco_int_t pos) +{ + return teco_view_glyphs2bytes(teco_interface_current_view, pos); +} + +static inline teco_int_t +teco_bytes2glyphs(gsize pos) +{ + return teco_view_bytes2glyphs(teco_interface_current_view, pos); +} + +static inline gssize +teco_glyphs2bytes_relative(gsize pos, teco_int_t n) +{ + return teco_view_glyphs2bytes_relative(teco_interface_current_view, pos, n); +} + /* * The following functions are here for lack of a better place. * They could also be in sciteco.h, but only if declared as non-inline * since sciteco.h should not depend on interface.h. */ -gssize teco_glyphs2bytes(teco_int_t pos); -teco_int_t teco_bytes2glyphs(gsize pos); -gssize teco_glyphs2bytes_relative(gsize pos, teco_int_t n); - static inline gboolean teco_validate_line(teco_int_t n) { -- cgit v1.2.3