|
C-Menu 0.2.9
A User Interface Toolkit
|
Create and manage the Chyron. More...
Functions | |
| void | activate_all_chyron_keys (Chyron *chyron) |
| Deactivate chyron key. | |
| void | activate_chyron_key (Chyron *chyron, int k) |
| Activate chyron key. | |
| void | compile_chyron (Chyron *chyron) |
| construct the chyron string from the chyron structure | |
| void | deactivate_all_chyron_keys (Chyron *chyron) |
| Deactivate all chyron keys. | |
| void | deactivate_chyron_key (Chyron *chyron, int k) |
| Deactivate chyron key. | |
| Chyron * | destroy_chyron (Chyron *chyron) |
| Destroy Chyron structure. | |
| void | display_chyron (WINDOW *win, Chyron *chyron, int line, int col) |
| Display chyron on window. | |
| int | get_chyron_key (Chyron *chyron, int x) |
| Get keycode from chyron. | |
| bool | is_set_chyron_key (Chyron *chyron, int k) |
| Check if function key label is set. | |
| int | mb_to_cc (cchar_t *cmplx_buf, char *str, attr_t attr, int cpx, int *pos, int maxlen) |
| Convert multibyte string to complex character array. | |
| Chyron * | new_chyron () |
| Create and initialize Chyron structure. | |
| void | set_chyron_key (Chyron *chyron, int k, char *s, int kc) |
| Set chyron key with default color pair (cp_nt_rev). | |
| void | set_chyron_key_cp (Chyron *chyron, int k, char *s, int kc, int cp) |
| Set chyron key with color pair (cp). | |
| void | unset_chyron_key (Chyron *chyron, int k) |
| Unset chyron key. | |
Create and manage the Chyron.
| void activate_all_chyron_keys | ( | Chyron * | chyron | ) |
Deactivate chyron key.
deactivate_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1816 of file dwin.c.
References ChyronKey::active, and Chyron::key.
| void activate_chyron_key | ( | Chyron * | chyron, |
| int | k ) |
Activate chyron key.
activate_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1807 of file dwin.c.
References ChyronKey::active, and Chyron::key.
| void compile_chyron | ( | Chyron * | chyron | ) |
construct the chyron string from the chyron structure
compile_chyron
| chyron |
The chyron string is constructed by concatenating the labels of the set keys, separated by " | ". The end_pos values for each key are set to determine the zones for mouse clicks. When a mouse click occurs, the get_chyron_key function uses the end_pos values to determine which key was clicked based on the X position of the click.
Definition at line 1848 of file dwin.c.
References ChyronKey::active, Chyron::cmplx_buf, ChyronKey::cp, cp_nt_rev, ChyronKey::end_pos, Chyron::key, Chyron::l, mb_to_cc(), ssnprintf(), and ChyronKey::text.
Referenced by action_disposition(), answer_yn(), display_error(), field_editor(), form_engine(), form_post(), form_process(), init_pick(), Perror(), pick_engine(), picker(), and wait_mk_chyron().
| void deactivate_all_chyron_keys | ( | Chyron * | chyron | ) |
Deactivate all chyron keys.
deactivate_all_chyron_keys
| chyron | structure |
Definition at line 1834 of file dwin.c.
References ChyronKey::active, and Chyron::key.
| void deactivate_chyron_key | ( | Chyron * | chyron, |
| int | k ) |
Deactivate chyron key.
deactivate_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1826 of file dwin.c.
References ChyronKey::active, and Chyron::key.
Destroy Chyron structure.
destroy_chyron
| chyron | pointer to Chyron structure |
Definition at line 1722 of file dwin.c.
References Chyron::key.
Referenced by action_disposition(), answer_yn(), display_error(), init_form(), Perror(), pick_engine(), wait_destroy(), and waitpid_with_timeout().
| void display_chyron | ( | WINDOW * | win, |
| Chyron * | chyron, | ||
| int | line, | ||
| int | col ) |
Display chyron on window.
display_chyron
| win | NCurses window to display chyron on |
| chyron | Chyron structure containing the compiled chyron string |
| line | Line number to display the chyron on |
| col | Column number to start displaying the chyron from |
This function clears the line where the chyron will be displayed, then uses wadd_wchstr to add the compiled chyron string (cmplx_buf) to the window. Finally, it moves the cursor to the specified column position.
Definition at line 1892 of file dwin.c.
References Chyron::cmplx_buf.
Referenced by action_disposition(), answer_yn(), display_error(), field_editor(), form_engine(), form_post(), form_process(), Perror(), picker(), wait_continue(), and wait_mk_win().
| int get_chyron_key | ( | Chyron * | chyron, |
| int | x ) |
Get keycode from chyron.
get_chyron_key
| chyron | structure |
| x | Mouse X position |
This function uses the end_pos values set in compile_chyron to determine which key was clicked. The chyron functions provide xwgetch() with a mechanism to translate mouse click positions into key codes based on the labels set in the chyron structure. When a mouse click occurs, xwgetch() can call get_chyron_key() with the X position of the click to determine which function key was clicked, allowing for dynamic and customizable function key behavior in the chyron area of the interface.
Definition at line 1917 of file dwin.c.
References ChyronKey::active, ChyronKey::end_pos, Chyron::key, ChyronKey::keycode, and ChyronKey::text.
Referenced by dxwgetch(), and xwgetch().
| bool is_set_chyron_key | ( | Chyron * | chyron, |
| int | k ) |
Check if function key label is set.
is_set_chyron_key
| chyron | structure |
| k | Function key index (0-19) |
Definition at line 1743 of file dwin.c.
References Chyron::key, and ChyronKey::text.
Referenced by form_post(), and form_process().
| int mb_to_cc | ( | cchar_t * | cmplx_buf, |
| char * | str, | ||
| attr_t | attr, | ||
| int | cpx, | ||
| int * | pos, | ||
| int | maxlen ) |
Convert multibyte string to complex character array.
mb_to_cc
| cmplx_buf | Output buffer for complex characters |
| str | Input multibyte string |
| attr | Attributes to apply to the complex characters |
| cpx | Color pair index for the complex characters |
| pos | Pointer to current position in the output buffer, updated as characters are added |
| maxlen | Maximum length of the output buffer |
This function converts a multibyte string to an array of complex characters (cchar_t) that can be used with NCurses functions. It handles multibyte characters and applies the specified color pair to each character. The pos parameter is updated to reflect the current position in the output buffer, and the function ensures that it does not exceed the maximum length.
Definition at line 705 of file dwin.c.
Referenced by border_hsplit_text(), border_title(), and compile_chyron().
| Chyron * new_chyron | ( | ) |
Create and initialize Chyron structure.
new_chyron
This function allocates memory for a new Chyron structure and initializes the key pointers. Each key pointer is allocated memory for a ChyronKey structure. The Chyron structure is used to manage function key labels and their associated keycodes for mouse click handling in the chyron area of the interface. The use of calloc ensures that the allocated memory is initialized to zero, which means that the text for each key will be initialized to an empty string and the keycodes will be initialized to zero. This allows the is_set_chyron_key function to check if a key is set by checking if the first character of the text is not '\0'. If any memory allocation fails, the function will call abend to handle the error and return nullptr.
Definition at line 1701 of file dwin.c.
References abend(), and Chyron::key.
Referenced by action_disposition(), answer_yn(), display_error(), form_engine(), init_pick(), Perror(), and wait_mk_chyron().
| void set_chyron_key | ( | Chyron * | chyron, |
| int | k, | ||
| char * | s, | ||
| int | kc ) |
Set chyron key with default color pair (cp_nt_rev).
set_chyron_key
| chyron | structure |
| k | chyron key index (0-19) |
| s | chyron key label |
| kc | chyron key code |
This function sets the label and keycode for a function key in the chyron structure. It uses the default color pair cp_nt_rev for the key label. If the input string s is not empty, it copies the string into the chyron key's text field. If the input string is empty, it sets the first character of the text field to '\0' to indicate that the key is not set. The keycode is stored in the chyron key's keycode field, and the color pair index is set to cp_nt_rev.
Definition at line 1783 of file dwin.c.
References ChyronKey::active, ChyronKey::cp, cp_nt_rev, Chyron::key, ChyronKey::keycode, ssnprintf(), and ChyronKey::text.
Referenced by action_disposition(), answer_yn(), display_error(), form_engine(), init_pick(), Perror(), and wait_mk_chyron().
| void set_chyron_key_cp | ( | Chyron * | chyron, |
| int | k, | ||
| char * | s, | ||
| int | kc, | ||
| int | cp ) |
Set chyron key with color pair (cp).
set_chyron_key_cp
| chyron | structure |
| k | chyron key index (0-19) |
| s | chyron key label |
| kc | chyron key code |
| cp | color pair index for the key label |
This function is like set_chyron_key, except it includes a color pair numbers
Definition at line 1759 of file dwin.c.
References ChyronKey::active, ChyronKey::cp, Chyron::key, ChyronKey::keycode, ssnprintf(), and ChyronKey::text.
Referenced by field_editor(), form_engine(), and picker().
| void unset_chyron_key | ( | Chyron * | chyron, |
| int | k ) |
Unset chyron key.
unset_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1798 of file dwin.c.
References Chyron::key, and ChyronKey::text.