Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
Cell Class Reference

#include <Cell.hh>

Inheritance diagram for Cell:
Collaboration diagram for Cell:

Public Member Functions

 Cell (NotCurses *ncinst=nullptr) noexcept
 
 Cell (uint32_t c, NotCurses *ncinst=nullptr) noexcept
 
 Cell (uint32_t c, uint16_t a, uint64_t chan, NotCurses *ncinst=nullptr) noexcept
 
 operator nccell * () noexcept
 
 operator nccell const * () const noexcept
 
nccellget () noexcept
 
void init () noexcept
 
uint16_t get_stylemask () const noexcept
 
uint64_t get_channels () const noexcept
 
void set_styles (CellStyle styles) noexcept
 
CellStyle get_styles () noexcept
 
void styles_on (CellStyle styles) noexcept
 
void styles_off (CellStyle styles) noexcept
 
bool is_double_wide () const noexcept
 
unsigned get_fg_rgb () const noexcept
 
unsigned get_bg_rgb () const noexcept
 
unsigned get_fg_alpha () const noexcept
 
bool is_fg_default () const noexcept
 
bool set_fg_alpha (unsigned alpha) noexcept
 
unsigned get_bg_alpha () const noexcept
 
bool set_bg_alpha (unsigned alpha) noexcept
 
unsigned get_fg_rgb8 (unsigned *r, unsigned *g, unsigned *b) const noexcept
 
bool set_fg_rgb8 (int r, int g, int b, bool clipped=false) noexcept
 
void set_fg_rgb (uint32_t channel) noexcept
 
void set_fg_default () noexcept
 
unsigned get_bg_rgb8 (unsigned *r, unsigned *g, unsigned *b) const noexcept
 
bool set_bg_rgb8 (int r, int g, int b, bool clipped=false) noexcept
 
void set_bg_rgb (uint32_t channel) noexcept
 
void set_bg_default () noexcept
 
bool is_bg_default () const noexcept
 
bool is_wide_right () const noexcept
 
bool is_wide_left () const noexcept
 
- Public Member Functions inherited from Root
notcursesget_notcurses () const
 
NotCursesget_notcurses_cpp () const
 

Static Public Attributes

static constexpr int AlphaHighContrast = NCALPHA_HIGHCONTRAST
 
static constexpr int AlphaTransparent = NCALPHA_TRANSPARENT
 
static constexpr int AlphaBlend = NCALPHA_BLEND
 
static constexpr int AlphaOpaque = NCALPHA_OPAQUE
 

Additional Inherited Members

- Protected Member Functions inherited from Root
 Root (NotCurses *ncinst)
 
bool is_notcurses_stopped () const noexcept
 
- Static Protected Member Functions inherited from Root
template<typename TRet = bool, typename TValue = int>
static TRet error_guard (TValue ret, TValue error_value)
 
template<typename TRet = bool, typename TValue = int>
static TRet error_guard_cond (TValue ret, bool error_value)
 
- Static Protected Attributes inherited from Root
static constexpr char ncpp_invalid_state_message [] = "notcurses++ is in an invalid state (already stopped?)"
 

Detailed Description

Definition at line 15 of file Cell.hh.

Constructor & Destructor Documentation

◆ Cell() [1/3]

Cell ( NotCurses ncinst = nullptr)
inlinenoexcept

Definition at line 24 of file Cell.hh.

25 : Root (ncinst)
26 {
27 init ();
28 }
void init() noexcept
Definition Cell.hh:57
Root(NotCurses *ncinst)
Definition Root.hh:34
static TRet error_guard(TValue ret, TValue error_value)
Definition Root.hh:39

◆ Cell() [2/3]

Cell ( uint32_t  c,
NotCurses ncinst = nullptr 
)
inlineexplicitnoexcept

Definition at line 30 of file Cell.hh.

31 : Root (ncinst)
32 {
33 _cell = NCCELL_CHAR_INITIALIZER (c);
34 }
const nccell * c
Definition egcpool.h:296
#define NCCELL_CHAR_INITIALIZER(c)
Definition notcurses.h:734

