nngn
Loading...
Searching...
No Matches
nngn::Textbox Class Reference

#include <textbox.h>

Collaboration diagram for nngn::Textbox:

Classes

struct  Command
 

Public Types

enum  Flag : u8 {
  UPDATED = 1u << 0 , SCREEN_UPDATED = 1u << 1 , MONOSPACED = 1u << 2 , UPDATED = 1u << 0 ,
  SCREEN_UPDATED = 1u << 1 , MONOSPACED = 1u << 2
}
 
enum  Flag : u8 {
  UPDATED = 1u << 0 , SCREEN_UPDATED = 1u << 1 , MONOSPACED = 1u << 2 , UPDATED = 1u << 0 ,
  SCREEN_UPDATED = 1u << 1 , MONOSPACED = 1u << 2
}
 

Public Member Functions

void init (const Fonts *f)
 
bool empty (void) const
 
std::size_t text_length (void) const
 
bool monospaced (void) const
 
bool updated (void) const
 
bool finished (void) const
 
void set_monospaced (bool m)
 
void set_screen_updated (void)
 
void set_speed (unsigned s)
 
void set_title (const char *s)
 
void set_text (const char *s)
 
void set_cur (std::size_t cur)
 
bool update (const Timing &t)
 
void update_size (void)
 
void update_size (const uvec2 &screen)
 
void clear_updated (void)
 
void init (const Fonts *f)
 
bool empty (void) const
 
std::size_t text_length (void) const
 
bool monospaced (void) const
 
bool updated (void) const
 
bool finished (void) const
 
void set_monospaced (bool m)
 
void set_screen_updated (void)
 
void set_speed (unsigned s)
 
void set_title (const char *s)
 
void set_text (const char *s)
 
void set_cur (std::size_t cur)
 
bool update (const Timing &t)
 
void update_size (void)
 
void update_size (const uvec2 &screen)
 
void clear_updated (void)
 

Static Public Member Functions

static bool is_character (unsigned char c)
 
static bool is_character (char c)
 
static bool is_command (unsigned char c)
 
static bool is_command (char c)
 
static bool is_character (unsigned char c)
 
static bool is_character (char c)
 
static bool is_command (unsigned char c)
 
static bool is_command (char c)
 

Public Attributes

Text str = {}
 
Text title = {}
 
std::chrono::microseconds timer = {}
 
std::chrono::milliseconds speed = DEFAULT_SPEED
 
vec2 title_bl = {0, 0}
 
vec2 title_tr = {0, 0}
 
vec2 str_bl = {0, 0}
 
vec2 str_tr = {0, 0}
 

Static Public Attributes

static constexpr auto DEFAULT_SPEED = std::chrono::milliseconds(50)
 

Private Attributes

Flags< Flagflags = {}
 
const Fontsfonts = nullptr
 

Member Enumeration Documentation

◆ Flag [1/2]

Enumerator
UPDATED 
SCREEN_UPDATED 
MONOSPACED 
UPDATED 
SCREEN_UPDATED 
MONOSPACED 

◆ Flag [2/2]

Enumerator
UPDATED 
SCREEN_UPDATED 
MONOSPACED 
UPDATED 
SCREEN_UPDATED 
MONOSPACED 

Member Function Documentation

◆ clear_updated() [1/2]

void nngn::Textbox::clear_updated ( void  )
inline
Here is the call graph for this function:

◆ clear_updated() [2/2]

void nngn::Textbox::clear_updated ( void  )

◆ empty() [1/2]

bool nngn::Textbox::empty ( void  ) const
inline
Here is the caller graph for this function:

◆ empty() [2/2]

bool nngn::Textbox::empty ( void  ) const

◆ finished() [1/2]

bool nngn::Textbox::finished ( void  ) const
inline
Here is the caller graph for this function:

◆ finished() [2/2]

bool nngn::Textbox::finished ( void  ) const
inline

◆ init() [1/2]

void nngn::Textbox::init ( const Fonts f)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init() [2/2]

void nngn::Textbox::init ( const Fonts f)
inline
Here is the call graph for this function:

◆ is_character() [1/4]

bool nngn::Textbox::is_character ( char  c)
inlinestatic
Here is the call graph for this function:

