|
C-Menu 0.2.9
A User Interface Toolkit
|
NCurses UI backend — drawing functions. More...
#include "cm.h"#include "ui_backend.h"#include "ui_ncurses_internal.h"#include <stdlib.h>#include <string.h>#include <wchar.h>Go to the source code of this file.
Macros | |
| #define | _XOPEN_SOURCE_EXTENDED 1 |
Functions | |
| int | ui_draw_ch (UiSurface *s, ss_t w, const char c) |
| Draw a character in a surface window. | |
| int | ui_draw_ch_yx (UiSurface *s, ss_t w, uint y, uint x, const char c) |
| Draw a character at a specific position in a surface window. | |
| 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 n) |
| 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. | |
| int | ui_draw_text_n (UiSurface *s, ss_t w, uint y, uint x, const char *text, int n) |
| Draw a text string at a specific position in a surface window. | |
| int | ui_mvwadd_wch (UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell) |
| Draw a complex character at a specific position in a surface window. | |
| int | ui_mvwadd_wchnstr (UiSurface *s, ss_t w, uint y, uint x, const UiCell *cmplx_buf, uint n) |
| Draw a complex character string at a specific position in a surface window, with a maximum length. | |
| int | ui_mvwadd_wchstr (UiSurface *s, ss_t w, uint y, uint x, const UiCell *cmplx_buf) |
| Draw a complex character string at a specific position in a surface window. | |
| int | ui_mvwaddch (UiSurface *s, ss_t w, uint y, uint x, const char c) |
| Draw a character in a surface window. | |
| int | ui_mvwaddnstr (UiSurface *s, ss_t w, uint y, uint x, const char *text, int m) |
| Draw a text string at a specific position in a surface window, with a maximum length. | |
| int | ui_mvwaddnwstr (UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr, int m) |
| Draw a wide-character string at a specific position in a surface window, with a maximum length. | |
| int | ui_mvwaddstr (UiSurface *s, ss_t w, uint y, uint x, const char *text) |
| Draw a text string at a specific position in a surface window. | |
| int | ui_mvwaddstr_fill (UiSurface *s, ss_t w, uint y, uint x, const char *str, int 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 m. | |
| int | ui_mvwaddwstr (UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr) |
| Draw a wide-character string at a specific position in a surface window. | |
| 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) |
| Draw a complex character in a surface window. | |
| int | ui_wadd_wchnstr (UiSurface *s, ss_t w, const UiCell *cmplx_buf, uint n) |
| Draw a complex character string in a surface window, with a maximum length. | |
| int | ui_wadd_wchstr (UiSurface *s, ss_t w, const UiCell *cmplx_buf) |
| Draw a complex character string in a surface window. | |
| int | ui_waddnstr (UiSurface *s, ss_t w, const char *text, int m) |
| Draw a text string in a surface window, with a maximum length. | |
| int | ui_waddnwstr (UiSurface *s, ss_t w, const wchar_t *wstr, int m) |
| Draw a wide-character string in a surface window, with a maximum length. | |
| int | ui_waddstr (UiSurface *s, ss_t w, const char *text) |
| Draw a text string in a surface window. | |
| int | ui_waddwstr (UiSurface *s, ss_t w, const wchar_t *wstr) |
| Draw a wide-character string in a surface window. | |
| int | ui_wclrtobot (UiSurface *s, ss_t w) |
| Set the style of a surface window. | |
| int | ui_wclrtoeol (UiSurface *s, ss_t w) |
| Clear to the end of the line in a surface window. | |
NCurses UI backend — drawing functions.
Implements the drawing operations declared in ui_backend.h using the NCurses wide-character API.
Definition in file ui_ncurses_draw.c.
| #define _XOPEN_SOURCE_EXTENDED 1 |
Definition at line 9 of file ui_ncurses_draw.c.
Draw a character in a surface window.
| s | The surface to modify. |
| w | The window index within the surface. |
| c | The character to draw. |
Definition at line 53 of file ui_ncurses_draw.c.
Draw a character at a specific position in a surface window.
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the character. |
| x | The x-coordinate (column) to draw the character. |
| c | The character to draw. |
Definition at line 67 of file ui_ncurses_draw.c.
on specified window, move to y, x, add string
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
Definition at line 74 of file ui_ncurses_draw.c.
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 | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the text. |
| x | The x-coordinate (column) to draw the text. |
| text | The text string to draw. |
| n | The number of characters to draw, padding with spaces if necessary. |
Definition at line 103 of file ui_ncurses_draw.c.
Draw a text string at a specific position in a surface window.
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the text. |
| x | The x-coordinate (column) to draw the text. |
| text | The text string to draw. |
Definition at line 88 of file ui_ncurses_draw.c.
Draw a complex character at a specific position in a surface window.
on specified window, move to y, x, add cell
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the complex character. |
| x | The x-coordinate (column) to draw the complex character. |
| cell | The complex character (UiCell) to draw. |
| s | surface |
| w | window |
| y | row |
| x | column |
| cell | cell string |
Definition at line 305 of file ui_ncurses_draw.c.
Referenced by display_form(), and get_cmd_char().
Draw a complex character string at a specific position in a surface window, with a maximum length.
on specified window, move to y, x, add cell string, at most m columns
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the complex character string. |
| x | The x-coordinate (column) to draw the complex character string. |
| cmplx_buf | The complex character string (array of UiCell) to draw. |
| n | The maximum number of complex characters to draw from the complex character string. |
| s | surface |
| w | window |
| y | row |
| x | column |
| cell | cell string |
| m | maximum number of columns to write |
Definition at line 359 of file ui_ncurses_draw.c.
Referenced by deselect_object(), form_display_accept_field(), form_display_field(), form_display_fields(), get_cmd_arg(), get_cmd_char(), picker(), remove_right_angle(), reverse_object(), toggle_object(), ui_border_draw(), ui_border_title(), ui_border_ysplit(), ui_border_ysplit_text(), unreverse_object(), and view_cmd_processor().
Draw a complex character string at a specific position in a surface window.
on specified window, move to y, x, add cell string
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the complex character string. |
| x | The x-coordinate (column) to draw the complex character string. |
| cmplx_buf | The complex character string (array of UiCell) to draw. |
| s | surface |
| w | window |
| y | row |
| x | column |
| cell | cell string |
Definition at line 331 of file ui_ncurses_draw.c.
Referenced by display_field(), display_line(), form_display_fields(), and ui_display_chyron().
Draw a character in a surface window.
on specified window, move to y, x, add character
| s | The surface to modify. |
| w | The window index within the surface. |
| c | The character to draw. |
| s | surface |
| w | window |
| y | row |
| x | column |
| c | character |
Definition at line 132 of file ui_ncurses_draw.c.
Referenced by get_cmd_char(), and menu_engine().
Draw a text string at a specific position in a surface window, with a maximum length.
on specified window, move to y, x, add string, at most m columns
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the text. |
| x | The x-coordinate (column) to draw the text. |
| text | The text string to draw. |
| m | The maximum number of characters to draw from the text string. |
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
| m | maximum number of columns to write |
Definition at line 189 of file ui_ncurses_draw.c.
Draw a wide-character string at a specific position in a surface window, with a maximum length.
on specified window, move to y, x, add string, at most m columns
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the wide-character string. |
| x | The x-coordinate (column) to draw the wide-character string. |
| wstr | The wide-character string to draw. |
| m | The maximum number of wide characters to draw from the wide-character string. |
| s | surface |
| w | window |
| y | row |
| x | column |
| wchar_t | string |
| m | maximum number of columns to write |
Definition at line 276 of file ui_ncurses_draw.c.
Referenced by ui_border_title(), and ui_border_ysplit_text().
Draw a text string at a specific position in a surface window.
on specified window, move to y, x, add string
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the text. |
| x | The x-coordinate (column) to draw the text. |
| text | The text string to draw. |
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
Definition at line 174 of file ui_ncurses_draw.c.
Referenced by cf_accept(), display_form(), display_line(), display_pick_page(), display_prompt(), display_split_line(), main(), pick_engine(), picker(), and popup_ckeys().
Draw a text string at a specific position in a surface window, filling the remaining space with spaces if the string is shorter than m.
on specified window, move to y, x, add string, at most m columns, fill with spaces if text is shorter than m
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the text. |
| x | The x-coordinate (column) to draw the text. |
| str | The text string to draw. |
| m | The number of characters to draw, padding with spaces if necessary. |
| s | surface |
| w | window |
| y | row |
| x | column |
| text | string |
| m | maximum number of columns to write |
Definition at line 204 of file ui_ncurses_draw.c.
Referenced by display_pick_page(), picker(), reverse_object(), and unreverse_object().
Draw a wide-character string at a specific position in a surface window.
on specified window, move to y, x, add wchar_t string
| s | The surface to modify. |
| w | The window index within the surface. |
| y | The y-coordinate (row) to draw the wide-character string. |
| x | The x-coordinate (column) to draw the wide-character string. |
| wstr | The wide-character string to draw. |
| s | surface |
| w | window |
| wchar_t | string |
Definition at line 248 of file ui_ncurses_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 371 of file ui_ncurses_draw.c.
Draw a complex character in a surface window.
on specified window, at current location, add cell
| s | The surface to modify. |
| w | The window index within the surface. |
| cell | The complex character (UiCell) to draw. |
| s | surface |
| w | window |
| cell | cell string |
Definition at line 291 of file ui_ncurses_draw.c.
Draw a complex character string in a surface window, with a maximum length.
on specified window, add cell string, at most m columns
| s | The surface to modify. |
| w | The window index within the surface. |
| cmplx_buf | The complex character string (array of UiCell) to draw. |
| n | The maximum number of complex characters to draw from the complex character string. |
| s | surface |
| w | window |
| cell | cell string |
| m | maximum number of columns to write |
Definition at line 344 of file ui_ncurses_draw.c.
Referenced by display_split_line().
Draw a complex character string in a surface window.
on specified window, at current location, add cell string
| s | The surface to modify. |
| w | The window index within the surface. |
| cmplx_buf | The complex character string (array of UiCell) to draw. |
| s | surface |
| w | window |
| cell | cell string |
Definition at line 317 of file ui_ncurses_draw.c.
Draw a text string in a surface window, with a maximum length.
on specified window, at current location, add string, at most m columns
| s | The surface to modify. |
| w | The window index within the surface. |
| text | The text string to draw. |
| m | The maximum number of characters to draw from the text string. |
| s | surface |
| w | window |
| text | string |
| m | maximum number of columns to write |
Definition at line 160 of file ui_ncurses_draw.c.
Draw a wide-character string in a surface window, with a maximum length.
on specified window, at current location, add wchar_t string, at most m columns
| s | The surface to modify. |
| w | The window index within the surface. |
| wstr | The wide-character string to draw. |
| m | The maximum number of wide characters to draw from the wide-character string. |
| s | surface |
| w | window |
| wchar_t | string |
| m | maximum number of columns to write |
Definition at line 261 of file ui_ncurses_draw.c.
Draw a text string in a surface window.
on specified window, at current location, add string
| s | The surface to modify. |
| w | The window index within the surface. |
| text | The text string to draw. |
| s | surface |
| w | window |
| text | string |
Definition at line 147 of file ui_ncurses_draw.c.
Referenced by display_prompt(), and get_cmd_arg().
Draw a wide-character string in a surface window.
on specified window, at current location, add wchar_t string
| s | The surface to modify. |
| w | The window index within the surface. |
| wstr | The wide-character string to draw. |
| s | surface |
| w | window |
| wchar_t | string |
Definition at line 234 of file ui_ncurses_draw.c.
Set the style of a surface window.
| s | The surface to modify. |
| w | The window index within the surface. |
| style | The style to apply (UiStyle). |
Definition at line 27 of file ui_ncurses_draw.c.
Clear to the end of the line in a surface window.
| s | The surface to modify. |
| w | The window index within the surface. |
Definition at line 38 of file ui_ncurses_draw.c.