diff options
Diffstat (limited to 'src/interface.h')
-rw-r--r-- | src/interface.h | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/interface.h b/src/interface.h index 3170849..32db6b5 100644 --- a/src/interface.h +++ b/src/interface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2023 Robin Haberkorn + * Copyright (C) 2012-2024 Robin Haberkorn * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,6 +154,36 @@ void teco_interface_process_notify(SCNotification *notify); /** @pure */ void teco_interface_cleanup(void); +static inline guint +teco_interface_get_codepage(void) +{ + return teco_view_get_codepage(teco_interface_current_view); +} + +static inline gssize +teco_interface_glyphs2bytes(teco_int_t pos) +{ + return teco_view_glyphs2bytes(teco_interface_current_view, pos); +} + +static inline teco_int_t +teco_interface_bytes2glyphs(gsize pos) +{ + return teco_view_bytes2glyphs(teco_interface_current_view, pos); +} + +static inline gssize +teco_interface_glyphs2bytes_relative(gsize pos, teco_int_t n) +{ + return teco_view_glyphs2bytes_relative(teco_interface_current_view, pos, n); +} + +static inline teco_int_t +teco_interface_get_character(gsize pos, gsize len) +{ + return teco_view_get_character(teco_interface_current_view, pos, len); +} + /* * 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 @@ -161,12 +191,6 @@ void teco_interface_cleanup(void); */ static inline gboolean -teco_validate_pos(teco_int_t n) -{ - return 0 <= n && n <= teco_interface_ssm(SCI_GETLENGTH, 0, 0); -} - -static inline gboolean teco_validate_line(teco_int_t n) { return 0 <= n && n < teco_interface_ssm(SCI_GETLINECOUNT, 0, 0); |