cwidget
0.5.17
|
Routines that support parsing and interpreting user configuration. More...
Classes | |
struct | column_definition |
Defines how a single column is to be generated. More... | |
class | column_generator |
The class that defines how to parse and generate columns. More... | |
class | column_parameters |
Defines the string arguments passed into the layout process. More... | |
struct | column_type_defaults |
Defines the default settings for a particular column type. More... | |
class | empty_column_parameters |
An empty list of parameters. More... | |
struct | key |
Represents a keystroke as seen by curses. More... | |
class | keybindings |
Stores the keys bound to various functions. More... | |
Typedefs | |
typedef std::list< column_definition > | column_definition_list |
The type used to store lists of column definitions. More... | |
typedef int(* | column_parser_func) (char id) |
The type of a function that parses a single-character column type flag and returns an integer identifying the column type. | |
typedef std::vector< key > | keybinding |
The type used to store the keybindings of a function. More... | |
Functions | |
void | init_colors () |
Set up the colors as we expect them to be. More... | |
int | get_color_pair (short fg, short bg) |
int | mix_color (short color, short fg, short bg) |
column_definition_list * | parse_columns (wstring config, column_parser_func parser, column_type_defaults *defaults) |
column_definition_list * | parse_columns (std::wstring config, column_parser_func parser, column_type_defaults *defaults) |
Parse the given string into a list of column definitions. More... | |
void | init_key_tables () |
key | parse_key (wstring keystr) |
wstring | keyname (const key &k) |
Convert a keystroke to its string definition. More... | |
wstring | readable_keyname (const key &k) |
Convert a keystroke to a human-readable keyname. More... | |
key | parse_key (std::wstring keystr) |
Parse a keystroke definition. More... | |
Variables | |
keybindings | global_bindings |
The global keybindings object. More... | |
map< wstring, key > | keynames |
map< wstring, key > | s_keynames |
map< key, wstring > | rev_keynames |
bool | key_tables_initialized =false |
Routines that support parsing and interpreting user configuration.
For instance, routines to handle keybindings are placed in this namespace.
typedef std::list<column_definition> cwidget::config::column_definition_list |
The type used to store lists of column definitions.
typedef std::vector<key> cwidget::config::keybinding |
The type used to store the keybindings of a function.
int cwidget::config::get_color_pair | ( | short | fg, |
short | bg | ||
) |
Referenced by mix_color().
void cwidget::config::init_colors | ( | ) |
Set up the colors as we expect them to be.
Call this once when the program starts.
This will normally be invoked during the library's initialization and does not need to be called by clients of the library.
Referenced by cwidget::chstring::operator=().
std::wstring cwidget::config::keyname | ( | const key & | k | ) |
Convert a keystroke to its string definition.
k | The key that is to be converted to a string. |
References cwidget::config::key::ch, cwidget::config::key::function_key, and keyname().
Referenced by cwidget::config::keybindings::keybindings(), keyname(), readable_keyname(), cwidget::config::keybindings::set(), and cwidget::widgets::menu::width_request().
int cwidget::config::mix_color | ( | short | color, |
short | fg, | ||
short | bg | ||
) |
color | attributes containing the starting color value |
fg | the new foreground (-1 to use color) |
bg | the new background (-2 to use color; -1 to use the default background) |
References get_color_pair().
Referenced by cwidget::style::apply_to(), and cwidget::style::get_attrs().
column_definition_list* cwidget::config::parse_columns | ( | std::wstring | config, |
column_parser_func | parser, | ||
column_type_defaults * | defaults | ||
) |
Parse the given string into a list of column definitions.
config | The format string describing the columns to create. |
parser | The parsing function used to parse %-escapes. |
defaults | An array of the default options for each column; must have elements corresponding to each column id returned by the parser. |
key cwidget::config::parse_key | ( | std::wstring | keystr | ) |
Parse a keystroke definition.
keystr | The definition to parse. |
Referenced by cwidget::config::keybindings::key_matches().
std::wstring cwidget::config::readable_keyname | ( | const key & | k | ) |
Convert a keystroke to a human-readable keyname.
References keyname(), and readable_keyname().
Referenced by cwidget::config::keybindings::keybindings(), readable_keyname(), and cwidget::config::keybindings::set().
keybindings cwidget::config::global_bindings |
The global keybindings object.
This object is the root of the keybindings hierarchy; normally all other keybindings objects should be descendents of it.
Referenced by cwidget::widgets::button::handle_key(), cwidget::widgets::pager::height_request(), cwidget::toplevel::init(), cwidget::widgets::statuschoice::paint(), cwidget::widgets::tree::paint(), cwidget::widgets::menubar::paint(), cwidget::widgets::editline::paint(), cwidget::widgets::table::paint(), cwidget::widgets::menu::paint(), cwidget::toplevel::post_event(), cwidget::config::keybindings::set(), cwidget::widgets::menu::width_request(), and cwidget::dialogs::yesno().