|
C-Menu 0.2.9
A User Interface Toolkit
|
Display Error messages. More...
Functions | |
| bool | ui_action_disposition (char *title, char *action_str) |
| Display a simple action disposition message window or print to stderr. | |
| int | ui_answer_yn (char *msg0, char *msg1, char *msg2, char *msg3) |
| Accept a single letter answer. | |
| int | ui_display_error (char *msg0, char *msg1, char *msg2, char *msg3) |
| Display an error message window or print to stderr. | |
| int | ui_perror (char *emsg_str) |
| Display a simple error message window or print to stderr. | |
| int | ui_poll_reg_read_fd (int timeout_ms) |
| Poll for input on registered external files. | |
| void | ui_register_read_fd (int fd, int token_id) |
| Register an external file descriptor for polling. | |
| int | ui_timeout_prompt (char *msg0, char *msg1, uint timeout_ms, uint timeout_secs) |
| Display a timeout prompt window or print to stderr. | |
| void | ui_unregister_read_fd (int fd) |
| Unregister an external file descriptor from polling. | |
| int | ui_update_timeout_prompt (UiSurface *sfc, ss_t w, uint timeout_ms) |
| Update the timeout prompt with the remaining time. | |
Display Error messages.
| bool ui_action_disposition | ( | char * | title, |
| char * | action_str ) |
Display a simple action disposition message window or print to stderr.
ui_action_disposition
| title | Window title |
| action_str | Action description string |
Definition at line 1311 of file ui_common.c.
References cmd_key, em0, f_ncurses_open, f_notcurses_open, sfc_ptr, ssnprintf(), ui_cm_surface_destroy(), ui_compile_chyron(), ui_destroy_chyron(), ui_display_chyron(), ui_draw_text(), ui_get_event(), ui_get_screen_size(), ui_new_chyron(), ui_perror(), ui_set_chyron_key(), ui_surface, ui_tracked_sfc_box(), UiEvent::x, and UiEvent::y.
| int ui_answer_yn | ( | char * | msg0, |
| char * | msg1, | ||
| char * | msg2, | ||
| char * | msg3 ) |
Accept a single letter answer.
ui_answer_yn
| msg0 | First error message line |
| msg1 | Second error message line |
| msg2 | Third error message line |
| msg3 | Fourth error message line |
Definition at line 972 of file ui_common.c.
References cmd_key, f_ncurses_open, f_notcurses_open, sfc_ptr, ssnprintf(), strnz__cpy(), ui_abend(), ui_cm_surface_destroy(), ui_compile_chyron(), ui_curs_set(), ui_destroy_chyron(), ui_display_chyron(), ui_draw_text(), ui_get_event(), ui_get_screen_size(), ui_new_chyron(), ui_set_chyron_key(), ui_surface, ui_tracked_sfc_box(), UiEvent::x, and UiEvent::y.
Referenced by write_view_buffer().
| int ui_display_error | ( | char * | msg0, |
| char * | msg1, | ||
| char * | msg2, | ||
| char * | msg3 ) |
Display an error message window or print to stderr.
ui_display_error
| msg0 | First error message line |
| msg1 | Second error message line |
| msg2 | Third error message line |
| msg3 | Fourth error message line |
Definition at line 1200 of file ui_common.c.
References cmd_key, f_ncurses_open, f_notcurses_open, sfc_ptr, ssnprintf(), strnz__cpy(), ui_abend(), ui_cm_surface_destroy(), ui_compile_chyron(), ui_destroy_chyron(), ui_display_chyron(), ui_draw_text(), ui_get_event(), ui_get_screen_size(), ui_new_chyron(), ui_set_chyron_key(), ui_surface, ui_tracked_sfc_box(), UiEvent::x, and UiEvent::y.
Referenced by enter_file_spec(), form_desc_error(), form_parse_desc(), form_process(), form_read_data(), form_write(), mk_dir(), new_init(), new_pick(), new_view(), parse_menu_description(), ui_add_pair(), ui_get_event(), ui_surface_box(), ui_surface_new(), verify_dir(), verify_file(), view_cmd_processor(), view_init_input(), and write_view_buffer().
| int ui_perror | ( | char * | emsg_str | ) |
Display a simple error message window or print to stderr.
ui_perror
| emsg_str | Error message string |
Definition at line 1257 of file ui_common.c.
References f_ncurses_open, f_notcurses_open, sfc_ptr, ssnprintf(), strnz(), strnz__cpy(), ui_cm_surface_destroy(), ui_compile_chyron(), ui_destroy_chyron(), ui_display_chyron(), ui_draw_text(), ui_get_event(), ui_get_screen_size(), ui_new_chyron(), ui_set_chyron_key(), ui_surface, ui_tracked_sfc_box(), UiEvent::x, and UiEvent::y.
Referenced by display_form(), exec_objects(), field_editor(), fork_exec(), form_engine(), form_exec_receiver(), form_fmt_field(), form_process(), form_validate_field(), go_to_line(), go_to_mark(), go_to_percent(), increment_ln(), init_form(), init_pick(), initialize_line_table(), mapp_initialization(), menu_engine(), new_pick(), open_pick_win(), pad_refresh(), parse_menu_description(), popup_ckeys(), search(), ui_action_disposition(), view_cmd_processor(), view_init_input(), and write_config().
| int ui_poll_reg_read_fd | ( | int | timeout_ms | ) |
Poll for input on registered external files.
ui_poll_reg_read_fd
| timeout_ms | Timeout in milliseconds |
This function polls for input on registered external files. It uses the poll() system call to wait for input on the file descriptors of the registered external files. If input is available, it returns the token ID of the external file that has input. If no input is available within the specified timeout, it returns 0. If an error occurs during polling, it returns -1.
Definition at line 1155 of file ui_common.c.
References ui_context_t::ext_fds, ui_context_t::ext_nfds, ext_fd_reg_t::fd, ext_fd_reg_t::token_id, and ui_ctx.
Referenced by view_init_input().
| void ui_register_read_fd | ( | int | fd, |
| int | token_id ) |
Register an external file descriptor for polling.
ui_register_read_fd
| fd | File descriptor to register |
| token_id | Token ID associated with the file descriptor |
This function registers an external file descriptor for polling. It adds the file descriptor and its associated token ID to the list of registered external file descriptors. If the maximum number of registered file descriptors is reached, it does not register the new file descriptor.
Definition at line 1117 of file ui_common.c.
References ui_context_t::ext_fds, ui_context_t::ext_nfds, ssnprintf(), and ui_ctx.
Referenced by view_init_input().
| int ui_timeout_prompt | ( | char * | msg0, |
| char * | msg1, | ||
| uint | timeout_ms, | ||
| uint | timeout_secs ) |
Display a timeout prompt window or print to stderr.
ui_timeout_prompt
| msg0 | First message line |
| msg1 | Second message line |
| timeout_ms | Timeout in milliseconds |
| timeout_secs | Timeout in seconds to add if F10 is pressed |
Definition at line 1033 of file ui_common.c.
References cmd_key, em3, f_ncurses_open, f_notcurses_open, sfc_ptr, ssnprintf(), strnz__cpy(), ui_abend(), ui_cm_surface_destroy(), ui_compile_chyron(), ui_destroy_chyron(), ui_display_chyron(), ui_draw_text(), ui_get_event(), ui_get_screen_size(), ui_new_chyron(), ui_render(), ui_set_chyron_key(), ui_surface, ui_tracked_sfc_box(), ui_update_timeout_prompt(), UiEvent::x, and UiEvent::y.
Referenced by view_init_input().
| void ui_unregister_read_fd | ( | int | fd | ) |
Unregister an external file descriptor from polling.
ui_unregister_read_fd
| fd | File descriptor to unregister |
This function unregisters an external file descriptor from polling. It removes the file descriptor and its associated token ID from the list of registered external file descriptors. If the file descriptor is not found in the list, it does nothing.
Definition at line 1134 of file ui_common.c.
References ui_context_t::ext_fds, ui_context_t::ext_nfds, ext_fd_reg_t::fd, and ui_ctx.
Referenced by view_init_input().
Update the timeout prompt with the remaining time.
ui_update_timeout_prompt
| sfc | Pointer to the UiSurface structure |
| w | Window index (WIN or BOX) |
| timeout_ms | Remaining timeout in milliseconds |
This function updates the timeout prompt displayed on the specified surface and window with the remaining time in seconds. If not in a curses environment, it prints the timeout message to stderr.
Definition at line 1096 of file ui_common.c.
References em3, f_ncurses_open, f_notcurses_open, ssnprintf(), ui_draw_text(), ui_render(), and ui_wclrtoeol().
Referenced by ui_timeout_prompt().