◆ is_character() [2/4]

static bool nngn::Textbox::is_character ( char  c)
static

◆ is_character() [3/4]

bool nngn::Textbox::is_character ( unsigned char  c)
inlinestatic
Here is the caller graph for this function:

◆ is_character() [4/4]

static bool nngn::Textbox::is_character ( unsigned char  c)
static

◆ is_command() [1/4]

bool nngn::Textbox::is_command ( char  c)
inlinestatic
Here is the call graph for this function:

◆ is_command() [2/4]

static bool nngn::Textbox::is_command ( char  c)
static

◆ is_command() [3/4]

bool nngn::Textbox::is_command ( unsigned char  c)
inlinestatic
Here is the caller graph for this function:

◆ is_command() [4/4]

static bool nngn::Textbox::is_command ( unsigned char  c)
static

◆ monospaced() [1/2]

bool nngn::Textbox::monospaced ( void  ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ monospaced() [2/2]

bool nngn::Textbox::monospaced ( void  ) const
inline
Here is the call graph for this function:

◆ set_cur() [1/2]

void nngn::Textbox::set_cur ( std::size_t  cur)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_cur() [2/2]

void nngn::Textbox::set_cur ( std::size_t  cur)

◆ set_monospaced() [1/2]

void nngn::Textbox::set_monospaced ( bool  m)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_monospaced() [2/2]

void nngn::Textbox::set_monospaced ( bool  m)

◆ set_screen_updated() [1/2]

void nngn::Textbox::set_screen_updated ( void  )
inline
Here is the call graph for this function:

◆ set_screen_updated() [2/2]

void nngn::Textbox::set_screen_updated ( void  )
inline
Here is the call graph for this function:

◆ set_speed() [1/2]

void nngn::Textbox::set_speed ( unsigned  s)
inline
Here is the caller graph for this function:

◆ set_speed() [2/2]

void nngn::Textbox::set_speed ( unsigned  s)
inline

◆ set_text() [1/2]

void nngn::Textbox::set_text ( const char *  s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_text() [2/2]

void nngn::Textbox::set_text ( const char *  s)

◆ set_title() [1/2]

void nngn::Textbox::set_title ( const char *  s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_title() [2/2]

void nngn::Textbox::set_title ( const char *  s)

◆ text_length() [1/2]

std::size_t nngn::Textbox::text_length ( void  ) const
Here is the call graph for this function:

◆ text_length() [2/2]

std::size_t nngn::Textbox::text_length ( void  ) const

◆ update() [1/2]

bool nngn::Textbox::update ( const Timing t)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update() [2/2]

bool nngn::Textbox::update ( const Timing t)

◆ update_size() [1/4]

void nngn::Textbox::update_size ( const uvec2 screen)
Here is the call graph for this function:

◆ update_size() [2/4]

void nngn::Textbox::update_size ( const uvec2 screen)

◆ update_size() [3/4]

void nngn::Textbox::update_size ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_size() [4/4]

void nngn::Textbox::update_size ( void  )

◆ updated() [1/2]

bool nngn::Textbox::updated ( void  ) const
inline
Here is the call graph for this function:

◆ updated() [2/2]

bool nngn::Textbox::updated ( void  ) const

Member Data Documentation

◆ DEFAULT_SPEED

static constexpr auto nngn::Textbox::DEFAULT_SPEED = std::chrono::milliseconds(50)
staticconstexpr

◆ flags

Flags< Flag > nngn::Textbox::flags = {}
private

◆ fonts

const Fonts * nngn::Textbox::fonts = nullptr
private

◆ speed

std::chrono::milliseconds nngn::Textbox::speed = DEFAULT_SPEED

◆ str

Text nngn::Textbox::str = {}

◆ str_bl

vec2 nngn::Textbox::str_bl = {0, 0}

◆ str_tr

vec2 nngn::Textbox::str_tr = {0, 0}

◆ timer

std::chrono::microseconds nngn::Textbox::timer = {}

◆ title

Text nngn::Textbox::title = {}

◆ title_bl

vec2 nngn::Textbox::title_bl = {0, 0}

◆ title_tr

vec2 nngn::Textbox::title_tr = {0, 0}

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