C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
ui_ncurses_internal.h File Reference

Internal header for the NCurses UI backend. More...

#include <ncursesw/ncurses.h>
#include <ncursesw/panel.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for ui_ncurses_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RGB
union  UiChannels
struct  UiColorPair
struct  UiRuntime
 Runtime state for the NotCurses backend. More...
struct  UiStyle
struct  UiSurface
 A drawable surface in the NotCurses backend. More...
struct  UiSurfaceMeta

Macros

#define _GNU_SOURCE
#define _XOPEN_SOURCE_EXTENDED   1
#define KEY_F01   KEY_F(1)
#define KEY_F02   KEY_F(2)
#define KEY_F03   KEY_F(3)
#define KEY_F04   KEY_F(4)
#define KEY_F05   KEY_F(5)
#define KEY_F06   KEY_F(6)
#define KEY_F07   KEY_F(7)
#define KEY_F08   KEY_F(8)
#define KEY_F09   KEY_F(9)
#define KEY_F10   KEY_F(10)
#define KEY_F11   KEY_F(11)
#define KEY_F12   KEY_F(12)
#define MAXLEN   256
#define MAXSFC   30
#define NCURSES_WIDECHAR   1
#define SFC_MAX   30
#define UI_ALTCHARSET   WA_ALTCHARSET
#define UI_BLINK   WA_BLINK
#define UI_BOLD   WA_BOLD
#define UI_DIM   WA_DIM
#define UI_INVIS   WA_INVIS
#define UI_ITALIC   WA_ITALIC
#define UI_MASK   WA_ATTRIBUTES
#define UI_NONE   WA_NORMAL
#define UI_NORMAL   WA_NORMAL
#define UI_PROTECT   WA_PROTECT
#define UI_REVERSE   WA_REVERSE
#define UI_STANDOUT   WA_STANDOUT
#define UI_STRUCK   WA_INVIS
#define UI_UNDERCURL   WA_DIM
#define UI_UNDERLINE   WA_UNDERLINE
#define XLEN   128

Typedefs

typedef cchar_t UiCell

Enumerations

enum  {
  BOX , WIN , WIN2 , LNNO ,
  CMDLN , PAD , WIN3 , SUB_SFC_MAX
}

Functions

int ui_mvwadd_cell (struct UiSurface *s, uint w, uint y, uint x, UiCell *cc)
int ui_mvwadd_cellnstr (struct UiSurface *s, uint w, uint y, uint x, UiCell *cmplx_buf, uint n)
int ui_mvwadd_cellstr (struct UiSurface *s, uint w, uint y, uint x, UiCell *cmplx_buf)
int ui_ncurses_color_pair_from_style (const struct UiStyle *style)
int ui_ncurses_style_apply (struct UiSurface *s, uint w, const struct UiStyle *style)
int ui_pair_from_hex (const char *fg, const char *bg)
struct UiStyleui_style_copy (const struct UiStyle *src)
void ui_style_destroy (struct UiStyle *)
struct UiStyleui_style_from_cch (const UiCell *)
struct UiStyleui_style_new (void)
UiCell ui_style_to_cch (const struct UiStyle *)
int ui_wadd_cell (struct UiSurface *s, uint w, UiCell *cc)
int ui_wadd_cellnstr (struct UiSurface *s, uint w, UiCell *cmplx_buf, uint n)
int ui_wadd_cellstr (struct UiSurface *s, uint w, UiCell *cmplx_buf)

Variables

struct UiSurfacestdsfc

Detailed Description

Internal header for the NCurses UI backend.

This header defines the concrete (non-opaque) layouts of UiRuntime and UiSurface for the NCurses backend. It must only be included by NCurses backend source files — never by application code.

Definition in file ui_ncurses_internal.h.

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 14 of file ui_ncurses_internal.h.

◆ _XOPEN_SOURCE_EXTENDED

#define _XOPEN_SOURCE_EXTENDED   1

Definition at line 13 of file ui_ncurses_internal.h.

◆ KEY_F01

#define KEY_F01   KEY_F(1)

Definition at line 25 of file ui_ncurses_internal.h.

◆ KEY_F02

#define KEY_F02   KEY_F(2)

Definition at line 26 of file ui_ncurses_internal.h.

◆ KEY_F03

#define KEY_F03   KEY_F(3)

Definition at line 27 of file ui_ncurses_internal.h.

◆ KEY_F04

#define KEY_F04   KEY_F(4)

Definition at line 28 of file ui_ncurses_internal.h.

◆ KEY_F05

#define KEY_F05   KEY_F(5)

Definition at line 29 of file ui_ncurses_internal.h.

◆ KEY_F06

#define KEY_F06   KEY_F(6)

Definition at line 30 of file ui_ncurses_internal.h.

◆ KEY_F07

#define KEY_F07   KEY_F(7)

Definition at line 31 of file ui_ncurses_internal.h.

◆ KEY_F08

#define KEY_F08   KEY_F(8)

Definition at line 32 of file ui_ncurses_internal.h.

◆ KEY_F09

#define KEY_F09   KEY_F(9)

Definition at line 33 of file ui_ncurses_internal.h.

◆ KEY_F10

#define KEY_F10   KEY_F(10)

Definition at line 34 of file ui_ncurses_internal.h.

◆ KEY_F11

#define KEY_F11   KEY_F(11)

Definition at line 35 of file ui_ncurses_internal.h.

◆ KEY_F12

#define KEY_F12   KEY_F(12)

Definition at line 36 of file ui_ncurses_internal.h.

◆ MAXLEN

#define MAXLEN   256

Definition at line 22 of file ui_ncurses_internal.h.

◆ MAXSFC

#define MAXSFC   30

Definition at line 23 of file ui_ncurses_internal.h.

