From dcebf9c7f954a55350b68d0ead1935612c4e2e05 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Thu, 15 Oct 2026 13:04:01 +0300 Subject: Rename the library to wsap_vtcore ncurses installs and defines struct term. In a file that includes both headers, an ncurses TERMINAL * and this library's terminal are silently the same type. The name wsap_vtcore avoids the clash. The public header is now . Every global symbol uses the wsap_vtcore_ prefix, every macro uses WSAP_VTCORE_, and the shared library is libwsap_vtcore.so.0. The default terminal name is now "wsap_vtcore". The ISA override variable is WSAP_VTCORE_ISA. No other behavior changes. The amalgamation writes wsap_vtcore.c and wsap_vtcore.h. Co-Authored-By: Claude Haiku 5.5 --- include/term/term_input.h | 202 ---------------------------------------------- 1 file changed, 202 deletions(-) delete mode 100644 include/term/term_input.h (limited to 'include/term/term_input.h') diff --git a/include/term/term_input.h b/include/term/term_input.h deleted file mode 100644 index 19d9355..0000000 --- a/include/term/term_input.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifndef TERM_INPUT_H -#define TERM_INPUT_H - -#include -#include -#include -#include "term_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum term_key { - TERM_KEY_NONE = 0, - - TERM_KEY_RETURN, - TERM_KEY_BACKSPACE, - TERM_KEY_TAB, - TERM_KEY_ESCAPE, - - TERM_KEY_UP, - TERM_KEY_DOWN, - TERM_KEY_RIGHT, - TERM_KEY_LEFT, - TERM_KEY_HOME, - TERM_KEY_END, - TERM_KEY_PAGE_UP, - TERM_KEY_PAGE_DOWN, - TERM_KEY_INSERT, - TERM_KEY_DELETE, - - TERM_KEY_F1, TERM_KEY_F2, TERM_KEY_F3, TERM_KEY_F4, TERM_KEY_F5, - TERM_KEY_F6, TERM_KEY_F7, TERM_KEY_F8, TERM_KEY_F9, TERM_KEY_F10, - TERM_KEY_F11, TERM_KEY_F12, TERM_KEY_F13, TERM_KEY_F14, TERM_KEY_F15, - TERM_KEY_F16, TERM_KEY_F17, TERM_KEY_F18, TERM_KEY_F19, TERM_KEY_F20, - TERM_KEY_F21, TERM_KEY_F22, TERM_KEY_F23, TERM_KEY_F24, TERM_KEY_F25, - TERM_KEY_F26, TERM_KEY_F27, TERM_KEY_F28, TERM_KEY_F29, TERM_KEY_F30, - TERM_KEY_F31, TERM_KEY_F32, TERM_KEY_F33, TERM_KEY_F34, TERM_KEY_F35, - - TERM_KEY_KP_0, TERM_KEY_KP_1, TERM_KEY_KP_2, TERM_KEY_KP_3, TERM_KEY_KP_4, - TERM_KEY_KP_5, TERM_KEY_KP_6, TERM_KEY_KP_7, TERM_KEY_KP_8, TERM_KEY_KP_9, - TERM_KEY_KP_DECIMAL, - TERM_KEY_KP_ENTER, - TERM_KEY_KP_ADD, - TERM_KEY_KP_SUBTRACT, - TERM_KEY_KP_MULTIPLY, - TERM_KEY_KP_DIVIDE, - TERM_KEY_KP_EQUAL, - TERM_KEY_KP_SEPARATOR, - TERM_KEY_KP_LEFT, - TERM_KEY_KP_RIGHT, - TERM_KEY_KP_UP, - TERM_KEY_KP_DOWN, - TERM_KEY_KP_PAGE_UP, - TERM_KEY_KP_PAGE_DOWN, - TERM_KEY_KP_HOME, - TERM_KEY_KP_END, - TERM_KEY_KP_INSERT, - TERM_KEY_KP_DELETE, - TERM_KEY_KP_BEGIN, - - TERM_KEY_CAPS_LOCK, - TERM_KEY_SCROLL_LOCK, - TERM_KEY_NUM_LOCK, - TERM_KEY_PRINT_SCREEN, - TERM_KEY_PAUSE, - TERM_KEY_MENU, - - TERM_KEY_MEDIA_PLAY, - TERM_KEY_MEDIA_PAUSE, - TERM_KEY_MEDIA_STOP, - TERM_KEY_MEDIA_FORWARD, - TERM_KEY_MEDIA_REWIND, - TERM_KEY_MEDIA_NEXT, - TERM_KEY_MEDIA_PREV, - TERM_KEY_MEDIA_RECORD, - TERM_KEY_VOLUME_DOWN, - TERM_KEY_VOLUME_UP, - TERM_KEY_MUTE, - - TERM_KEY_LSHIFT, - TERM_KEY_LCTRL, - TERM_KEY_LALT, - TERM_KEY_LSUPER, - TERM_KEY_LHYPER, - TERM_KEY_LMETA, - TERM_KEY_RSHIFT, - TERM_KEY_RCTRL, - TERM_KEY_RALT, - TERM_KEY_RSUPER, - TERM_KEY_RHYPER, - TERM_KEY_RMETA, - TERM_KEY_ISO_LEVEL3_SHIFT, - TERM_KEY_ISO_LEVEL5_SHIFT, - - TERM_KEY_COUNT -}; - -enum term_mod { - TERM_MOD_SHIFT = 1, - TERM_MOD_ALT = 2, - TERM_MOD_CTRL = 4, - TERM_MOD_SUPER = 8, - TERM_MOD_HYPER = 16, - TERM_MOD_META = 32, - TERM_MOD_CAPS = 64, - TERM_MOD_NUM = 128, -}; - -enum term_key_action { - TERM_KEY_PRESS = 1, - TERM_KEY_REPEAT = 2, - TERM_KEY_RELEASE = 3, -}; - -enum term_mouse_button { - TERM_MOUSE_BUTTON_PRIMARY = 0, - TERM_MOUSE_BUTTON_MIDDLE, - TERM_MOUSE_BUTTON_SECONDARY, - TERM_MOUSE_BUTTON_NONE, - /* Extra buttons 8 through 11 in xterm mouse reporting (encoded as 128..131). */ - TERM_MOUSE_BUTTON_EXTRA_1, - TERM_MOUSE_BUTTON_EXTRA_2, - TERM_MOUSE_BUTTON_EXTRA_3, - TERM_MOUSE_BUTTON_EXTRA_4, - TERM_MOUSE_WHEEL_UP = 16, - TERM_MOUSE_WHEEL_DOWN, - TERM_MOUSE_WHEEL_LEFT, - TERM_MOUSE_WHEEL_RIGHT, -}; - -enum term_mouse_event_kind { - TERM_MOUSE_PRESS = 0, - TERM_MOUSE_RELEASE, - TERM_MOUSE_MOTION, - TERM_MOUSE_SCROLL, - TERM_MOUSE_LEAVE, -}; - -struct term_key_event { - enum term_key_action action; - uint16_t key; /* enum term_key; TERM_KEY_NONE for a text key */ - uint16_t keypad; /* the TERM_KEY_KP_* key when the key is on the keypad */ - unsigned mods; /* enum term_mod */ - uint32_t codepoint; /* the code point of the key without modifiers */ - uint32_t shifted; /* the code point of the key with Shift */ - uint32_t base; /* the code point of the key in the US layout */ - uint32_t text; /* the code point the key types, or 0 */ - bool text_deferred; /* an input method sends the text later */ -}; - -struct term_mouse_event { - struct term_vector2i pos; /* Grid cell coordinates (col, row) */ - struct term_vector2i pixel; /* Absolute pixel position in terminal grid */ - /* - * Button identifier: - * - Press and release: the button that changed state (TERM_MOUSE_BUTTON_*). - * - Motion: the held button for drag events, or TERM_MOUSE_BUTTON_NONE for hover. - * - Scroll: the wheel direction (TERM_MOUSE_WHEEL_*). - */ - int button; - unsigned mods; - int scroll_lines; - float scroll_delta; - enum term_mouse_event_kind kind; -}; - -/* The keys that are down. An all-zero value has no keys down. */ -struct term_keyboard_state { - uint64_t down[(TERM_KEY_COUNT + 63) / 64]; -}; - -/* Record a press, repeat, or release in s. */ -TERM_API void term_keyboard_update(struct term_keyboard_state *s, const struct term_key_event *ev); -TERM_API bool term_keyboard_key_down(const struct term_keyboard_state *s, enum term_key key); - -/* Kitty keyboard protocol flags, as in term_modes.keyboard. */ -enum term_keyboard_flag { - TERM_KEYBOARD_DISAMBIGUATE = 1, - TERM_KEYBOARD_EVENT_TYPES = 2, - TERM_KEYBOARD_ALTERNATE_KEYS = 4, - TERM_KEYBOARD_ALL_KEYS = 8, - TERM_KEYBOARD_ASSOCIATED_TEXT = 16, -}; - -enum term_input_status { - TERM_INPUT_UNHANDLED = 0, /* the terminal does not use the event */ - TERM_INPUT_CONSUMED, /* the terminal uses the event but sends nothing */ - TERM_INPUT_BYTES, /* send the len bytes in buf to the program */ - TERM_INPUT_BUFFER_FULL, /* buf is too small; len is 0 */ -}; - -struct term_input_result { - size_t len; - enum term_input_status status; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* TERM_INPUT_H */ -- cgit v1.2.3