Rename setTransShadow() to setColorOverlay()

This commit is contained in:
Markus Gans 2020-02-13 08:21:48 +01:00
parent 83a6ee497b
commit 43bda37f71
13 changed files with 1152 additions and 2115 deletions

View File

@ -1,3 +1,6 @@
2020-02-13 Markus Gans <guru.mail@muenster.de>
* Rename setTransShadow() to setColorOverlay()
2020-02-11 Markus Gans <guru.mail@muenster.de>
* Fix collapse() and expand() in FListViewItem()

View File

@ -45,7 +45,7 @@ The FFileDialog widget with incremental file name search:
![FFileDialog](doc/fileopen-dialog.png)
The Final Cut FProgressbar widget:
The FINAL CUT FProgressbar widget:
![FProgressbar](doc/progress-bar.png)

View File

@ -6,7 +6,7 @@ Frequently Asked Questions
What is FINAL CUT?
------------------
The Final Cut is a [C++](https://en.wikipedia.org/wiki/C%2B%2B) class library
The FINAL CUT is a [C++](https://en.wikipedia.org/wiki/C%2B%2B) class library
and a widget toolkit with full mouse support for creating a text-based user
interface. It's based on the Termcap library and has its own cursor
optimization and window management.

View File

@ -55,7 +55,7 @@ emulator. It uses various optimization methods to improve the drawing speed.
How to use the library
----------------------
At the beginning of this introduction to the Final Cut
At the beginning of this introduction to the FINAL CUT
we will start with a small example.
The following example creates an empty 30&times;10 character dialog.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 31 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 39 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -91,7 +91,7 @@ void Transparent::draw()
{
const auto& wc = getFWidgetColors();
setColor(wc.shadow_bg, wc.shadow_fg);
setTransShadow();
setColorOverlay();
}
else if ( type == inherit_background )
{
@ -113,7 +113,7 @@ void Transparent::draw()
}
if ( type == shadow )
unsetTransShadow();
unsetColorOverlay();
else if ( type == inherit_background )
unsetInheritBackground();
else

View File

@ -38,11 +38,11 @@ namespace finalcut
FOptiAttr::FOptiAttr()
{
// Set bits that must not be reset
reset_byte_mask.attr.bit.transparent = true;
reset_byte_mask.attr.bit.trans_shadow = true;
reset_byte_mask.attr.bit.inherit_bg = true;
reset_byte_mask.attr.bit.no_changes = true;
reset_byte_mask.attr.bit.printed = true;
reset_byte_mask.attr.bit.transparent = true;
reset_byte_mask.attr.bit.color_overlay = true;
reset_byte_mask.attr.bit.inherit_bg = true;
reset_byte_mask.attr.bit.no_changes = true;
reset_byte_mask.attr.bit.printed = true;
}
//----------------------------------------------------------------------

View File

@ -528,17 +528,17 @@ int FVTerm::print (FTermArea* area, FChar& term_char)
if ( *ac != nc ) // compare with an overloaded operator
{
if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->attr.bit.trans_shadow && nc.attr.bit.trans_shadow )
|| ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->attr.bit.color_overlay && nc.attr.bit.color_overlay )
|| ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
{
// add one transparent character form line
area->changes[ay].trans_count++;
}
if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->attr.bit.trans_shadow && ! nc.attr.bit.trans_shadow )
|| ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->attr.bit.color_overlay && ! nc.attr.bit.color_overlay )
|| ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
{
// remove one transparent character from line
area->changes[ay].trans_count--;
@ -1231,7 +1231,7 @@ void FVTerm::clearArea (FTermArea* area, int fillchar)
area->changes[i].xmax = w - 1;
if ( nc.attr.bit.transparent
|| nc.attr.bit.trans_shadow
|| nc.attr.bit.color_overlay
|| nc.attr.bit.inherit_bg )
area->changes[i].trans_count = w;
else if ( area->right_shadow != 0 )
@ -1404,7 +1404,7 @@ FVTerm::covered_state FVTerm::isCovered ( const FPoint& pos
const int y = pos.getY();
auto tmp = &win->data[(y - win_y) * width + (x - win_x)];
if ( tmp->attr.bit.trans_shadow )
if ( tmp->attr.bit.color_overlay )
{
is_covered = half_covered;
}
@ -1589,7 +1589,7 @@ bool FVTerm::updateVTermCharacter ( FTermArea* area
}
else // Not transparent
{
if ( ac->attr.bit.trans_shadow ) // Transparent shadow
if ( ac->attr.bit.color_overlay ) // Transparent shadow
{
updateShadedCharacter (area, area_pos, terminal_pos);
}
@ -1737,7 +1737,7 @@ FChar FVTerm::generateCharacter (const FPoint& pos)
if ( ! tmp->attr.bit.transparent ) // Current character not transparent
{
if ( tmp->attr.bit.trans_shadow ) // Transparent shadow
if ( tmp->attr.bit.color_overlay ) // Transparent shadow
{
// Keep the current vterm character
if ( sc != &s_ch )
@ -1969,7 +1969,7 @@ void FVTerm::putAreaCharacter ( const FPoint& pos, FVTerm* obj
}
else // Mot transparent
{
if ( ac->attr.bit.trans_shadow ) // Transparent shadow
if ( ac->attr.bit.color_overlay ) // Transparent shadow
{
// Get covered character + add the current color
FChar ch = getCoveredCharacter (pos, obj);
@ -2016,7 +2016,7 @@ void FVTerm::getAreaCharacter ( const FPoint& pos, FTermArea* area
// Current character not transparent
if ( ! tmp->attr.bit.transparent )
{
if ( tmp->attr.bit.trans_shadow ) // transparent shadow
if ( tmp->attr.bit.color_overlay ) // transparent shadow
{
// Keep the current vterm character
std::memcpy (&s_ch, cc, sizeof(s_ch));

View File

@ -156,22 +156,22 @@ void drawTransparentShadow (FWidget* w)
w->print() << FPoint(int(width) + 1, 1) << " ";
w->unsetTransparent();
w->setColor (w->wcolors.shadow_bg, w->wcolors.shadow_fg);
w->setTransShadow();
w->setColorOverlay();
for (std::size_t y{1}; y < height; y++)
{
w->print() << FPoint(int(width) + 1, int(y) + 1) << " ";
}
w->unsetTransShadow();
w->unsetColorOverlay();
w->setTransparent();
w->print() << FPoint(1, int(height) + 1) << " ";
w->unsetTransparent();
w->setColor (w->wcolors.shadow_bg, w->wcolors.shadow_fg);
w->setTransShadow();
w->setColorOverlay();
w->print() << FString(width, L' ');
w->unsetTransShadow();
w->unsetColorOverlay();
if ( w->isMonochron() )
w->setReverse(false);

View File

@ -133,7 +133,7 @@ typedef struct
uInt8 alt_charset : 1; // alternate character set (vt100)
uInt8 pc_charset : 1; // pc character set (CP437)
uInt8 transparent : 1; // transparent
uInt8 trans_shadow : 1; // transparent shadow
uInt8 color_overlay : 1; // color overlay
uInt8 inherit_bg : 1; // inherit background
// Attribute byte #2
uInt8 no_changes : 1; // no changes required

View File

@ -226,9 +226,9 @@ class FVTerm
static bool setTransparent();
static bool unsetTransparent();
static bool setTransShadow (bool);
static bool setTransShadow();
static bool unsetTransShadow();
static bool setColorOverlay (bool);
static bool setColorOverlay();
static bool unsetColorOverlay();
static bool setInheritBackground (bool);
static bool setInheritBackground();
@ -838,16 +838,16 @@ inline bool FVTerm::unsetTransparent()
{ return setTransparent(false); }
//----------------------------------------------------------------------
inline bool FVTerm::setTransShadow (bool enable)
{ return (next_attribute.attr.bit.trans_shadow = enable); }
inline bool FVTerm::setColorOverlay (bool enable)
{ return (next_attribute.attr.bit.color_overlay = enable); }
//----------------------------------------------------------------------
inline bool FVTerm::setTransShadow()
{ return setTransShadow(true); }
inline bool FVTerm::setColorOverlay()
{ return setColorOverlay(true); }
//----------------------------------------------------------------------
inline bool FVTerm::unsetTransShadow()
{ return setTransShadow(false); }
inline bool FVTerm::unsetColorOverlay()
{ return setColorOverlay(false); }
//----------------------------------------------------------------------
inline bool FVTerm::setInheritBackground (bool enable)
@ -939,7 +939,7 @@ inline bool FVTerm::isTransparent()
//----------------------------------------------------------------------
inline bool FVTerm::isTransShadow()
{ return next_attribute.attr.bit.trans_shadow; }
{ return next_attribute.attr.bit.color_overlay; }
//----------------------------------------------------------------------
inline bool FVTerm::isInheritBackground()