|
C-Menu 0.2.9
A User Interface Toolkit
|
Create and manage the Chyron. More...
Functions | |
| Chyron * | new_chyron () |
| Create and initialize Chyron structure. | |
| Chyron * | destroy_chyron (Chyron *chyron) |
| Destroy Chyron structure. | |
| bool | is_set_chyron_key (Chyron *chyron, int k) |
| Check if function key label is set. | |
| void | set_chyron_key_cp (Chyron *chyron, int k, char *s, int kc, int cp) |
| Set chyron key. | |
| void | unset_chyron_key (Chyron *chyron, int k) |
| Unset chyron key. | |
| void | compile_chyron (Chyron *chyron) |
| construct the chyron string from the chyron structure | |
| 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. | |
| int | get_chyron_key (Chyron *chyron, int x) |
| Get keycode from chyron. | |
| cchar_t * | mk_cmplx_buf (const char *s) |
| Create complex character buffer from multibyte string. | |
Create and manage the Chyron.
| void compile_chyron | ( | Chyron * | chyron | ) |
construct the chyron string from the chyron structure
| 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 268 of file dwin.c.
References Chyron::cmplx_buf, ChyronKey::cp, cp_reverse, ChyronKey::end_pos, Chyron::key, Chyron::l, mb_to_cc(), and ChyronKey::text.
Referenced by action_disposition(), answer_yn(), display_error(), display_page(), field_editor(), form_display_fields(), form_post(), form_process(), Perror(), pick_engine(), and wait_mk_chyron().
Destroy Chyron structure.
| chyron | pointer to Chyron structure |
Definition at line 198 of file dwin.c.
References Chyron::key.
Referenced by action_disposition(), answer_yn(), display_error(), init_form(), Perror(), pick_engine(), and wait_destroy().
| int get_chyron_key | ( | Chyron * | chyron, |
| int | x ) |
Get keycode from chyron.
| chyron | structure |
| x | Mouse X position |
Definition at line 369 of file dwin.c.
References ChyronKey::end_pos, Chyron::key, and ChyronKey::keycode.
Referenced by xwgetch().
| bool is_set_chyron_key | ( | Chyron * | chyron, |
| int | k ) |
Check if function key label is set.
| chyron | structure |
| k | Function key index (0-19) |
Definition at line 217 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.
| 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 321 of file dwin.c.
Referenced by compile_chyron().
| cchar_t * mk_cmplx_buf | ( | const char * | s | ) |
Create complex character buffer from multibyte string.
| s | Input multibyte string |
This function creates a complex character buffer from a multibyte string. It allocates memory for the buffer and converts the multibyte string to complex characters using the mb_to_cc function. The color pair used for the complex characters is cp_norm. The caller is responsible for freeing the allocated buffer when it is no longer needed.
Definition at line 386 of file dwin.c.
References cp_win.
| Chyron * new_chyron | ( | ) |
Create and initialize Chyron structure.
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.
Definition at line 183 of file dwin.c.
References abend(), and Chyron::key.
Referenced by action_disposition(), answer_yn(), display_error(), form_display_fields(), Perror(), pick_engine(), and wait_mk_chyron().
| void set_chyron_key_cp | ( | Chyron * | chyron, |
| int | k, | ||
| char * | s, | ||
| int | kc, | ||
| int | 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 sets the label and keycode for a chyron key. The label is copied into the chyron structure, and the keycode is stored for later retrieval when theire is a mouse click. The compile_chyron function uses the keycode values to determine which key was clicked based on the mouse X position. If the label string is empty, the key is unset by setting the first character of the text to '\0'.
Definition at line 237 of file dwin.c.
References ChyronKey::cp, Chyron::key, ChyronKey::keycode, ssnprintf(), and ChyronKey::text.
Referenced by field_editor(), and form_process().
| void unset_chyron_key | ( | Chyron * | chyron, |
| int | k ) |
Unset chyron key.
| chyron | structure |
| k | chyron_key index |
Definition at line 258 of file dwin.c.
References Chyron::key, and ChyronKey::text.
Referenced by form_post(), and form_process().