mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
palette_size is unsigned #891
This commit is contained in:
parent
8b072c0b5f
commit
f9eed1c412
2
USAGE.md
2
USAGE.md
@ -240,7 +240,7 @@ unsigned notcurses_supported_styles(const struct notcurses* nc);
|
||||
// Returns the number of simultaneous colors claimed to be supported, or 1 if
|
||||
// there is no color support. Note that several terminal emulators advertise
|
||||
// more colors than they actually support, downsampling internally.
|
||||
int notcurses_palette_size(const struct notcurses* nc);
|
||||
unsigned notcurses_palette_size(const struct notcurses* nc);
|
||||
|
||||
// Can we fade? Fading requires either the "rgb" or "ccc" terminfo capability.
|
||||
bool notcurses_canfade(const struct notcurses* nc);
|
||||
|
@ -12,7 +12,7 @@ ncdirect_init - minimal notcurses instances for styling text
|
||||
|
||||
**struct ncdirect* ncdirect_init(const char* termtype, FILE* fp);**
|
||||
|
||||
**int ncdirect_palette_size(const struct ncdirect* nc);**
|
||||
**unsigned ncdirect_palette_size(const struct ncdirect* nc);**
|
||||
|
||||
**int ncdirect_bg_rgb8(struct ncdirect* nc, unsigned r, unsigned g, unsigned b);**
|
||||
|
||||
|
@ -83,7 +83,7 @@ namespace ncpp
|
||||
return error_guard (ncdirect_dim_y (direct), -1);
|
||||
}
|
||||
|
||||
int get_palette_size () const noexcept
|
||||
unsigned get_palette_size () const noexcept
|
||||
{
|
||||
return ncdirect_palette_size (direct);
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ namespace ncpp
|
||||
return refresh (&rows, &cols);
|
||||
}
|
||||
|
||||
int get_palette_size () const noexcept
|
||||
unsigned get_palette_size () const noexcept
|
||||
{
|
||||
return notcurses_palette_size (static_cast<const notcurses*> (nc));
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ API int ncdirect_bg_palindex(struct ncdirect* nc, int pidx);
|
||||
// Returns the number of simultaneous colors claimed to be supported, or 1 if
|
||||
// there is no color support. Note that several terminal emulators advertise
|
||||
// more colors than they actually support, downsampling internally.
|
||||
API int ncdirect_palette_size(const struct ncdirect* nc);
|
||||
API unsigned ncdirect_palette_size(const struct ncdirect* nc);
|
||||
|
||||
// Output the string |utf8| according to the channels |channels|.
|
||||
API int ncdirect_putstr(struct ncdirect* nc, uint64_t channels, const char* utf8);
|
||||
|
@ -1052,7 +1052,7 @@ API unsigned notcurses_supported_styles(const struct notcurses* nc);
|
||||
// Returns the number of simultaneous colors claimed to be supported, or 1 if
|
||||
// there is no color support. Note that several terminal emulators advertise
|
||||
// more colors than they actually support, downsampling internally.
|
||||
API int notcurses_palette_size(const struct notcurses* nc);
|
||||
API unsigned notcurses_palette_size(const struct notcurses* nc);
|
||||
|
||||
// Can we directly specify RGB values per cell, or only use palettes?
|
||||
API bool notcurses_cantruecolor(const struct notcurses* nc);
|
||||
|
@ -537,7 +537,7 @@ int ncdirect_styles_set(ncdirect* n, unsigned stylebits){
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ncdirect_palette_size(const ncdirect* nc){
|
||||
unsigned ncdirect_palette_size(const ncdirect* nc){
|
||||
return nc->tcache.colors;
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ typedef struct ncmenu {
|
||||
|
||||
// terminfo cache
|
||||
typedef struct tinfo {
|
||||
int colors; // number of colors terminfo reported usable for this screen
|
||||
unsigned colors;// number of colors terminfo reported usable for this screen
|
||||
char* sgr; // set many graphics properties at once
|
||||
char* sgr0; // restore default presentation properties
|
||||
char* setaf; // set foreground color (ANSI)
|
||||
|
@ -1539,7 +1539,7 @@ unsigned notcurses_supported_styles(const notcurses* nc){
|
||||
return styles;
|
||||
}
|
||||
|
||||
int notcurses_palette_size(const notcurses* nc){
|
||||
unsigned notcurses_palette_size(const notcurses* nc){
|
||||
return nc->tcache.colors;
|
||||
}
|
||||
|
||||
|
@ -46,12 +46,14 @@ int terminfostr(char** gseq, const char* name){
|
||||
int interrogate_terminfo(tinfo* ti){
|
||||
memset(ti, 0, sizeof(*ti));
|
||||
ti->RGBflag = query_rgb();
|
||||
if((ti->colors = tigetnum("colors")) <= 0){
|
||||
int colors = tigetnum("colors");
|
||||
if(colors <= 0){
|
||||
ti->colors = 1;
|
||||
ti->CCCflag = false;
|
||||
ti->RGBflag = false;
|
||||
ti->initc = NULL;
|
||||
}else{
|
||||
ti->colors = colors;
|
||||
terminfostr(&ti->initc, "initc");
|
||||
if(ti->initc){
|
||||
ti->CCCflag = tigetflag("ccc") == 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user