◆ NCURSES_WIDECHAR

#define NCURSES_WIDECHAR   1

Definition at line 15 of file ui_ncurses_internal.h.

◆ SFC_MAX

#define SFC_MAX   30

Definition at line 60 of file ui_ncurses_internal.h.

◆ UI_ALTCHARSET

#define UI_ALTCHARSET   WA_ALTCHARSET

Definition at line 161 of file ui_ncurses_internal.h.

◆ UI_BLINK

#define UI_BLINK   WA_BLINK

Definition at line 158 of file ui_ncurses_internal.h.

◆ UI_BOLD

#define UI_BOLD   WA_BOLD

Definition at line 160 of file ui_ncurses_internal.h.

◆ UI_DIM

#define UI_DIM   WA_DIM

Definition at line 159 of file ui_ncurses_internal.h.

◆ UI_INVIS

#define UI_INVIS   WA_INVIS

Definition at line 162 of file ui_ncurses_internal.h.

◆ UI_ITALIC

#define UI_ITALIC   WA_ITALIC

Definition at line 167 of file ui_ncurses_internal.h.

◆ UI_MASK

#define UI_MASK   WA_ATTRIBUTES

Definition at line 153 of file ui_ncurses_internal.h.

◆ UI_NONE

#define UI_NONE   WA_NORMAL

Definition at line 166 of file ui_ncurses_internal.h.

◆ UI_NORMAL

#define UI_NORMAL   WA_NORMAL

Definition at line 154 of file ui_ncurses_internal.h.

◆ UI_PROTECT

#define UI_PROTECT   WA_PROTECT

Definition at line 163 of file ui_ncurses_internal.h.

◆ UI_REVERSE

#define UI_REVERSE   WA_REVERSE

Definition at line 157 of file ui_ncurses_internal.h.

◆ UI_STANDOUT

#define UI_STANDOUT   WA_STANDOUT

Definition at line 155 of file ui_ncurses_internal.h.

◆ UI_STRUCK

#define UI_STRUCK   WA_INVIS

Definition at line 165 of file ui_ncurses_internal.h.

◆ UI_UNDERCURL

#define UI_UNDERCURL   WA_DIM

Definition at line 164 of file ui_ncurses_internal.h.

◆ UI_UNDERLINE

#define UI_UNDERLINE   WA_UNDERLINE

Definition at line 156 of file ui_ncurses_internal.h.

◆ XLEN

#define XLEN   128

Definition at line 21 of file ui_ncurses_internal.h.

Typedef Documentation

◆ UiCell

typedef cchar_t UiCell

Definition at line 213 of file ui_ncurses_internal.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BOX 
WIN 
WIN2 
LNNO 
CMDLN 
PAD 
WIN3 
SUB_SFC_MAX 

Definition at line 62 of file ui_ncurses_internal.h.

62 {
63 BOX,
64 WIN,
65 WIN2,
66 LNNO,
67 CMDLN,
68 PAD,
69 WIN3,
71};

Function Documentation

◆ ui_mvwadd_cell()

int ui_mvwadd_cell ( struct UiSurface * s,
uint w,
uint y,
uint x,
UiCell * cc )

◆ ui_mvwadd_cellnstr()

int ui_mvwadd_cellnstr ( struct UiSurface * s,
uint w,
uint y,
uint x,
UiCell * cmplx_buf,
uint n )

◆ ui_mvwadd_cellstr()

int ui_mvwadd_cellstr ( struct UiSurface * s,
uint w,
uint y,
uint x,
UiCell * cmplx_buf )

◆ ui_ncurses_color_pair_from_style()

int ui_ncurses_color_pair_from_style ( const struct UiStyle * style)

◆ ui_ncurses_style_apply()

int ui_ncurses_style_apply ( struct UiSurface * s,
uint w,
const struct UiStyle * style )

◆ ui_pair_from_hex()

int ui_pair_from_hex ( const char * fg,
const char * bg )

Definition at line 230 of file ui_ncurses.c.

230 {
231 RGB rgb;
232 sscanf(fg, "#%02x%02x%02x", &rgb.r, &rgb.g, &rgb.b);
233 int f_idx = ui_add_color_rgb(&rgb);
234 sscanf(bg, "#%02x%02x%02x", &rgb.r, &rgb.g, &rgb.b);
235 int b_idx = ui_add_color_rgb(&rgb);
236 return ui_add_pair(f_idx, b_idx);
237}
int ui_add_color_rgb(RGB *rgb)
Definition ui_ncurses.c:138
uint ui_add_pair(uint fg, uint bg)
Definition ui_ncurses.c:105

References ui_add_color_rgb(), and ui_add_pair().

Here is the call graph for this function:

◆ ui_style_copy()

struct UiStyle * ui_style_copy ( const struct UiStyle * src)

◆ ui_style_destroy()

void ui_style_destroy ( struct UiStyle * )

◆ ui_style_from_cch()

struct UiStyle * ui_style_from_cch ( const UiCell * )

◆ ui_style_new()

struct UiStyle * ui_style_new ( void )

◆ ui_style_to_cch()

UiCell ui_style_to_cch ( const struct UiStyle * )

◆ ui_wadd_cell()

int ui_wadd_cell ( struct UiSurface * s,
uint w,
UiCell * cc )

◆ ui_wadd_cellnstr()

int ui_wadd_cellnstr ( struct UiSurface * s,
uint w,
UiCell * cmplx_buf,
uint n )

◆ ui_wadd_cellstr()

int ui_wadd_cellstr ( struct UiSurface * s,
uint w,
UiCell * cmplx_buf )

Variable Documentation

◆ stdsfc

struct UiSurface* stdsfc
extern

Definition at line 36 of file ui_ncurses.c.