◆ Cell() [3/3]

Cell ( uint32_t  c,
uint16_t  a,
uint64_t  chan,
NotCurses ncinst = nullptr 
)
inlineexplicitnoexcept

Definition at line 36 of file Cell.hh.

37 : Root (ncinst)
38 {
39 _cell = NCCELL_INITIALIZER (c, a, chan);
40 }
#define NCCELL_INITIALIZER(c, s, chan)
Definition notcurses.h:731

Member Function Documentation

◆ get()

nccell & get ( )
inlinenoexcept

Definition at line 52 of file Cell.hh.

53 {
54 return _cell;
55 }

◆ get_bg_alpha()

unsigned get_bg_alpha ( ) const
inlinenoexcept

Definition at line 122 of file Cell.hh.

123 {
124 return nccell_bg_alpha (&_cell);
125 }

◆ get_bg_rgb()

unsigned get_bg_rgb ( ) const
inlinenoexcept

Definition at line 102 of file Cell.hh.

103 {
104 return nccell_bg_rgb (&_cell);
105 }

◆ get_bg_rgb8()

unsigned get_bg_rgb8 ( unsigned r,
unsigned g,
unsigned b 
) const
inlinenoexcept

Definition at line 157 of file Cell.hh.

158 {
159 return nccell_bg_rgb8 (&_cell, r, g, b);
160 }
int r
Definition fbuf.h:226

◆ get_channels()

uint64_t get_channels ( ) const
inlinenoexcept

Definition at line 67 of file Cell.hh.

68 {
69 return _cell.channels;
70 }
uint64_t channels
Definition notcurses.h:723

◆ get_fg_alpha()

unsigned get_fg_alpha ( ) const
inlinenoexcept

Definition at line 107 of file Cell.hh.

108 {
109 return nccell_fg_alpha (&_cell);
110 }

◆ get_fg_rgb()

unsigned get_fg_rgb ( ) const
inlinenoexcept

Definition at line 97 of file Cell.hh.

98 {
99 return nccell_fg_rgb (&_cell);
100 }

◆ get_fg_rgb8()

unsigned get_fg_rgb8 ( unsigned r,
unsigned g,
unsigned b 
) const
inlinenoexcept

Definition at line 132 of file Cell.hh.

133 {
134 return nccell_fg_rgb8 (&_cell, r, g, b);
135 }

◆ get_stylemask()

uint16_t get_stylemask ( ) const
inlinenoexcept

Definition at line 62 of file Cell.hh.

63 {
64 return _cell.stylemask;
65 }
uint16_t stylemask
Definition notcurses.h:703

◆ get_styles()

CellStyle get_styles ( )
inlinenoexcept

Definition at line 77 of file Cell.hh.

78 {
79 return static_cast<CellStyle>(nccell_styles (&_cell));
80 }
CellStyle
Definition CellStyle.hh:13

◆ init()

void init ( )
inlinenoexcept

Definition at line 57 of file Cell.hh.

58 {
59 nccell_init (&_cell);
60 }

◆ is_bg_default()

bool is_bg_default ( ) const
inlinenoexcept

Definition at line 182 of file Cell.hh.

183 {
184 return nccell_bg_default_p (&_cell);
185 }

◆ is_double_wide()

bool is_double_wide ( ) const
inlinenoexcept

Definition at line 92 of file Cell.hh.

93 {
94 return nccell_double_wide_p (&_cell);
95 }

◆ is_fg_default()

bool is_fg_default ( ) const
inlinenoexcept

Definition at line 112 of file Cell.hh.

113 {
114 return nccell_fg_default_p (&_cell);
115 }

◆ is_wide_left()

bool is_wide_left ( ) const
inlinenoexcept

Definition at line 192 of file Cell.hh.

193 {
194 return nccell_wide_left_p (&_cell);
195 }

◆ is_wide_right()

bool is_wide_right ( ) const
inlinenoexcept

Definition at line 187 of file Cell.hh.

188 {
189 return nccell_wide_right_p (&_cell);
190 }

