mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
don't expose kitty-style bg transparency to user #2432
This commit is contained in:
parent
4c17970ba0
commit
ba1fbbee90
@ -55,7 +55,7 @@ typedef struct notcurses_options {
|
||||
|
||||
**int notcurses_default_foreground(const struct notcurses* ***nc***, uint32_t* ***fg***);**
|
||||
|
||||
**int notcurses_default_background(const struct notcurses* ***nc***, uint32_t* ***bg***, unsigned* ***bgtrans***);**
|
||||
**int notcurses_default_background(const struct notcurses* ***nc***, uint32_t* ***bg***);**
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
@ -172,8 +172,7 @@ zero. The following flags are defined:
|
||||
|
||||
**notcurses_default_foreground** returns the default foreground color, if it
|
||||
could be detected. **notcurses_default_background** returns the default
|
||||
background color, and whether the terminal treats it as transparent, if this
|
||||
could be detected.
|
||||
background color, if it could be detected.
|
||||
|
||||
## Fatal signals
|
||||
|
||||
|
@ -3639,8 +3639,7 @@ API int notcurses_default_foreground(const struct notcurses* nc, uint32_t* fg)
|
||||
// (unknown background). On success, returns 0, writing the RGB value to
|
||||
// 'bg' (if non-NULL) and setting 'bgtrans' high iff the background color
|
||||
// is treated as transparent.
|
||||
API int notcurses_default_background(const struct notcurses* nc,
|
||||
uint32_t* bg, unsigned* bgtrans)
|
||||
API int notcurses_default_background(const struct notcurses* nc, uint32_t* bg)
|
||||
__attribute__ ((nonnull (1)));
|
||||
|
||||
// Enable or disable the terminal's cursor, if supported, placing it at
|
||||
|
@ -376,17 +376,12 @@ tinfo_debug_bitmaps(struct ncplane* n, const tinfo* ti, const char* indent){
|
||||
}else{
|
||||
ncplane_printf(n, "%sdefault fg 0x%06x ", indent, fg);
|
||||
}
|
||||
unsigned bgtrans = 0;
|
||||
uint32_t bg = 0;
|
||||
r = notcurses_default_background(ncplane_notcurses(n), &bg, &bgtrans);
|
||||
r = notcurses_default_background(ncplane_notcurses(n), &bg);
|
||||
if(r){
|
||||
ncplane_printf(n, "no known default fg");
|
||||
}else{
|
||||
if(bgtrans){
|
||||
ncplane_printf(n, "default bg 0x%06x (trans)", bg);
|
||||
}else{
|
||||
ncplane_printf(n, "default bg 0x%06x", bg);
|
||||
}
|
||||
ncplane_printf(n, "default bg 0x%06x", bg);
|
||||
}
|
||||
finish_line(n);
|
||||
ncpixelimpl_e blit = notcurses_check_pixel_support(ncplane_notcurses(n));
|
||||
|
@ -1736,14 +1736,12 @@ int notcurses_default_foreground(const struct notcurses* nc, uint32_t* fg){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int notcurses_default_background(const struct notcurses* nc,
|
||||
uint32_t* bg, unsigned* bgtrans){
|
||||
int notcurses_default_background(const struct notcurses* nc, uint32_t* bg){
|
||||
const tinfo* ti = &nc->tcache;
|
||||
if(ti->bg_collides_default & 0x80000000){
|
||||
logerror("default background could not be determined\n");
|
||||
return -1;
|
||||
}
|
||||
*bgtrans = !!(ti->bg_collides_default & 0x01000000);
|
||||
*bg = ti->bg_collides_default & NC_BG_RGB_MASK;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user