mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
Merge branch 'master' of github.com:dankamongmen/notcurses into master
This commit is contained in:
commit
7100e2b83c
1
NEWS.md
1
NEWS.md
@ -9,6 +9,7 @@ rearrangements of Notcurses.
|
||||
for you save less memory consumption per plane, and faster operation.
|
||||
In the course of doing so, the `attrword` field of the `cell` structure
|
||||
was renamed `stylemask`, and reduced from 32 to 16 bits.
|
||||
* `notcurses_palette_size()` now returns `unsigned`.
|
||||
|
||||
* 1.6.12 (2020-08-12)
|
||||
* `ncreel`s `tabletcb` callback function semantics are radically simplified.
|
||||
|
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);
|
||||
|
@ -41,6 +41,7 @@
|
||||
<a href="https://repology.org/project/notcurses/versions">
|
||||
<img src="https://repology.org/badge/vertical-allrepos/notcurses.svg" alt="Packaging status" align="right">
|
||||
</a>
|
||||
<a href="notcurses_capabilities.3.html">notcurses_cell</a>—runtime capability detection<br/>
|
||||
<a href="notcurses_cell.3.html">notcurses_cell</a>—operations on <tt>cell</tt> objects<br/>
|
||||
<a href="notcurses_channels.3.html">notcurses_channels</a>—operations on the <tt>channel</tt> type<br/>
|
||||
<a href="notcurses_directmode.3.html">notcurses_directmode</a>—minimal notcurses instances for styling text<br/>
|
||||
|
@ -137,6 +137,7 @@ previous action.
|
||||
**ncurses(3NCURSES)**,
|
||||
**notcurses-demo(1)**,
|
||||
**notcurses-input(1)**,
|
||||
**notcurses_capabilities(3)**,
|
||||
**notcurses_cell(3)**,
|
||||
**notcurses_channels(3)**,
|
||||
**notcurses_directmode(3)**,
|
||||
|
80
doc/man/man3/notcurses_capabilities.3.md
Normal file
80
doc/man/man3/notcurses_capabilities.3.md
Normal file
@ -0,0 +1,80 @@
|
||||
% notcurses_capabilities(3)
|
||||
% nick black <nickblack@linux.com>
|
||||
% v1.6.12
|
||||
|
||||
# NAME
|
||||
|
||||
notcurses_capabilities - runtime capability detection
|
||||
|
||||
# SYNOPSIS
|
||||
|
||||
**#include <notcurses/notcurses.h>**
|
||||
|
||||
**unsigned notcurses_supported_styles(const struct notcurses* nc);**
|
||||
|
||||
**unsigned notcurses_palette_size(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_cantruecolor(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_canfade(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_canchangecolor(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_canopen_images(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_canopen_videos(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_canutf8(const struct notcurses* nc);**
|
||||
|
||||
**bool notcurses_cansixel(const struct notcurses* nc);**
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
**notcurses_supported_styles** returns a bitmask representing those styles
|
||||
for which the terminal advertises support.
|
||||
|
||||
**notcurses_palette_size** returns the size of the terminal's palette, used
|
||||
for palette-indexed color. It will always return at least 1. This is
|
||||
independent of RGB TrueColor support. No terminal is know to support
|
||||
more than 256-indexed color.
|
||||
|
||||
**notcurses_cantruecolor** returns **true** if the terminal advertises
|
||||
support for RGB TrueColor. Note that the RGB APIs of Notcurses can be used
|
||||
even in the absence of terminal RGB support (Notcurses will map the RGB
|
||||
values to the palette).
|
||||
|
||||
**notcurses_canfade** returns **true** if Notcurses has a means by which
|
||||
it can effect fades.
|
||||
|
||||
**notcurses_canchangecolor** returns **true** if the terminal advertises
|
||||
support for changing its palette entries.
|
||||
|
||||
**notcurses_canopen_images** returns **true** if Notcurses was built with
|
||||
multimedia support.
|
||||
|
||||
**notcurses_canopen_video** returns **true** if Notcurses was built with
|
||||
multimedia support capable of decoding videos.
|
||||
|
||||
**notcurses_canutf8** returns **true** if the configured locale uses
|
||||
UTF-8 encoding.
|
||||
|
||||
**notcurses_cansixel** returns **true** if the terminal advertises
|
||||
support for Sixel, and Notcurses has been built with Sixel support.
|
||||
|
||||
# BUGS
|
||||
|
||||
Notcurses does not yet have Sixel support, and thus **notcurses_cansixel**
|
||||
will always return **false**.
|
||||
|
||||
# NOTES
|
||||
|
||||
Some terminals advertise support for TrueColor, but then downsample or
|
||||
otherwise degrade the provided RGB. In this case **notcurses_cantruecolor**
|
||||
will return **true**, but the full spectrum will not be available.
|
||||
|
||||
# RETURN VALUES
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
**notcurses(3)**,
|
||||
utf8(7)
|
@ -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…
Reference in New Issue
Block a user