◆ operator nccell *()

operator nccell * ( )
inlinenoexcept

Definition at line 42 of file Cell.hh.

43 {
44 return &_cell;
45 }

◆ operator nccell const *()

operator nccell const * ( ) const
inlinenoexcept

Definition at line 47 of file Cell.hh.

48 {
49 return &_cell;
50 }

◆ set_bg_alpha()

bool set_bg_alpha ( unsigned  alpha)
inlinenoexcept

Definition at line 127 of file Cell.hh.

128 {
129 return nccell_set_bg_alpha (&_cell, alpha) != -1;
130 }

◆ set_bg_default()

void set_bg_default ( )
inlinenoexcept

Definition at line 177 of file Cell.hh.

178 {
179 nccell_set_bg_default (&_cell);
180 }

◆ set_bg_rgb()

void set_bg_rgb ( uint32_t  channel)
inlinenoexcept

Definition at line 172 of file Cell.hh.

173 {
174 nccell_set_bg_rgb (&_cell, channel);
175 }

◆ set_bg_rgb8()

bool set_bg_rgb8 ( int  r,
int  g,
int  b,
bool  clipped = false 
)
inlinenoexcept

Definition at line 162 of file Cell.hh.

163 {
164 if (clipped) {
165 nccell_set_bg_rgb8_clipped (&_cell, r, g, b);
166 return true;
167 }
168
169 return nccell_set_bg_rgb8 (&_cell, r, g, b) != -1;
170 }

◆ set_fg_alpha()

bool set_fg_alpha ( unsigned  alpha)
inlinenoexcept

Definition at line 117 of file Cell.hh.

118 {
119 return nccell_set_fg_alpha (&_cell, alpha) != -1;
120 }

◆ set_fg_default()

void set_fg_default ( )
inlinenoexcept

Definition at line 152 of file Cell.hh.

153 {
154 nccell_set_fg_default (&_cell);
155 }

◆ set_fg_rgb()

void set_fg_rgb ( uint32_t  channel)
inlinenoexcept

Definition at line 147 of file Cell.hh.

148 {
149 nccell_set_fg_rgb (&_cell, channel);
150 }

◆ set_fg_rgb8()

bool set_fg_rgb8 ( int  r,
int  g,
int  b,
bool  clipped = false 
)
inlinenoexcept

Definition at line 137 of file Cell.hh.

138 {
139 if (clipped) {
140 nccell_set_fg_rgb8_clipped (&_cell, r, g, b);
141 return true;
142 }
143
144 return nccell_set_fg_rgb8 (&_cell, r, g, b) != -1;
145 }

◆ set_styles()

void set_styles ( CellStyle  styles)
inlinenoexcept

Definition at line 72 of file Cell.hh.

73 {
74 nccell_set_styles (&_cell, static_cast<unsigned>(styles));
75 }

◆ styles_off()

void styles_off ( CellStyle  styles)
inlinenoexcept

Definition at line 87 of file Cell.hh.

88 {
89 nccell_off_styles (&_cell, static_cast<unsigned>(styles));
90 }

◆ styles_on()

void styles_on ( CellStyle  styles)
inlinenoexcept

Definition at line 82 of file Cell.hh.

83 {
84 nccell_on_styles (&_cell, static_cast<unsigned>(styles));
85 }

Field Documentation

◆ AlphaBlend

constexpr int AlphaBlend = NCALPHA_BLEND
staticconstexpr

Definition at line 20 of file Cell.hh.

◆ AlphaHighContrast

constexpr int AlphaHighContrast = NCALPHA_HIGHCONTRAST
staticconstexpr

Definition at line 18 of file Cell.hh.

◆ AlphaOpaque

constexpr int AlphaOpaque = NCALPHA_OPAQUE
staticconstexpr

Definition at line 21 of file Cell.hh.

◆ AlphaTransparent

constexpr int AlphaTransparent = NCALPHA_TRANSPARENT
staticconstexpr

Definition at line 19 of file Cell.hh.


The documentation for this class was generated from the following file: