|
C-Menu 0.2.9
A User Interface Toolkit
|
NotCurses UI backend — drawing functions. More...
#include "ui_backend.h"#include "ui_notcurses_internal.h"#include <notcurses/notcurses.h>#include <stddef.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| #define | _XOPEN_SOURCE_EXTENDED 1 |
Functions | |
| int | mk_chimera (UiCell *cell, char c) |
| create a cell with specified character, using background cell style and channels | |
| struct ncvisual * | ui_display_image (struct notcurses *nc, UiMultiMedia *mm, const char *image_file, int y, int x, int begy, int begx) |
| display an image on the terminal using NotCurses | |
| int | ui_draw_ch (UiSurface *s, ss_t w, char c) |
| on specified window, at current location, add character | |
| int | ui_draw_ch_yx (UiSurface *s, ss_t w, uint y, uint x, char c) |
| on specified window, move to y, x, add character | |
| int | ui_draw_text (UiSurface *s, ss_t w, uint y, uint x, const char *text) |
| on specified window, move to y, x, add string | |
| int | ui_draw_text_fill (UiSurface *s, ss_t w, uint y, uint x, const char *text, int m) |
| on specified window, move to y, x, add string, at most m columns, fill with spaces if text is shorter than m | |
| int | ui_draw_text_n (UiSurface *s, ss_t w, uint y, uint x, const char *text, int m) |
| on specified window, move to y, x, add string, at most m columns | |
| int | ui_mvwadd_wch (UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell) |
| on specified window, move to y, x, add cell | |
| int | ui_mvwadd_wchnstr (UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell, uint m) |
| on specified window, move to y, x, add cell string, at most m columns | |
| int | ui_mvwadd_wchstr (UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell) |
| on specified window, move to y, x, add cell string | |
| int | ui_mvwaddch (UiSurface *s, ss_t w, uint y, uint x, const char c) |
| on specified window, move to y, x, add character | |
| int | ui_mvwaddnstr (UiSurface *s, ss_t w, uint y, uint x, const char *text, int m) |
| on specified window, move to y, x, add string, at most m columns | |
| int | ui_mvwaddnwstr (UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr, int m) |
| on specified window, move to y, x, add string, at most m columns | |
| int | ui_mvwaddstr (UiSurface *s, ss_t w, uint y, uint x, const char *text) |
| on specified window, move to y, x, add string | |
| int | ui_mvwaddstr_fill (UiSurface *s, ss_t w, uint y, uint x, const char *text, int m) |
| on specified window, move to y, x, add string, at most m columns, fill with spaces if text is shorter than m | |
| int | ui_mvwaddwstr (UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr) |
| on specified window, move to y, x, add wchar_t string | |
| void | ui_restore_wins () |
| Restore the state of all windows in the UI. This function refreshes the standard screen and all surface windows, ensuring that their contents are displayed correctly. | |
| int | ui_wadd_wch (UiSurface *s, ss_t w, const UiCell *cell) |
| on specified window, at current location, add cell | |
| int | ui_wadd_wchnstr (UiSurface *s, ss_t w, const UiCell *cell, uint m) |
| on specified window, add cell string, at most m columns | |
| int | ui_wadd_wchstr (UiSurface *s, ss_t w, const UiCell *cell) |
| on specified window, at current location, add cell string | |
| int | ui_waddch (UiSurface *s, ss_t w, const char c) |
| on specified window, at current location, add character | |
| int | ui_waddnstr (UiSurface *s, ss_t w, const char *text, int m) |
| on specified window, at current location, add string, at most m columns | |
| int | ui_waddnwstr (UiSurface *s, ss_t w, const wchar_t *wstr, int m) |
| on specified window, at current location, add wchar_t string, at most m columns | |
| int | ui_waddstr (UiSurface *s, ss_t w, const char *text) |
| on specified window, at current location, add string | |
| int | ui_waddwstr (UiSurface *s, ss_t w, const wchar_t *wstr) |
| on specified window, at current location, add wchar_t string | |
| int | ui_wclrtobot (UiSurface *s, ss_t w) |
| clear from current cursor position to bottom of window | |
| int | ui_wclrtoeol (UiSurface *s, ss_t w) |
| clear the window from the current cursor position to the end of the window | |
NotCurses UI backend — drawing functions.
Implements the drawing operations declared in ui_backend.h using the NotCurses API.
Definition in file ui_notcurses_draw.c.
| #define _GNU_SOURCE |
Definition at line 8 of file ui_notcurses_draw.c.
| #define _XOPEN_SOURCE_EXTENDED 1 |
Definition at line 9 of file ui_notcurses_draw.c.
| int mk_chimera | ( | UiCell * | cell, |
| char | c ) |
create a cell with specified character, using background cell style and channels
| cell | pointer to UiCell |
| c | character |
Definition at line 66 of file ui_notcurses_draw.c.
| struct ncvisual * ui_display_image | ( | struct notcurses * | nc, |
| UiMultiMedia * | mm, | ||
| const char * | image_file, | ||
| int | y, | ||
| int | x, | ||
| int | begy, | ||
| int | begx ) |
display an image on the terminal using NotCurses
| nc | NotCurses context |
| mm | UiMultiMedia structure to hold the image and surface |
| image_file | path to the image file |
| y | height of the image display area (or -1 for full height) |
| x | width of the image display area (or -1 for full width) |
| begy | starting row for the image display area (or -1 for top) |
| begx | starting column for the image display area (or -1 for left) |
Definition at line 466 of file ui_notcurses_draw.c.
References UiMultiMedia::ncv, UiMultiMedia::sfc, stdsfc, ui_surface_addwin(), and ui_surface_box().
on specified window, at current location, add character
Draw a character in a surface window.
| s | surface |
| w | window |
| c | character |
Definition at line 79 of file ui_notcurses_draw.c.
on specified window, move to y, x, add character
Draw a character at a specific position in a surface window.
| s | surface |
| w | window |
| y | row |
| x | column |
| c | character |
Definition at line 94 of file ui_notcurses_draw.c.
Referenced by menu_cmd_processor().
on specified window, move to y, x, add string
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
Definition at line 109 of file ui_notcurses_draw.c.
Referenced by ui_action_disposition(), ui_answer_yn(), ui_display_error(), ui_perror(), ui_timeout_prompt(), and ui_update_timeout_prompt().
on specified window, move to y, x, add string, at most m columns, fill with spaces if text is shorter than m
Draw a text string at a specific position in a surface window, filling the remaining space with spaces if the string is shorter than n.
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
| m | maximum number of columns to write |
Definition at line 139 of file ui_notcurses_draw.c.
References ui_render().
Referenced by menu_cmd_processor(), and menu_engine().
on specified window, move to y, x, add string, at most m columns
Draw a text string at a specific position in a surface window.
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
| m | maximum number of columns to write |
Definition at line 124 of file ui_notcurses_draw.c.
on specified window, move to y, x, add cell
| s | surface |
| w | window |
| y | row |
| x | column |
| cell | cell string |
Definition at line 363 of file ui_notcurses_draw.c.
on specified window, move to y, x, add cell string, at most m columns
| s | surface |
| w | window |
| y | row |
| x | column |
| cell | cell string |
| m | maximum number of columns to write |
Definition at line 430 of file ui_notcurses_draw.c.
References ui_wmove().
on specified window, move to y, x, add cell string
| s | surface |
| w | window |
| y | row |
| x | column |
| cell | cell string |
Definition at line 393 of file ui_notcurses_draw.c.
References ui_wmove().
on specified window, move to y, x, add character
| s | surface |
| w | window |
| y | row |
| x | column |
| c | character |
Definition at line 175 of file ui_notcurses_draw.c.
on specified window, move to y, x, add string, at most m columns
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
| m | maximum number of columns to write |
Definition at line 230 of file ui_notcurses_draw.c.
on specified window, move to y, x, add string, at most m columns
| s | surface |
| w | window |
| y | row |
| x | column |
| wchar_t | string |
| m | maximum number of columns to write |
Definition at line 324 of file ui_notcurses_draw.c.
on specified window, move to y, x, add string
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
Definition at line 215 of file ui_notcurses_draw.c.
on specified window, move to y, x, add string, at most m columns, fill with spaces if text is shorter than m
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
| m | maximum number of columns to write |
Definition at line 245 of file ui_notcurses_draw.c.
on specified window, move to y, x, add wchar_t string
| s | surface |
| w | window |
| wchar_t | string |
Definition at line 285 of file ui_notcurses_draw.c.
| void ui_restore_wins | ( | ) |
Restore the state of all windows in the UI. This function refreshes the standard screen and all surface windows, ensuring that their contents are displayed correctly.
Definition at line 445 of file ui_notcurses_draw.c.
References sfc_ptr, SUB_SFC_MAX, ui_render(), and ui_surface.
Referenced by enter_file_spec(), exec_objects(), fork_exec(), form_exec_receiver(), full_screen_shell(), menu_cmd_processor(), menu_engine(), view_cmd_processor(), view_init_input(), and write_view_buffer().
on specified window, at current location, add cell
| s | surface |
| w | window |
| cell | cell string |
Definition at line 349 of file ui_notcurses_draw.c.
on specified window, add cell string, at most m columns
| s | surface |
| w | window |
| cell | cell string |
| m | maximum number of columns to write |
Definition at line 410 of file ui_notcurses_draw.c.
on specified window, at current location, add cell string
| s | surface |
| w | window |
| cell | cell string |
Definition at line 376 of file ui_notcurses_draw.c.
on specified window, at current location, add character
| s | surface |
| w | window |
| c | character |
Definition at line 160 of file ui_notcurses_draw.c.
on specified window, at current location, add string, at most m columns
| s | surface |
| w | window |
| text | string |
| m | maximum number of columns to write |
Definition at line 201 of file ui_notcurses_draw.c.
on specified window, at current location, add wchar_t string, at most m columns
| s | surface |
| w | window |
| wchar_t | string |
| m | maximum number of columns to write |
Definition at line 300 of file ui_notcurses_draw.c.
on specified window, at current location, add string
| s | surface |
| w | window |
| text | string |
Definition at line 188 of file ui_notcurses_draw.c.
on specified window, at current location, add wchar_t string
| s | surface |
| w | window |
| wchar_t | string |
Definition at line 272 of file ui_notcurses_draw.c.
clear from current cursor position to bottom of window
Set the style of a surface window.
| s | surface |
| w | window |
Definition at line 42 of file ui_notcurses_draw.c.
Referenced by display_line_eod(), scroll_next(), scroll_prev(), and search().
clear the window from the current cursor position to the end of the window
Clear to the end of the line in a surface window.
| s | surface |
| w | window |
Definition at line 26 of file ui_notcurses_draw.c.
Referenced by cf_accept(), display_line(), display_prompt(), display_split_line(), form_post(), get_cmd_arg(), get_cmd_char(), pick_engine(), picker(), ui_display_chyron(), and ui_update_timeout_prompt().