|
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, uint 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, uint k) |
| Deactivate chyron key. | |
| Chyron * | destroy_chyron (Chyron *chyron) |
| Destroy Chyron structure. | |
| void | display_chyron (UiSurface *sfc, uint w, Chyron *chyron, uint line, uint col) |
| Display chyron on the specified line and column of the surface. | |
| int | get_chyron_key (Chyron *chyron, uint x) |
| Get keycode from chyron. | |
| bool | is_set_chyron_key (Chyron *chyron, uint k) |
| Check if function key label is set. | |
| uint | mbstr_to_cellstr (UiCell *cmplx_buf, const char *str, const UiCell *cell_base, uint *p, const uint atmost) |
| Convert multibyte string to complex character array. | |
| Chyron * | new_chyron () |
| Create and initialize Chyron structure. | |
| void | set_chyron_key (Chyron *chyron, uint k, char *s, uint kc) |
| Set chyron key with default color pair (cp_nt_rev). | |
| void | set_chyron_key_cb (Chyron *chyron, uint k, char *s, uint kc, UiCell cell_base) |
| Set chyron key with color pair (cp). | |
| void | unset_chyron_key (Chyron *chyron, uint 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 1078 of file dwin.c.
References ChyronKey::active, and Chyron::key.
| void activate_chyron_key | ( | Chyron * | chyron, |
| uint | k ) |
Activate chyron key.
activate_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1069 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 1110 of file dwin.c.
References ChyronKey::active, ChyronKey::cell_base, cell_nt_rev, Chyron::cmplx_buf, ChyronKey::end_pos, Chyron::key, Chyron::l, mbstr_to_cellstr(), 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(), and picker().
| void deactivate_all_chyron_keys | ( | Chyron * | chyron | ) |
Deactivate all chyron keys.
deactivate_all_chyron_keys
| chyron | structure |
Definition at line 1096 of file dwin.c.
References ChyronKey::active, and Chyron::key.
| void deactivate_chyron_key | ( | Chyron * | chyron, |
| uint | k ) |
Deactivate chyron key.
deactivate_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1088 of file dwin.c.
References ChyronKey::active, and Chyron::key.
Destroy Chyron structure.
destroy_chyron
| chyron | pointer to Chyron structure |
Definition at line 984 of file dwin.c.
References Chyron::key.
Referenced by action_disposition(), answer_yn(), display_error(), init_form(), Perror(), and pick_engine().
Display chyron on the specified line and column of the surface.
display_chyron
| sfc | Pointer to the UiSurface structure |
| w | Window index (WIN or BOX) |
| chyron | Pointer to the Chyron structure |
| line | Line number where the chyron should be displayed |
| col | Column number where the chyron should start |
This function displays the compiled chyron string on the specified line and column of the given surface. It first moves the cursor to the specified position, clears to the end of the line, and then writes the chyron string. Finally, it moves the cursor back to the specified column for user input.
Definition at line 1163 of file dwin.c.
References Chyron::cmplx_buf, ui_mvwadd_wchstr(), ui_wclrtoeol(), and ui_wmove().
Referenced by action_disposition(), answer_yn(), display_error(), field_editor(), form_engine(), form_post(), form_process(), Perror(), and picker().
| int get_chyron_key | ( | Chyron * | chyron, |
| uint | 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 1186 of file dwin.c.
References ChyronKey::active, ChyronKey::end_pos, Chyron::key, ChyronKey::keycode, and ChyronKey::text.
Referenced by field_editor(), form_post(), form_process(), and picker().
| bool is_set_chyron_key | ( | Chyron * | chyron, |
| uint | k ) |
Check if function key label is set.
is_set_chyron_key
| chyron | structure |
| k | Function key index (0-19) |
Definition at line 1005 of file dwin.c.
References Chyron::key, and ChyronKey::text.
Referenced by form_post(), and form_process().
| uint mbstr_to_cellstr | ( | UiCell * | cmplx_buf, |
| const char * | str, | ||
| const UiCell * | cell_base, | ||
| uint * | p, | ||
| const uint | atmost ) |
Convert multibyte string to complex character array.
mbstr_to_cellstr
| 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 480 of file dwin.c.
References ui_getcchar(), and ui_setcchar().
Referenced by compile_chyron(), form_display_accept_field(), form_display_field(), and form_display_fields().
| 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 947 of file dwin.c.
References abend(), and Chyron::key.
Referenced by action_disposition(), answer_yn(), display_error(), form_engine(), init_pick(), and Perror().
| void set_chyron_key | ( | Chyron * | chyron, |
| uint | k, | ||
| char * | s, | ||
| uint | 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 1045 of file dwin.c.
References ChyronKey::active, ChyronKey::cell_base, cell_nt_rev, Chyron::key, ChyronKey::keycode, ssnprintf(), and ChyronKey::text.
Referenced by action_disposition(), answer_yn(), display_error(), form_engine(), init_pick(), and Perror().
Set chyron key with color pair (cp).
set_chyron_key
| 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 1021 of file dwin.c.
References ChyronKey::active, ChyronKey::cell_base, Chyron::key, ChyronKey::keycode, ssnprintf(), and ChyronKey::text.
Referenced by field_editor(), form_engine(), and picker().
| void unset_chyron_key | ( | Chyron * | chyron, |
| uint | k ) |
Unset chyron key.
unset_chyron_key
| chyron | structure |
| k | chyron_key index |
Definition at line 1060 of file dwin.c.
References Chyron::key, and ChyronKey::text.