aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses/curses-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface-curses/curses-utils.h')
-rw-r--r--src/interface-curses/curses-utils.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/interface-curses/curses-utils.h b/src/interface-curses/curses-utils.h
index a91ab44..2c819ee 100644
--- a/src/interface-curses/curses-utils.h
+++ b/src/interface-curses/curses-utils.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
@@ -20,6 +20,17 @@
#include <curses.h>
-gsize teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width);
+guint teco_curses_format_str(WINDOW *win, const gchar *str, gsize len, gint max_width);
-gsize teco_curses_format_filename(WINDOW *win, const gchar *filename, gint max_width);
+guint teco_curses_format_filename(WINDOW *win, const gchar *filename, gint max_width);
+
+/**
+ * Add Unicode character to window.
+ * This is just like wadd_wch(), but does not require wide-char APIs.
+ */
+static inline void
+teco_curses_add_wc(WINDOW *win, gunichar chr)
+{
+ gchar buf[6];
+ waddnstr(win, buf, g_unichar_to_utf8(chr, buf));
+}