libt3widget
|
The t3_widget namespace is contains all classes, functions and global variables in the libt3widget library. More...
Classes | |
class | attribute_picker_dialog_t |
class | attribute_test_line_t |
struct | attributes_t |
class | autocompleter_t |
class | bad_draw_recheck_t |
Base class for widgets that need handle user text and draw differently based on the t3_win_can_draw function. More... | |
class | bullet_t |
Class implementing a bullet driven by a boolean valued callback. More... | |
class | button_t |
Button widget. More... | |
class | center_component_t |
Base class for components which need to center dialogs. More... | |
class | checkbox_t |
Class implementing a checkbox. More... | |
class | cleanup_ptr_base |
class | cleanup_ptr_base< T[], D > |
class | color_pair_picker_t |
class | color_picker_base_t |
class | color_picker_t |
class | complex_error_t |
A class representing an error from one of the supporting libraries. More... | |
class | container_t |
Base class for window_component_t's that are the parents of other window_component_t's. More... | |
struct | delete_functor |
struct | delete_functor< T[]> |
class | dialog_base_t |
class | dialog_t |
Base class for dialogs. More... | |
class | dummy_widget_t |
A widget that does not actually show anything on screen. More... | |
class | edit_window_t |
Class implementing an edit widget. More... | |
class | ensure_clipboard_lock_t |
class | expander_group_t |
A class to group a set of expander widgets such that at most one is expanded at a time. More... | |
class | expander_t |
A widget showing an expander, which allows hiding another widget. More... | |
struct | extclipboard_interface_t |
class | file_dialog_t |
class | file_list_t |
Abstract base class for file lists. More... | |
class | file_name_list_t |
Implementation of the file_list_t interface. More... | |
class | file_pane_t |
A widget displaying the contents of a directory. More... | |
class | filtered_file_list_t |
Filted file list implementation. More... | |
class | filtered_list_base_t |
Abstract base class for filtered string and file lists. More... | |
class | filtered_list_internal_t |
Partial implementation of the filtered list. More... | |
class | filtered_list_t |
Generic filtered list template. More... | |
class | filtered_list_t< string_list_base_t > |
Specialized filtered list template for string_list_base_t. More... | |
class | find_dialog_t |
struct | find_result_t |
A struct holding the result of a find operation. More... | |
class | finder_t |
Class holding the context of a find operation. More... | |
class | focus_widget_t |
Base class for widgets that take focus. More... | |
class | frame_t |
A widget showing a frame. More... | |
struct | free_func |
struct | free_func2 |
class | goto_dialog_t |
class | init_parameters_t |
Structure holding the parameters for initialization for libt3widget. More... | |
class | input_selection_dialog_t |
class | insert_char_dialog_t |
class | item_buffer_t |
Class implmementing a mutex-protected queue of items. More... | |
class | key_buffer_t |
Class implmementing a mutex-protected queue of key symbols. More... | |
struct | key_sequence_t |
struct | key_string_t |
struct | kp_mapping_t |
class | label_t |
A widget displaying a text. More... | |
class | linked_ptr_base |
class | linked_ptr_base< T[], D > |
class | list_base_t |
Abstract base class for string and file lists and filtered lists. More... | |
class | list_pane_t |
struct | main_loop_exit_t |
class | main_window_base_t |
Base class for the application's main window. More... | |
struct | mapping_t |
class | menu_bar_t |
Class implementing a menu bar. More... | |
class | menu_item_base_t |
class | menu_item_t |
class | menu_panel_t |
class | menu_separator_t |
class | message_dialog_t |
struct | mouse_event_t |
Structure holding the relevant elements of a mouse event. More... | |
class | mouse_target_t |
class | multi_widget_t |
class | open_file_dialog_t |
class | optional |
Class defining values with a separate validity check. More... | |
class | pimpl_ptr_base |
class | popup_t |
Base class for dialogs. More... | |
class | replace_buttons_dialog_t |
class | save_as_dialog_t |
class | scrollbar_t |
class | separator_t |
class | smart_label_t |
class | smart_label_text_t |
class | smartptr_base |
class | split_t |
A widget that can contain multiple other widgets. More... | |
class | string_list_base_t |
Abstract base class for string and file lists, but not for filtered lists. More... | |
class | string_list_t |
Implementation of a string list. More... | |
class | string_matcher_t |
struct | terminal_mapping_t |
class | text_buffer_t |
struct | text_coordinate_t |
class | text_field_t |
class | text_line_factory_t |
class | text_line_t |
class | text_window_t |
class | undo_double_text_t |
class | undo_double_text_triple_coord_t |
class | undo_list_t |
class | undo_single_text_double_coord_t |
class | undo_single_text_t |
class | undo_t |
class | widget_container_t |
class | widget_group_t |
A widget aggregating several widgets into a single widget. More... | |
class | widget_t |
Base class for widgets. More... | |
class | window_component_t |
Abstract base class for all items displayed on screen. More... | |
class | wrap_info_t |
Class holding information about wrapping a text_buffer_t. More... | |
class | x11_base_t |
class | x11_driver_t |
class | x11_impl_t |
Typedefs | |
typedef cleanup_func_ptr< t3_window_t, t3_win_del >::t | cleanup_t3_window_ptr |
typedef std::list< dialog_base_t * > | dialog_base_list_t |
typedef std::list< dialog_t * > | dialogs_t |
typedef filtered_list_t< string_list_base_t > | filtered_string_list_t |
Special name for filtered string lists. More... | |
typedef long | key_t |
Integer type holding a single key symbol. More... | |
typedef std::vector< text_line_t * > | lines_t |
typedef item_buffer_t< mouse_event_t > | mouse_event_buffer_t |
typedef optional< int > | optint |
typedef std::deque< widget_t * > | widgets_t |
typedef std::vector< wrap_points_t * > | wrap_data_t |
typedef std::vector< int > | wrap_points_t |
typedef xcb_atom_t | x11_atom_t |
typedef xcb_generic_event_t | x11_event_t |
typedef xcb_property_notify_event_t | x11_property_event_t |
typedef xcb_selection_clear_event_t | x11_selection_clear_event_t |
typedef xcb_selection_notify_event_t | x11_selection_event_t |
typedef xcb_selection_request_event_t | x11_selection_request_event_t |
typedef xcb_timestamp_t | x11_time_t |
typedef xcb_window_t | x11_window_t |
Enumerations | |
enum | { CLASS_WHITESPACE, CLASS_ALNUM, CLASS_GRAPH, CLASS_OTHER } |
enum | { WINCH_SIGNAL, QUIT_SIGNAL, EXIT_MAIN_LOOP_SIGNAL } |
enum | { CLIPBOARD, PRIMARY, TARGETS, TIMESTAMP, MULTIPLE, UTF8_STRING, GDK_SELECTION, INCR, ATOM, ATOM_PAIR } |
enum | { EKEY_FIRST_SPECIAL } |
enum | { EKEY_IGNORE, EKEY_END, EKEY_HOME, EKEY_PGUP, EKEY_PGDN, EKEY_LEFT, EKEY_RIGHT, EKEY_UP, EKEY_DOWN, EKEY_DEL, EKEY_INS, EKEY_BS, EKEY_NL, EKEY_KP_CENTER, EKEY_KP_END, EKEY_KP_HOME, EKEY_KP_PGUP, EKEY_KP_PGDN, EKEY_KP_LEFT, EKEY_KP_RIGHT, EKEY_KP_UP, EKEY_KP_DOWN, EKEY_KP_DEL, EKEY_KP_INS, EKEY_KP_NL, EKEY_KP_DIV, EKEY_KP_MUL, EKEY_KP_PLUS, EKEY_KP_MINUS, EKEY_F1, EKEY_F2, EKEY_F3, EKEY_F4, EKEY_F5, EKEY_F6, EKEY_F7, EKEY_F8, EKEY_F9, EKEY_F10, EKEY_F11, EKEY_F12, EKEY_F13, EKEY_F14, EKEY_F15, EKEY_F16, EKEY_F17, EKEY_F18, EKEY_F19, EKEY_F20, EKEY_F21, EKEY_F22, EKEY_F23, EKEY_F24, EKEY_F25, EKEY_F26, EKEY_F27, EKEY_F28, EKEY_F29, EKEY_F30, EKEY_F31, EKEY_F32, EKEY_F33, EKEY_F34, EKEY_F35, EKEY_F36, EKEY_RESIZE, EKEY_HOTKEY, EKEY_EXTERNAL_UPDATE, EKEY_UPDATE_TERMINAL, EKEY_MOUSE_EVENT, EKEY_EXIT_MAIN_LOOP, EKEY_ESC, EKEY_SHIFT, EKEY_META, EKEY_CTRL, EKEY_PROTECT, EKEY_KEY_MASK } |
List of special keys and masks generated by the key handling code. More... | |
enum | { XTERM_MOUSE_NONE, XTERM_MOUSE_SINGLE_BYTE, XTERM_MOUSE_COORD_UTF, XTERM_MOUSE_ALL_UTF } |
enum | { EMOUSE_BUTTON_LEFT, EMOUSE_BUTTON_MIDDLE, EMOUSE_BUTTON_RIGHT, EMOUSE_SCROLL_UP, EMOUSE_SCROLL_DOWN, EMOUSE_CLICKED_LEFT, EMOUSE_CLICKED_MIDDLE, EMOUSE_CLICKED_RIGHT, EMOUSE_DOUBLE_CLICKED_LEFT, EMOUSE_DOUBLE_CLICKED_MIDDLE, EMOUSE_DOUBLE_CLICKED_RIGHT, EMOUSE_TRIPLE_CLICKED_LEFT, EMOUSE_TRIPLE_CLICKED_MIDDLE, EMOUSE_TRIPLE_CLICKED_RIGHT, EMOUSE_ALL_BUTTONS, EMOUSE_ALL_BUTTONS_COUNT, EMOUSE_CLICK_BUTTONS_COUNT, EMOUSE_CLICK_BUTTONS } |
enum | { EMOUSE_SHIFT, EMOUSE_META, EMOUSE_CTRL } |
enum | { EMOUSE_BUTTON_PRESS, EMOUSE_BUTTON_RELEASE, EMOUSE_MOTION, EMOUSE_OUTSIDE_GRAB } |
enum | terminal_code_t { TERM_NONE, TERM_XTERM, TERM_LINUX } |
enum | undo_type_t { UNDO_NONE, UNDO_DELETE, UNDO_DELETE_BLOCK, UNDO_BACKSPACE, UNDO_ADD, UNDO_ADD_BLOCK, UNDO_REPLACE_BLOCK, UNDO_OVERWRITE, UNDO_DELETE_NEWLINE, UNDO_BACKSPACE_NEWLINE, UNDO_ADD_NEWLINE, UNDO_INDENT, UNDO_UNINDENT, UNDO_ADD_NEWLINE_INDENT, UNDO_BLOCK_START, UNDO_BLOCK_END, UNDO_ADD_REDO, UNDO_BACKSPACE_REDO, UNDO_REPLACE_BLOCK_REDO, UNDO_OVERWRITE_REDO, UNDO_ADD_NEWLINE_INDENT_REDO, UNDO_BLOCK_START_REDO, UNDO_BLOCK_END_REDO } |
Functions | |
_T3_WIDGET_ENUM (selection_mode_t, NONE, SHIFT, MARK, ALL) | |
_T3_WIDGET_ENUM (find_flags_t, BACKWARD=(1<< 0), ICASE=(1<< 1), REGEX=(1<< 2), WRAP=(1<< 3), TRANSFROM_BACKSLASH=(1<< 4), WHOLE_WORD=(1<< 5)|(1<< 6), ANCHOR_WORD_LEFT=(1<< 5), ANCHOR_WORD_RIGHT=(1<< 6), VALID=(1<< 7), REPLACEMENT_VALID=(1<< 8),) | |
_T3_WIDGET_ENUM (find_action_t, FIND, SKIP, REPLACE, REPLACE_ALL, REPLACE_IN_SELECTION) | |
_T3_WIDGET_ENUM (attribute_t, NON_PRINT, TEXT_SELECTION_CURSOR, TEXT_SELECTION_CURSOR2, BAD_DRAW, TEXT_CURSOR, TEXT, TEXT_SELECTED, HOTKEY_HIGHLIGHT, DIALOG, DIALOG_SELECTED, BUTTON_SELECTED, SCROLLBAR, MENUBAR, MENUBAR_SELECTED, BACKGROUND, SHADOW, META_TEXT) | |
Constants for indicating which attribute to change/retrieve. More... | |
_T3_WIDGET_ENUM (rewrap_type_t, REWRAP_ALL, REWRAP_LINE, REWRAP_LINE_LOCAL, INSERT_LINES, DELETE_LINES) | |
_T3_WIDGET_ENUM (wrap_type_t, NONE, WORD, CHARACTER) | |
template<typename T , typename D = delete_functor<T>> | |
_T3_WIDGET_TYPEDEF (cleanup_ptr, cleanup_ptr_base< T, D >) | |
template<typename T , void(*)(T *) f> | |
_T3_WIDGET_TYPEDEF (cleanup_func_ptr, cleanup_ptr_base< T, free_func< T, f > >) | |
template<typename T , typename U , U(*)(T *) f> | |
_T3_WIDGET_TYPEDEF (cleanup_func2_ptr, cleanup_ptr_base< T, free_func2< T, U, f > >) | |
template<typename T > | |
_T3_WIDGET_TYPEDEF (cleanup_free_ptr, cleanup_ptr_base< T, free_func<> >) | |
template<typename T , typename D = delete_functor<T>> | |
_T3_WIDGET_TYPEDEF (linked_ptr, linked_ptr_base< T, D >) | |
template<typename T > | |
_T3_WIDGET_TYPEDEF (pimpl_ptr, pimpl_ptr_base< T >) | |
void | async_safe_exit_main_loop (int exit_code) |
Exit the main loop from any thread or signal handler. More... | |
static uint32_t | casefold_single (uint32_t c) |
bool | check_mouse_fd (fd_set *readset) |
Check the mouse event fd for events, if appropriate bits in readset indicate available data. More... | |
static void | claim_selection (bool clipboard, string *data) |
void | cleanup (void) |
Free memory used by libt3widget. More... | |
void | cleanup_keys (void) |
Clean-up any data allocated for the key handling code. More... | |
static int | compare_mapping (const void *a, const void *b) |
static int | compare_sequence_with_mapping (const void *key, const void *mapping) |
signals::connection | connect_on_init (const signals::slot< void, bool > &slot) |
Connect a callback to the on_init signal. More... | |
signals::connection | connect_resize (const signals::slot< void, int, int > &slot) |
Connect a callback to the resize signal. More... | |
signals::connection | connect_terminal_settings_changed (const signals::slot< void > &slot) |
Connect a callback to the terminal_settings_changed signal. More... | |
signals::connection | connect_update_notification (const signals::slot< void > &slot) |
Connect a callback to the update_notification signal. More... | |
void | convert_lang_codeset (const char *str, size_t len, std::string *result, bool from) |
void | convert_lang_codeset (const char *str, std::string *result, bool from) |
void | convert_lang_codeset (const std::string *str, std::string *result, bool from) |
static void | convert_next_key (void) |
static key_t | decode_sequence (bool outer) |
bool | decode_xterm_mouse (void) |
Decode an xterm mouse event. More... | |
void | deinit_keys (void) |
Switch to the default keypad mode to allow other applications to function. More... | |
void | deinit_mouse_reporting (void) |
Switch off mouse reporting to allow other applications to function. More... | |
static void | do_resize (void) |
static t3_attr_t | ensure_color (t3_attr_t value) |
void | exit_main_loop (int exit_code) |
Exit the main loop. More... | |
void | fd_set_mouse_fd (fd_set *readset, int *max_fd) |
Set bit(s) for mouse event fd. More... | |
t3_attr_t | get_attribute (attribute_t attribute) |
Retrieve the setting of a default attribute. More... | |
int | get_class (const std::string *str, int pos) |
Get the character class associated with the character at a specific position in a string. More... | |
linked_ptr< string >::t | get_clipboard (void) |
Get the clipboard data. More... | |
t3_attr_t | get_default_attribute (attribute_t attribute, bool color_mode) |
Retrieve the default setting of a default attribute. More... | |
string | get_directory (const char *directory) |
int | get_key_timeout (void) |
Get the timeout for handling escape sequences. More... | |
long | get_libt3key_version (void) |
Get the version of the libt3key library used by libt3widget at runtime. More... | |
long | get_libt3window_version (void) |
Get the version of the libt3window library used by libt3widget at runtime. More... | |
static key_t | get_next_converted_key (void) |
static int | get_next_keychar (void) |
linked_ptr< string >::t | get_primary (void) |
Get the primary selection data. More... | |
void | get_screen_size (int *height, int *width) |
Get the dimensions of the screen as used by libt3widget. More... | |
static linked_ptr< string >::t | get_selection (bool clipboard) |
long | get_version (void) |
Get the version of the libt3widget library used at runtime. More... | |
string | get_working_directory (void) |
bool | glob_filter (string_list_base_t *list, size_t idx, const std::string *str, bool show_hidden) |
Filter function using glob on the fs_name of a file entry. More... | |
complex_error_t | init (const init_parameters_t *params) |
Initialize the libt3widget library. More... | |
void | init_attributes (void) |
static void | init_external_clipboard (bool init) |
complex_error_t | init_keys (const char *term, bool separate_keypad) |
Initialize the key handling code. More... | |
void | init_mouse_reporting (bool xterm_mouse) |
Initialize the mouse handling code. More... | |
static bool | init_x11 () |
void | insert_protected_key (t3_widget::key_t key) |
Insert a key to the queue, marked to ensure it is not interpreted by any widget except text widgets. More... | |
bool | is_dir (const string *current_dir, const char *name) |
static bool | is_function_key (const char *str) |
static bool | is_hex_digit (int c) |
static int | is_start_char (int c) |
void | iterate (void) |
Perform a single iteration of the main loop. More... | |
static void | lang_codeset_init (bool init) |
static void | lock () |
void | lock_clipboard (void) |
int | main_loop (void) |
Run the main event loop of the libt3widget library. More... | |
static key_t | map_kp (key_t kp) |
ssize_t | nosig_read (int fd, char *buffer, size_t bytes) |
ssize_t | nosig_write (int fd, const char *buffer, size_t bytes) |
static signals::signal< void, bool > & | on_init () |
int | parse_escape (const std::string &str, const char **error_message, size_t &read_position, bool replacements=false) |
Parse a single escape sequence in a string. More... | |
bool | parse_escapes (std::string &str, const char **error_message, bool replacements=false) |
Convert escapes in a string to associated values. More... | |
key_t | read_key (void) |
Retrieve a key from the input queue. More... | |
bool | read_keychar (int timeout) |
Read chars into buffer for processing. More... | |
static void | read_keys () |
mouse_event_t | read_mouse_event (void) |
Retrieve a mouse event from the input queue. More... | |
void | redraw (void) |
Force a complete redraw of the terminal contents. More... | |
void | reinit_keys (void) |
Switch back to best keypad mode after using deinit_keys. More... | |
void | reinit_mouse_reporting (void) |
Switch back to mouse reporting after using deinit_mouse_reporting. More... | |
void | release_selections (void) |
void | restore (void) |
Function to restore the terminal to the original settings. More... | |
void | sanitize_dir (string *directory) |
void | set_attribute (attribute_t attribute, t3_attr_t value) |
Change the setting of a default attribute. More... | |
void | set_clipboard (string *str) |
bool | set_color_mode (bool on) |
Control the color mode. More... | |
void | set_key_timeout (int msec) |
Set the timeout for handling escape sequences. More... | |
void | set_primary (string *str) |
void | signal_update (void) |
Request the generation of the update_notification signal. More... | |
static void | sigwinch_handler (int param) |
void | stop_clipboard (void) |
static void | stop_keys (void) |
void | stop_mouse_reporting (void) |
Stop mouse reporting all together before program termination. More... | |
static void | stop_x11 () |
bool | string_compare_filter (string_list_base_t *list, size_t idx, const std::string *str) |
Filter function comparing the initial part of an entry with str . More... | |
void | suspend (void) |
Suspend execution of this program by sending a SIGSTOP signal. More... | |
static signals::signal< void > & | terminal_settings_changed () |
static void | terminal_specific_restore (void) |
static void | terminal_specific_setup (void) |
static long | timediff (struct timeval a, struct timeval b) |
static int | to_lower (int c) |
static void | unget_key (key_t c) |
static void | unget_keychar (int c) |
static void | unlock () |
void | unlock_clipboard (void) |
bool | use_xterm_mouse_reporting (void) |
Report whether XTerm mouse reporting is active. More... | |
Variables | |
extclipboard_interface_t | _t3_widget_extclipboard_calls |
static key_t | accepted_keys [] |
static const char * | atom_names [] |
attributes_t | attributes |
char | char_buffer [32] |
int | char_buffer_fill |
linked_ptr< string >::t | clipboard_data |
static transcript_t * | conversion_handle |
text_line_factory_t | default_text_line_factory |
static const char * | disable_mouse |
static bool | drop_single_esc |
static const char * | enable_mouse |
static const char * | enter |
static extclipboard_interface_t * | extclipboard_calls |
static signals::connection | init_connected |
static int | init_level |
init_parameters_t * | init_params |
insert_char_dialog_t * | insert_char_dialog |
Global insert_char_dialog_t dialog. More... | |
static bool | is_prefix |
static key_buffer_t | key_buffer |
static const key_string_t | key_strings [] |
static int | key_timeout |
static thread::mutex | key_timeout_lock |
static const t3_key_node_t * | keymap |
static const kp_mapping_t | kp_mappings [] |
static transcript_t * | lang_codeset_handle |
static signals::connection | lang_codeset_init_connection |
static bool | lang_codeset_is_utf8 |
static const char * | leave |
static mapping_t * | map |
static int | map_count |
static key_t | map_single [128] |
message_dialog_t * | message_dialog |
Global message_dialog_t dialog. More... | |
static int | mouse_button_state |
static mouse_event_buffer_t | mouse_event_buffer |
const optint | None |
Standard uninitialized optint value. More... | |
static key_t | nul |
linked_ptr< string >::t | primary_data |
static thread::thread | read_key_thread |
static signals::signal< void, int, int > | resize |
static int | screen_columns |
static int | screen_lines |
static int | signal_pipe [2] |
static terminal_code_t | terminal |
static terminal_mapping_t | terminal_mapping [] |
static uint32_t | unicode_buffer [16] |
static int | unicode_buffer_fill |
static signals::signal< void > | update_notification |
static enum t3_widget:: { ... } | xterm_mouse_reporting |
The t3_widget namespace is contains all classes, functions and global variables in the libt3widget library.
Special name for filtered string lists.
typedef long t3_widget::key_t |
Integer type holding a single key symbol.
anonymous enum |
List of special keys and masks generated by the key handling code.
Enumerator | |
---|---|
EKEY_RESIZE |
Key symbol indicating the terminal was resized. |
EKEY_HOTKEY |
Key symbol used when a widget has indicated that a pressed key is a hot key. Testing whether a key is a hot key for a widget is performed using the widget_t::is_hotkey function. If that returns |
EKEY_EXTERNAL_UPDATE |
Key symbol indicating that the signal_update function was called and the |
EKEY_UPDATE_TERMINAL |
Key symbol indicating that the |
EKEY_MOUSE_EVENT |
Key symbol indicating that there is a new #mouse_event_t available in the mouse events queue. |
EKEY_EXIT_MAIN_LOOP |
Key symbol indicating that the async_safe_exit_main_loop function was called. |
EKEY_ESC |
Symbolic name for the escape key. |
EKEY_SHIFT |
Value indicating the shift key was pressed with a key press, used as bit-field. |
EKEY_META |
Value indicating the meta key was pressed with a key press, used as bit-field. |
EKEY_CTRL |
Value indicating the control key was pressed with a key press, used as bit-field. |
EKEY_PROTECT |
Value indicating the key was inserted using insert_protected_key, used as bit-field. |
EKEY_KEY_MASK |
Bit mask to retrieve the base key symbol. |
t3_widget::_T3_WIDGET_ENUM | ( | attribute_t | , |
NON_PRINT | , | ||
TEXT_SELECTION_CURSOR | , | ||
TEXT_SELECTION_CURSOR2 | , | ||
BAD_DRAW | , | ||
TEXT_CURSOR | , | ||
TEXT | , | ||
TEXT_SELECTED | , | ||
HOTKEY_HIGHLIGHT | , | ||
DIALOG | , | ||
DIALOG_SELECTED | , | ||
BUTTON_SELECTED | , | ||
SCROLLBAR | , | ||
MENUBAR | , | ||
MENUBAR_SELECTED | , | ||
BACKGROUND | , | ||
SHADOW | , | ||
META_TEXT | |||
) |
Constants for indicating which attribute to change/retrieve.
void t3_widget::async_safe_exit_main_loop | ( | int | exit_code | ) |
Exit the main loop from any thread or signal handler.
Calling this function will (eventually) cause an exit from the main loop. "Eventually" meaning that a key press event is inserted in the key buffer, which will cause an exit from the program.
bool t3_widget::check_mouse_fd | ( | fd_set * | readset | ) |
Check the mouse event fd for events, if appropriate bits in readset
indicate available data.
void t3_widget::cleanup | ( | void | ) |
Free memory used by libt3widget.
After this function is called, no further calls to libt3widget should be made. Normally, there is no reason to call this function at all, because the operating system will reclaim all memory. However, if you are trying to track down memory leaks in your program, calling this function will free all memory allocated in libt3widget, thus allowing you to debug your own memory allocations more easily.
void t3_widget::cleanup_keys | ( | void | ) |
Clean-up any data allocated for the key handling code.
signals::connection t3_widget::connect_on_init | ( | const signals::slot< void, bool > & | slot | ) |
Connect a callback to the on_init
signal.
The on_init
signal is emitted after initialization is complete. The signal is provided to allow initialization of global variables after initialization is complete, but without knowledge of when init is called.
signals::connection t3_widget::connect_resize | ( | const signals::slot< void, int, int > & | slot | ) |
Connect a callback to the resize
signal.
signals::connection t3_widget::connect_terminal_settings_changed | ( | const signals::slot< void > & | slot | ) |
Connect a callback to the terminal_settings_changed
signal.
The terminal_settings_changed
signal is emitted when the libt3window library has completed the terminal capability detection.
signals::connection t3_widget::connect_update_notification | ( | const signals::slot< void > & | slot | ) |
Connect a callback to the update_notification
signal.
The update_notification
signal is sent in response to signal_update function.
bool t3_widget::decode_xterm_mouse | ( | void | ) |
Decode an xterm mouse event.
Decode an XTerm mouse event.
This routine would have been simple, had it not been for the fact that the original XTerm mouse protocol is a little broken, and it is hard to detect whether the fix is present. First of all, the original protocol can not handle coordinates above 223. This is due to the fact that a coordinate is encoded as coordinate + 32 (and coordinates start at 1).
Once screens got big enough to make terminals more than 223 columns wide, a fix was implemented, which uses UTF-8 encoding (but only using at most 2 bytes, instead of simply using the full range). However, to accomodate clients which simply assumed all input was UTF-8 encoded, several versions later the buttons were encoded as UTF-8 as well. Thus we now have three different versions of the XTerm mouse reporting protocol.
This wouldn't be so bad, if it wasn't for all those terminal emulators out there claiming to be XTerm. They make detection of the specific version of the protocol practically impossible, because they may report any version number in response to a "Send Device Attributes" request. Thus, this routine tries to do automatic switching, based on the received mouse reports.
Autodetection logic:
void t3_widget::deinit_keys | ( | void | ) |
Switch to the default keypad mode to allow other applications to function.
void t3_widget::deinit_mouse_reporting | ( | void | ) |
Switch off mouse reporting to allow other applications to function.
void t3_widget::exit_main_loop | ( | int | exit_code | ) |
Exit the main loop.
Calling this function will cause an exit from the main loop. This is accomplished by throwing an exception, so using an unqualified catch
clause will interfere with the execution of this action.
void t3_widget::fd_set_mouse_fd | ( | fd_set * | readset, |
int * | max_fd | ||
) |
Set bit(s) for mouse event fd.
t3_attr_t t3_widget::get_attribute | ( | attribute_t | attribute | ) |
Retrieve the setting of a default attribute.
See the attribute_t enum for possible values.
int t3_widget::get_class | ( | const std::string * | str, |
int | pos | ||
) |
Get the character class associated with the character at a specific position in a string.
linked_ptr< std::string >::t t3_widget::get_clipboard | ( | void | ) |
Get the clipboard data.
While the returned linked_ptr is in scope, the clipboard should be locked. See lock_clipboard for details.
t3_attr_t t3_widget::get_default_attribute | ( | attribute_t | attribute, |
bool | color_mode | ||
) |
Retrieve the default setting of a default attribute.
See the attribute_t enum for possible values.
int t3_widget::get_key_timeout | ( | void | ) |
Get the timeout for handling escape sequences.
See set_key_timeout for details about the return value.
long t3_widget::get_libt3key_version | ( | void | ) |
Get the version of the libt3key library used by libt3widget at runtime.
long t3_widget::get_libt3window_version | ( | void | ) |
Get the version of the libt3window library used by libt3widget at runtime.
linked_ptr< std::string >::t t3_widget::get_primary | ( | void | ) |
Get the primary selection data.
While the returned linked_ptr is in scope, the clipboard should be locked. See lock_clipboard for details.
void t3_widget::get_screen_size | ( | int * | height, |
int * | width | ||
) |
Get the dimensions of the screen as used by libt3widget.
long t3_widget::get_version | ( | void | ) |
Get the version of the libt3widget library used at runtime.
bool t3_widget::glob_filter | ( | string_list_base_t * | list, |
size_t | idx, | ||
const std::string * | str, | ||
bool | show_hidden | ||
) |
Filter function using glob on the fs_name of a file entry.
complex_error_t t3_widget::init | ( | const init_parameters_t * | params | ) |
Initialize the libt3widget library.
This function should be called before any other function in the libt3widget library.
complex_error_t t3_widget::init_keys | ( | const char * | term, |
bool | separate_keypad | ||
) |
Initialize the key handling code.
void t3_widget::init_mouse_reporting | ( | bool | xterm_mouse | ) |
Initialize the mouse handling code.
void t3_widget::insert_protected_key | ( | t3_widget::key_t | key | ) |
Insert a key to the queue, marked to ensure it is not interpreted by any widget except text widgets.
void t3_widget::iterate | ( | void | ) |
Perform a single iteration of the main loop.
This function updates the contents of the terminal, waits for a key press and sends it to the currently focussed dialog. Called repeatedly from main_loop.
int t3_widget::main_loop | ( | void | ) |
Run the main event loop of the libt3widget library.
This function will return only by calling exit_main_loop, yielding the value passed to that function.
int t3_widget::parse_escape | ( | const std::string & | str, |
const char ** | error_message, | ||
size_t & | read_position, | ||
bool | replacements = false |
||
) |
Parse a single escape sequence in a string.
str | The string to parse the escape from. |
error_message | Pointer to storage for an error message. |
read_position | The index in str to start reading, updated by parse_escape. |
replacements | A boolean indicating whether replacement markers should be parsed as such. |
bool t3_widget::parse_escapes | ( | std::string & | str, |
const char ** | error_message, | ||
bool | replacements = false |
||
) |
Convert escapes in a string to associated values.
Convert a string from the input format to an internally usable string.
str | The string to parse, updated by this function. |
error_message | Pointer to storage for an error message. |
replacements | A boolean indicating whether replacement markers should be parsed as such. |
str | A Token with the str to be converted. |
error_message | Location to store the error message if necessary. |
replacements | Mark replacment substitutions (\1 .. \9) in the string. |
The use of this function processes escape characters. The converted characters are written in the original str.
key_t t3_widget::read_key | ( | void | ) |
Retrieve a key from the input queue.
bool t3_widget::read_keychar | ( | int | timeout | ) |
Read chars into buffer for processing.
mouse_event_t t3_widget::read_mouse_event | ( | void | ) |
Retrieve a mouse event from the input queue.
void t3_widget::redraw | ( | void | ) |
Force a complete redraw of the terminal contents.
The terminal contents may get corrupted due to the output from other processes. The only remedy is to clear the terminal and redraw it, which is exactly what this function does.
void t3_widget::reinit_keys | ( | void | ) |
Switch back to best keypad mode after using deinit_keys.
void t3_widget::reinit_mouse_reporting | ( | void | ) |
Switch back to mouse reporting after using deinit_mouse_reporting.
void t3_widget::restore | ( | void | ) |
Function to restore the terminal to the original settings.
This function is called automatically on program termination by use of atexit(3)
.
void t3_widget::set_attribute | ( | attribute_t | attribute, |
t3_attr_t | value | ||
) |
Change the setting of a default attribute.
See the attribute_t enum for possible values.
bool t3_widget::set_color_mode | ( | bool | on | ) |
Control the color mode.
libt3widget by default starts in black and white mode, as most terminals support the limited attributes required. This function allows switching to and from color mode. If the terminal does not support (enough) colors, switching to color mode will not do anything and false
will be returned.
void t3_widget::set_key_timeout | ( | int | msec | ) |
Set the timeout for handling escape sequences.
The value of the msec
parameter can have the following values:
msec
milliseconds as part of an escape sequence. Pressing escape once and waiting for the timeout to pass will result in EKEY_ESC. msec
milliseconds as part of an escape sequence. Pressing escape once and waiting for the timeout to pass will result in the escape key press being ignored. To generate EKEY_ESC, the user needs to press the escape key twice. void t3_widget::signal_update | ( | void | ) |
Request the generation of the update_notification
signal.
This function is part of the multi-threading support of libt3widget. Updates to widgets are only allowed from the thread running the main_loop function. The signal_update function can be called from any thread and will cause an update_notification
signal to be generated on the thread running the main_loop function.
void t3_widget::stop_mouse_reporting | ( | void | ) |
Stop mouse reporting all together before program termination.
bool t3_widget::string_compare_filter | ( | string_list_base_t * | list, |
size_t | idx, | ||
const std::string * | str | ||
) |
Filter function comparing the initial part of an entry with str
.
void t3_widget::suspend | ( | void | ) |
Suspend execution of this program by sending a SIGSTOP
signal.
Before sending the SIGSTOP
signal, the terminal is reset to its original state. This allows the parent process (usually the shell) to continue running, while the current program is temporarily suspended.
bool t3_widget::use_xterm_mouse_reporting | ( | void | ) |
Report whether XTerm mouse reporting is active.
insert_char_dialog_t * t3_widget::insert_char_dialog |
Global insert_char_dialog_t dialog.
message_dialog_t * t3_widget::message_dialog |
Global message_dialog_t dialog.
const optint t3_widget::None |
Standard uninitialized optint value.