chiark / gitweb /
shared: utf8 - support ucs4 -> utf8
[elogind.git] / src / libsystemd-terminal / term.h
index a3ca252..1a78a81 100644 (file)
@@ -97,6 +97,8 @@ struct term_attr {
         unsigned int hidden : 1;                /* hidden */
 };
 
+void term_attr_to_argb32(const term_attr *attr, uint32_t *fg, uint32_t *bg, const uint8_t *palette);
+
 /*
  * UTF-8
  */
@@ -110,7 +112,6 @@ struct term_utf8 {
         unsigned int valid : 1;
 };
 
-size_t term_utf8_encode(char *out_utf8, uint32_t g);
 size_t term_utf8_decode(term_utf8 *p, uint32_t **out_buf, char c);
 
 /*
@@ -128,6 +129,21 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(term_parser*, term_parser_free);
  * Screens
  */
 
+enum {
+        TERM_KBDMOD_IDX_SHIFT,
+        TERM_KBDMOD_IDX_CTRL,
+        TERM_KBDMOD_IDX_ALT,
+        TERM_KBDMOD_IDX_LINUX,
+        TERM_KBDMOD_IDX_CAPS,
+        TERM_KBDMOD_CNT,
+
+        TERM_KBDMOD_SHIFT               = 1 << TERM_KBDMOD_IDX_SHIFT,
+        TERM_KBDMOD_CTRL                = 1 << TERM_KBDMOD_IDX_CTRL,
+        TERM_KBDMOD_ALT                 = 1 << TERM_KBDMOD_IDX_ALT,
+        TERM_KBDMOD_LINUX               = 1 << TERM_KBDMOD_IDX_LINUX,
+        TERM_KBDMOD_CAPS                = 1 << TERM_KBDMOD_IDX_CAPS,
+};
+
 typedef int (*term_screen_write_fn) (term_screen *screen, void *userdata, const void *buf, size_t size);
 typedef int (*term_screen_cmd_fn) (term_screen *screen, void *userdata, unsigned int cmd, const term_seq *seq);
 
@@ -139,9 +155,15 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(term_screen*, term_screen_unref);
 
 unsigned int term_screen_get_width(term_screen *screen);
 unsigned int term_screen_get_height(term_screen *screen);
+uint64_t term_screen_get_age(term_screen *screen);
 
 int term_screen_feed_text(term_screen *screen, const uint8_t *in, size_t size);
-int term_screen_feed_keyboard(term_screen *screen, uint32_t keysym, uint32_t ascii, uint32_t ucs4, unsigned int mods);
+int term_screen_feed_keyboard(term_screen *screen,
+                              const uint32_t *keysyms,
+                              size_t n_syms,
+                              uint32_t ascii,
+                              const uint32_t *ucs4,
+                              unsigned int mods);
 int term_screen_resize(term_screen *screen, unsigned int width, unsigned int height);
 void term_screen_soft_reset(term_screen *screen);
 void term_screen_hard_reset(term_screen *screen);