Screen characters got a union structure for a faster attribute compare operation

This commit is contained in:
Markus Gans 2017-08-20 17:30:30 +02:00
parent 3854de73d3
commit 37e4f7e222
10 changed files with 595 additions and 448 deletions

View File

@ -1,3 +1,7 @@
2017-08-20 Markus Gans <guru.mail@muenster.de>
* Screen characters got a union structure for a faster
attribute compare operation
2017-08-11 Markus Gans <guru.mail@muenster.de> 2017-08-11 Markus Gans <guru.mail@muenster.de>
* Some code changes for GCC 7 * Some code changes for GCC 7
* Implementation of a copy constructor for FPoint and FRect * Implementation of a copy constructor for FPoint and FRect

View File

@ -71,7 +71,7 @@ class FApplication : public FWidget
void setMainWidget (FWidget*); void setMainWidget (FWidget*);
// Inquiry // Inquiry
bool isQuit(); static bool isQuit();
// Methods // Methods
int exec(); // run int exec(); // run

View File

@ -18,6 +18,9 @@ FListViewItem::FListViewItem (const FListViewItem& item)
: FObject(item.getParent()) : FObject(item.getParent())
, column_line(item.column_line) , column_line(item.column_line)
, data_pointer(item.data_pointer) , data_pointer(item.data_pointer)
, visible_lines(1)
, expandable(false)
, is_expand(false)
{ {
FObject* parent = getParent(); FObject* parent = getParent();
@ -26,16 +29,20 @@ FListViewItem::FListViewItem (const FListViewItem& item)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FListViewItem::FListViewItem (FListViewItem* item) FListViewItem::FListViewItem (FListViewItem* parent)
: FObject(item->getParent()) : FObject(parent)
, column_line(item->column_line) , column_line()
, data_pointer(item->data_pointer) , data_pointer(0)
, visible_lines(1)
, expandable(false)
, is_expand(false)
{ {
// Add the FListViewItem to the parent // Add the FListViewItem to the parent
FObject* parent = getParent(); if ( ! parent )
return;
if ( parent && parent->isInstanceOf("FListView") ) parent->addChild (this);
static_cast<FListView*>(parent)->insert (this); parent->expandable = true;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -43,6 +50,9 @@ FListViewItem::FListViewItem (FListView* parent)
: FObject(parent) : FObject(parent)
, column_line() , column_line()
, data_pointer(0) , data_pointer(0)
, visible_lines(1)
, expandable(false)
, is_expand(false)
{ {
// Add the FListViewItem to the parent // Add the FListViewItem to the parent
if ( parent ) if ( parent )
@ -56,6 +66,9 @@ FListViewItem::FListViewItem ( const std::vector<FString>& cols
: FObject(parent) : FObject(parent)
, column_line(cols) , column_line(cols)
, data_pointer(data) , data_pointer(data)
, visible_lines(1)
, expandable(false)
, is_expand(false)
{ {
// Replace the control codes characters // Replace the control codes characters
std::vector<FString>::iterator iter = column_line.begin(); std::vector<FString>::iterator iter = column_line.begin();
@ -71,15 +84,42 @@ FListViewItem::FListViewItem ( const std::vector<FString>& cols
parent->insert (this); parent->insert (this);
} }
//----------------------------------------------------------------------
FListViewItem::FListViewItem ( const std::vector<FString>& cols
, FWidget::data_ptr data
, FListViewItem* parent )
: FObject(parent)
, column_line(cols)
, data_pointer(data)
, visible_lines(1)
, expandable(false)
, is_expand(false)
{
// Replace the control codes characters
std::vector<FString>::iterator iter = column_line.begin();
while ( iter != column_line.end() )
{
*iter = iter->replaceControlCodes();
++iter;
}
if ( parent )
parent->expandable = true;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FListViewItem::~FListViewItem() FListViewItem::~FListViewItem()
{ } { }
// public methods of FListViewItem // public methods of FListViewItem
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FString FListViewItem::getText (int column) const FString FListViewItem::getText (int column) const
{ {
if (column < 0 || column_line.empty() || column >= int(column_line.size()) ) if ( column < 0
|| column_line.empty()
|| column >= int(column_line.size()) )
return *fc::empty_string; return *fc::empty_string;
return column_line[uInt(column)]; return column_line[uInt(column)];
@ -88,7 +128,9 @@ FString FListViewItem::getText (int column) const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListViewItem::setText (int column, const FString& text) void FListViewItem::setText (int column, const FString& text)
{ {
if (column < 0 || column_line.empty() || column >= int(column_line.size()) ) if ( column < 0
|| column_line.empty()
|| column >= int(column_line.size()) )
return; return;
FObject* parent = getParent(); FObject* parent = getParent();
@ -109,6 +151,61 @@ void FListViewItem::setText (int column, const FString& text)
column_line[uInt(column)] = text; column_line[uInt(column)] = text;
} }
//----------------------------------------------------------------------
void FListViewItem::insert (FListViewItem* child)
{
// Add a FListViewItem as child element
if ( ! child || ! hasChildren() )
return;
addChild (child);
expandable = true;
}
//----------------------------------------------------------------------
void FListViewItem::expand()
{
if ( is_expand || ! hasChildren() )
return;
is_expand = true;
}
//----------------------------------------------------------------------
void FListViewItem::collapse()
{
if ( ! is_expand )
return;
is_expand = false;
}
//----------------------------------------------------------------------
int FListViewItem::getVisibleLines()
{
if ( visible_lines > 1 )
return visible_lines;
if ( ! isExpand() || ! hasChildren() )
{
visible_lines = 1;
return visible_lines;
}
FObjectList children = this->getChildren();
FObjectList::const_iterator iter = children.begin();
while ( iter != children.end() )
{
FListViewItem* child = static_cast<FListViewItem*>(*iter);
visible_lines += child->getVisibleLines();
++iter;
}
return visible_lines;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FListView // class FListView
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -123,9 +220,10 @@ FListView::FListView (FWidget* parent)
, vbar(0) , vbar(0)
, hbar(0) , hbar(0)
, drag_scroll(fc::noScroll) , drag_scroll(fc::noScroll)
, scroll_timer(false)
, scroll_repeat(100) , scroll_repeat(100)
, scroll_distance(1) , scroll_distance(1)
, scroll_timer(false)
, tree_view(false)
, current(0) , current(0)
, xoffset(0) , xoffset(0)
, yoffset(0) , yoffset(0)

View File

@ -53,7 +53,10 @@ class FListViewItem : public FObject
FListViewItem (FListView*); FListViewItem (FListView*);
FListViewItem ( const std::vector<FString>& FListViewItem ( const std::vector<FString>&
, FWidget::data_ptr = 0 , FWidget::data_ptr = 0
, FListView* = 0); , FListView* = 0 );
FListViewItem ( const std::vector<FString>&
, FWidget::data_ptr = 0
, FListViewItem* = 0 );
// Destructor // Destructor
~FListViewItem(); ~FListViewItem();
@ -63,16 +66,33 @@ class FListViewItem : public FObject
// Accessors // Accessors
const char* getClassName() const; const char* getClassName() const;
uInt getCount() const; uInt getColumnCount() const;
FString getText (int) const; FString getText (int) const;
// Mutator // Mutator
void setText (int, const FString&); void setText (int, const FString&);
// Inquiry
bool isExpand();
// Methods
void insert (FListViewItem*);
void expand();
void collapse();
private: private:
// Inquiry
bool isExpandable();
// Methods
int getVisibleLines();
// Data Member // Data Member
std::vector<FString> column_line; std::vector<FString> column_line;
FWidget::data_ptr data_pointer; FWidget::data_ptr data_pointer;
int visible_lines;
bool expandable;
bool is_expand;
// Friend class // Friend class
friend class FListView; friend class FListView;
@ -86,9 +106,17 @@ inline const char* FListViewItem::getClassName() const
{ return "FListViewItem"; } { return "FListViewItem"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline uInt FListViewItem::getCount() const inline uInt FListViewItem::getColumnCount() const
{ return uInt(column_line.size()); } { return uInt(column_line.size()); }
//----------------------------------------------------------------------
inline bool FListViewItem::isExpand()
{ return is_expand; }
//----------------------------------------------------------------------
inline bool FListViewItem::isExpandable()
{ return expandable; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FListView // class FListView
@ -122,6 +150,9 @@ class FListView : public FWidget
void setGeometry (int, int, int, int, bool = true); void setGeometry (int, int, int, int, bool = true);
void setColumnAlignment (int, fc::text_alignment); void setColumnAlignment (int, fc::text_alignment);
void setColumnText (int, const FString&); void setColumnText (int, const FString&);
bool setTreeView (bool);
bool setTreeView();
bool unsetTreeView();
// Methods // Methods
virtual int addColumn (const FString&, int = USE_MAX_SIZE); virtual int addColumn (const FString&, int = USE_MAX_SIZE);
@ -204,9 +235,10 @@ class FListView : public FWidget
FScrollbar* vbar; FScrollbar* vbar;
FScrollbar* hbar; FScrollbar* hbar;
fc::dragScroll drag_scroll; fc::dragScroll drag_scroll;
bool scroll_timer;
int scroll_repeat; int scroll_repeat;
int scroll_distance; int scroll_distance;
bool scroll_timer;
bool tree_view;
int current; int current;
int xoffset; int xoffset;
int yoffset; int yoffset;
@ -228,6 +260,18 @@ inline const char* FListView::getClassName() const
inline FListViewItem* FListView::getCurrentItem() const inline FListViewItem* FListView::getCurrentItem() const
{ return data[uInt(current-1)]; } { return data[uInt(current-1)]; }
//----------------------------------------------------------------------
inline bool FListView::setTreeView (bool on)
{ return tree_view = (on) ? true : false; }
//----------------------------------------------------------------------
inline bool FListView::setTreeView()
{ return setTreeView(true); }
//----------------------------------------------------------------------
inline bool FListView::unsetTreeView()
{ return setTreeView(false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FListView::listViewItems::iterator FListView::index2iterator (int index) inline FListView::listViewItems::iterator FListView::index2iterator (int index)
{ {

View File

@ -535,51 +535,51 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
{ {
unsetTermAttributes(term); unsetTermAttributes(term);
if ( off.pc_charset ) if ( off.attr.bit.pc_charset )
unsetTermPCcharset(term); unsetTermPCcharset(term);
if ( off.alt_charset ) if ( off.attr.bit.alt_charset )
unsetTermAltCharset(term); unsetTermAltCharset(term);
} }
else else
{ {
if ( off.pc_charset ) if ( off.attr.bit.pc_charset )
unsetTermPCcharset(term); unsetTermPCcharset(term);
if ( off.alt_charset ) if ( off.attr.bit.alt_charset )
unsetTermAltCharset(term); unsetTermAltCharset(term);
if ( off.bold ) if ( off.attr.bit.bold )
unsetTermBold(term); unsetTermBold(term);
if ( off.dim ) if ( off.attr.bit.dim )
unsetTermDim(term); unsetTermDim(term);
if ( off.italic ) if ( off.attr.bit.italic )
unsetTermItalic(term); unsetTermItalic(term);
if ( off.underline ) if ( off.attr.bit.underline )
unsetTermUnderline(term); unsetTermUnderline(term);
if ( off.blink ) if ( off.attr.bit.blink )
unsetTermBlink(term); unsetTermBlink(term);
if ( off.reverse ) if ( off.attr.bit.reverse )
unsetTermReverse(term); unsetTermReverse(term);
if ( off.standout ) if ( off.attr.bit.standout )
unsetTermStandout(term); unsetTermStandout(term);
if ( off.invisible ) if ( off.attr.bit.invisible )
unsetTermInvisible(term); unsetTermInvisible(term);
if ( off.protect ) if ( off.attr.bit.protect )
unsetTermProtected(term); unsetTermProtected(term);
if ( off.crossed_out ) if ( off.attr.bit.crossed_out )
unsetTermCrossedOut(term); unsetTermCrossedOut(term);
if ( off.dbl_underline ) if ( off.attr.bit.dbl_underline )
unsetTermDoubleUnderline(term); unsetTermDoubleUnderline(term);
} }
} }
@ -587,91 +587,91 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
if ( colorChange(term, next) ) if ( colorChange(term, next) )
change_color (term, next); change_color (term, next);
} }
else if ( F_set_attributes.cap && ! term->pc_charset ) else if ( F_set_attributes.cap && ! term->attr.bit.pc_charset )
{ {
if ( switchOn() || switchOff() ) if ( switchOn() || switchOff() )
setTermAttributes ( term setTermAttributes ( term
, next->standout , next->attr.bit.standout
, next->underline , next->attr.bit.underline
, next->reverse , next->attr.bit.reverse
, next->blink , next->attr.bit.blink
, next->dim , next->attr.bit.dim
, next->bold , next->attr.bit.bold
, next->invisible , next->attr.bit.invisible
, next->protect , next->attr.bit.protect
, next->alt_charset ); , next->attr.bit.alt_charset );
if ( off.pc_charset ) if ( off.attr.bit.pc_charset )
unsetTermPCcharset(term); unsetTermPCcharset(term);
if ( next->italic ) if ( next->attr.bit.italic )
setTermItalic(term); setTermItalic(term);
if ( next->crossed_out ) if ( next->attr.bit.crossed_out )
setTermCrossedOut(term); setTermCrossedOut(term);
if ( next->dbl_underline ) if ( next->attr.bit.dbl_underline )
setTermDoubleUnderline(term); setTermDoubleUnderline(term);
if ( next->pc_charset ) if ( next->attr.bit.pc_charset )
setTermPCcharset(term); setTermPCcharset(term);
if ( colorChange(term, next) ) if ( colorChange(term, next) )
{ {
change_color (term, next); change_color(term, next);
if ( cygwin_terminal ) if ( cygwin_terminal )
{ {
if ( next->bold ) if ( next->attr.bit.bold )
setTermBold(term); setTermBold(term);
if ( next->reverse ) if ( next->attr.bit.reverse )
setTermReverse(term); setTermReverse(term);
if ( next->standout ) if ( next->attr.bit.standout )
setTermStandout(term); setTermStandout(term);
} }
} }
} }
else else
{ {
if ( off.pc_charset ) if ( off.attr.bit.pc_charset )
unsetTermPCcharset(term); unsetTermPCcharset(term);
if ( off.alt_charset ) if ( off.attr.bit.alt_charset )
unsetTermAltCharset(term); unsetTermAltCharset(term);
if ( off.bold ) if ( off.attr.bit.bold )
unsetTermBold(term); unsetTermBold(term);
if ( off.dim ) if ( off.attr.bit.dim )
unsetTermDim(term); unsetTermDim(term);
if ( off.italic ) if ( off.attr.bit.italic )
unsetTermItalic(term); unsetTermItalic(term);
if ( off.underline ) if ( off.attr.bit.underline )
unsetTermUnderline(term); unsetTermUnderline(term);
if ( off.blink ) if ( off.attr.bit.blink )
unsetTermBlink(term); unsetTermBlink(term);
if ( off.reverse ) if ( off.attr.bit.reverse )
unsetTermReverse(term); unsetTermReverse(term);
if ( off.standout ) if ( off.attr.bit.standout )
unsetTermStandout(term); unsetTermStandout(term);
if ( off.invisible ) if ( off.attr.bit.invisible )
unsetTermInvisible(term); unsetTermInvisible(term);
if ( off.protect ) if ( off.attr.bit.protect )
unsetTermProtected(term); unsetTermProtected(term);
if ( off.crossed_out ) if ( off.attr.bit.crossed_out )
unsetTermCrossedOut(term); unsetTermCrossedOut(term);
if ( off.dbl_underline ) if ( off.attr.bit.dbl_underline )
unsetTermDoubleUnderline(term); unsetTermDoubleUnderline(term);
detectSwitchOff (term, next); detectSwitchOff (term, next);
@ -684,48 +684,48 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
detectSwitchOn (term, next); detectSwitchOn (term, next);
if ( on.alt_charset ) if ( on.attr.bit.alt_charset )
setTermAltCharset(term); setTermAltCharset(term);
if ( on.pc_charset ) if ( on.attr.bit.pc_charset )
setTermPCcharset(term); setTermPCcharset(term);
if ( on.bold ) if ( on.attr.bit.bold )
setTermBold(term); setTermBold(term);
if ( on.dim ) if ( on.attr.bit.dim )
setTermDim(term); setTermDim(term);
if ( on.italic ) if ( on.attr.bit.italic )
setTermItalic(term); setTermItalic(term);
if ( on.underline ) if ( on.attr.bit.underline )
setTermUnderline(term); setTermUnderline(term);
if ( on.blink ) if ( on.attr.bit.blink )
setTermBlink(term); setTermBlink(term);
if ( on.reverse ) if ( on.attr.bit.reverse )
setTermReverse(term); setTermReverse(term);
if ( on.standout ) if ( on.attr.bit.standout )
setTermStandout(term); setTermStandout(term);
if ( on.invisible ) if ( on.attr.bit.invisible )
setTermInvisible(term); setTermInvisible(term);
if ( on.protect ) if ( on.attr.bit.protect )
setTermProtected(term); setTermProtected(term);
if ( on.crossed_out ) if ( on.attr.bit.crossed_out )
setTermCrossedOut(term); setTermCrossedOut(term);
if ( on.dbl_underline ) if ( on.attr.bit.dbl_underline )
setTermDoubleUnderline(term); setTermDoubleUnderline(term);
} }
if ( term && fake_reverse ) if ( term && fake_reverse )
term->reverse = true; term->attr.bit.reverse = true;
return attr_buf; return attr_buf;
} }
@ -736,7 +736,7 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
inline bool FOptiAttr::setTermBold (char_data*& term) inline bool FOptiAttr::setTermBold (char_data*& term)
{ {
if ( term && append_sequence(F_enter_bold_mode.cap) ) if ( term && append_sequence(F_enter_bold_mode.cap) )
return (term->bold = true); return (term->attr.bit.bold = true);
else else
return false; return false;
} }
@ -751,8 +751,8 @@ inline bool FOptiAttr::unsetTermBold (char_data*& term)
reset(term); reset(term);
else else
{ {
term->bold = false; term->attr.bit.bold = false;
term->dim = false; term->attr.bit.dim = false;
} }
return true; return true;
@ -765,7 +765,7 @@ inline bool FOptiAttr::unsetTermBold (char_data*& term)
inline bool FOptiAttr::setTermDim (char_data*& term) inline bool FOptiAttr::setTermDim (char_data*& term)
{ {
if ( term && append_sequence(F_enter_dim_mode.cap) ) if ( term && append_sequence(F_enter_dim_mode.cap) )
return (term->dim = true); return (term->attr.bit.dim = true);
else else
return false; return false;
} }
@ -780,8 +780,8 @@ inline bool FOptiAttr::unsetTermDim (char_data*& term)
reset(term); reset(term);
else else
{ {
term->bold = false; term->attr.bit.bold = false;
term->dim = false; term->attr.bit.dim = false;
} }
return true; return true;
@ -794,7 +794,7 @@ inline bool FOptiAttr::unsetTermDim (char_data*& term)
inline bool FOptiAttr::setTermItalic (char_data*& term) inline bool FOptiAttr::setTermItalic (char_data*& term)
{ {
if ( term && append_sequence(F_enter_italics_mode.cap) ) if ( term && append_sequence(F_enter_italics_mode.cap) )
return (term->italic = true); return (term->attr.bit.italic = true);
else else
return false; return false;
} }
@ -807,7 +807,7 @@ inline bool FOptiAttr::unsetTermItalic (char_data*& term)
if ( F_exit_italics_mode.caused_reset ) if ( F_exit_italics_mode.caused_reset )
reset(term); reset(term);
else else
term->italic = false; term->attr.bit.italic = false;
return true; return true;
} }
@ -819,7 +819,7 @@ inline bool FOptiAttr::unsetTermItalic (char_data*& term)
inline bool FOptiAttr::setTermUnderline (char_data*& term) inline bool FOptiAttr::setTermUnderline (char_data*& term)
{ {
if ( term && append_sequence(F_enter_underline_mode.cap) ) if ( term && append_sequence(F_enter_underline_mode.cap) )
return (term->underline = true); return (term->attr.bit.underline = true);
else else
return false; return false;
} }
@ -834,8 +834,8 @@ inline bool FOptiAttr::unsetTermUnderline (char_data*& term)
reset(term); reset(term);
else else
{ {
term->underline = false; term->attr.bit.underline = false;
term->dbl_underline = false; term->attr.bit.dbl_underline = false;
} }
return true; return true;
@ -848,7 +848,7 @@ inline bool FOptiAttr::unsetTermUnderline (char_data*& term)
inline bool FOptiAttr::setTermBlink (char_data*& term) inline bool FOptiAttr::setTermBlink (char_data*& term)
{ {
if ( term && append_sequence(F_enter_blink_mode.cap) ) if ( term && append_sequence(F_enter_blink_mode.cap) )
return (term->blink = true); return (term->attr.bit.blink = true);
else else
return false; return false;
} }
@ -861,7 +861,7 @@ inline bool FOptiAttr::unsetTermBlink (char_data*& term)
if ( F_exit_blink_mode.caused_reset ) if ( F_exit_blink_mode.caused_reset )
reset(term); reset(term);
else else
term->blink = false; term->attr.bit.blink = false;
return true; return true;
} }
@ -873,7 +873,7 @@ inline bool FOptiAttr::unsetTermBlink (char_data*& term)
inline bool FOptiAttr::setTermReverse (char_data*& term) inline bool FOptiAttr::setTermReverse (char_data*& term)
{ {
if ( term && append_sequence(F_enter_reverse_mode.cap) ) if ( term && append_sequence(F_enter_reverse_mode.cap) )
return (term->reverse = true); return (term->attr.bit.reverse = true);
else else
return false; return false;
} }
@ -886,7 +886,7 @@ inline bool FOptiAttr::unsetTermReverse (char_data*& term)
if ( F_exit_reverse_mode.caused_reset ) if ( F_exit_reverse_mode.caused_reset )
reset(term); reset(term);
else else
term->reverse = false; term->attr.bit.reverse = false;
return true; return true;
} }
@ -898,7 +898,7 @@ inline bool FOptiAttr::unsetTermReverse (char_data*& term)
inline bool FOptiAttr::setTermStandout (char_data*& term) inline bool FOptiAttr::setTermStandout (char_data*& term)
{ {
if ( term && append_sequence(F_enter_standout_mode.cap) ) if ( term && append_sequence(F_enter_standout_mode.cap) )
return (term->standout = true); return (term->attr.bit.standout = true);
else else
return false; return false;
} }
@ -911,7 +911,7 @@ inline bool FOptiAttr::unsetTermStandout (char_data*& term)
if ( F_exit_standout_mode.caused_reset ) if ( F_exit_standout_mode.caused_reset )
reset(term); reset(term);
else else
term->standout = false; term->attr.bit.standout = false;
return true; return true;
} }
@ -923,7 +923,7 @@ inline bool FOptiAttr::unsetTermStandout (char_data*& term)
inline bool FOptiAttr::setTermInvisible (char_data*& term) inline bool FOptiAttr::setTermInvisible (char_data*& term)
{ {
if ( term && append_sequence(F_enter_secure_mode.cap) ) if ( term && append_sequence(F_enter_secure_mode.cap) )
return (term->invisible = true); return (term->attr.bit.invisible = true);
else else
return false; return false;
} }
@ -936,7 +936,7 @@ inline bool FOptiAttr::unsetTermInvisible (char_data*& term)
if ( F_exit_secure_mode.caused_reset ) if ( F_exit_secure_mode.caused_reset )
reset(term); reset(term);
else else
term->invisible = false; term->attr.bit.invisible = false;
return true; return true;
} }
@ -948,7 +948,7 @@ inline bool FOptiAttr::unsetTermInvisible (char_data*& term)
inline bool FOptiAttr::setTermProtected (char_data*& term) inline bool FOptiAttr::setTermProtected (char_data*& term)
{ {
if ( term && append_sequence(F_enter_protected_mode.cap) ) if ( term && append_sequence(F_enter_protected_mode.cap) )
return (term->protect = true); return (term->attr.bit.protect = true);
else else
return false; return false;
} }
@ -961,7 +961,7 @@ inline bool FOptiAttr::unsetTermProtected (char_data*& term)
if ( F_exit_protected_mode.caused_reset ) if ( F_exit_protected_mode.caused_reset )
reset(term); reset(term);
else else
term->protect = false; term->attr.bit.protect = false;
return true; return true;
} }
@ -973,7 +973,7 @@ inline bool FOptiAttr::unsetTermProtected (char_data*& term)
inline bool FOptiAttr::setTermCrossedOut (char_data*& term) inline bool FOptiAttr::setTermCrossedOut (char_data*& term)
{ {
if ( term && append_sequence(F_enter_crossed_out_mode.cap) ) if ( term && append_sequence(F_enter_crossed_out_mode.cap) )
return (term->crossed_out = true); return (term->attr.bit.crossed_out = true);
else else
return false; return false;
} }
@ -986,7 +986,7 @@ inline bool FOptiAttr::unsetTermCrossedOut (char_data*& term)
if ( F_exit_crossed_out_mode.caused_reset ) if ( F_exit_crossed_out_mode.caused_reset )
reset(term); reset(term);
else else
term->crossed_out = false; term->attr.bit.crossed_out = false;
return true; return true;
} }
@ -998,7 +998,7 @@ inline bool FOptiAttr::unsetTermCrossedOut (char_data*& term)
inline bool FOptiAttr::setTermDoubleUnderline (char_data*& term) inline bool FOptiAttr::setTermDoubleUnderline (char_data*& term)
{ {
if ( term && append_sequence(F_enter_dbl_underline_mode.cap) ) if ( term && append_sequence(F_enter_dbl_underline_mode.cap) )
return (term->dbl_underline = true); return (term->attr.bit.dbl_underline = true);
else else
return false; return false;
} }
@ -1013,8 +1013,8 @@ inline bool FOptiAttr::unsetTermDoubleUnderline (char_data*& term)
reset(term); reset(term);
else else
{ {
term->underline = false; term->attr.bit.underline = false;
term->dbl_underline = false; term->attr.bit.dbl_underline = false;
} }
return true; return true;
@ -1036,19 +1036,19 @@ bool FOptiAttr::setTermAttributes ( char_data*& term
append_sequence (sgr); append_sequence (sgr);
resetColor(term); resetColor(term);
term->standout = p1; term->attr.bit.standout = p1;
term->underline = p2; term->attr.bit.underline = p2;
term->reverse = p3; term->attr.bit.reverse = p3;
term->blink = p4; term->attr.bit.blink = p4;
term->dim = p5; term->attr.bit.dim = p5;
term->bold = p6; term->attr.bit.bold = p6;
term->invisible = p7; term->attr.bit.invisible = p7;
term->protect = p8; term->attr.bit.protect = p8;
term->alt_charset = p9; term->attr.bit.alt_charset = p9;
term->pc_charset = false; term->attr.bit.pc_charset = false;
term->italic = false; term->attr.bit.italic = false;
term->crossed_out = false; term->attr.bit.crossed_out = false;
term->dbl_underline = false; term->attr.bit.dbl_underline = false;
return true; return true;
} }
@ -1073,7 +1073,7 @@ inline bool FOptiAttr::setTermAltCharset (char_data*& term)
{ {
if ( term && append_sequence(F_enter_alt_charset_mode.cap) ) if ( term && append_sequence(F_enter_alt_charset_mode.cap) )
{ {
term->alt_charset = true; term->attr.bit.alt_charset = true;
return true; return true;
} }
else else
@ -1085,7 +1085,7 @@ inline bool FOptiAttr::unsetTermAltCharset (char_data*& term)
{ {
if ( term && append_sequence(F_exit_alt_charset_mode.cap) ) if ( term && append_sequence(F_exit_alt_charset_mode.cap) )
{ {
term->alt_charset = false; term->attr.bit.alt_charset = false;
return true; return true;
} }
else else
@ -1097,7 +1097,7 @@ inline bool FOptiAttr::setTermPCcharset (char_data*& term)
{ {
if ( term && append_sequence(F_enter_pc_charset_mode.cap) ) if ( term && append_sequence(F_enter_pc_charset_mode.cap) )
{ {
term->pc_charset = true; term->attr.bit.pc_charset = true;
return true; return true;
} }
else else
@ -1109,7 +1109,7 @@ inline bool FOptiAttr::unsetTermPCcharset (char_data*& term)
{ {
if ( term && append_sequence(F_exit_pc_charset_mode.cap) ) if ( term && append_sequence(F_exit_pc_charset_mode.cap) )
{ {
term->pc_charset = false; term->attr.bit.pc_charset = false;
return true; return true;
} }
else else
@ -1160,19 +1160,19 @@ bool FOptiAttr::hasAttribute (char_data*& attr)
{ {
if ( attr ) if ( attr )
{ {
return attr->bold == 1 return attr->attr.bit.bold == 1
|| attr->dim == 1 || attr->attr.bit.dim == 1
|| attr->italic == 1 || attr->attr.bit.italic == 1
|| attr->underline == 1 || attr->attr.bit.underline == 1
|| attr->blink == 1 || attr->attr.bit.blink == 1
|| attr->reverse == 1 || attr->attr.bit.reverse == 1
|| attr->standout == 1 || attr->attr.bit.standout == 1
|| attr->invisible == 1 || attr->attr.bit.invisible == 1
|| attr->protect == 1 || attr->attr.bit.protect == 1
|| attr->crossed_out == 1 || attr->attr.bit.crossed_out == 1
|| attr->dbl_underline == 1 || attr->attr.bit.dbl_underline == 1
|| attr->alt_charset == 1 || attr->attr.bit.alt_charset == 1
|| attr->pc_charset == 1; || attr->attr.bit.pc_charset == 1;
} }
return false; return false;
@ -1241,19 +1241,19 @@ inline void FOptiAttr::prevent_no_color_video_attributes (char_data*& attr)
switch ( bit & attr_without_color ) switch ( bit & attr_without_color )
{ {
case standout_mode: case standout_mode:
if ( attr->standout ) if ( attr->attr.bit.standout )
attr->standout = false; attr->attr.bit.standout = false;
break; break;
case underline_mode: case underline_mode:
if ( attr->underline ) if ( attr->attr.bit.underline )
attr->underline = false; attr->attr.bit.underline = false;
break; break;
case reverse_mode: case reverse_mode:
if ( attr->reverse ) if ( attr->attr.bit.reverse )
{ {
attr->reverse = false; attr->attr.bit.reverse = false;
if ( attr->fg_color != attr->bg_color ) if ( attr->fg_color != attr->bg_color )
fake_reverse = true; fake_reverse = true;
@ -1261,38 +1261,38 @@ inline void FOptiAttr::prevent_no_color_video_attributes (char_data*& attr)
break; break;
case blink_mode: case blink_mode:
if ( attr->blink ) if ( attr->attr.bit.blink )
attr->blink = false; attr->attr.bit.blink = false;
break; break;
case dim_mode: case dim_mode:
if ( attr->dim ) if ( attr->attr.bit.dim )
attr->dim = false; attr->attr.bit.dim = false;
break; break;
case bold_mode: case bold_mode:
if ( attr->bold ) if ( attr->attr.bit.bold )
attr->bold = false; attr->attr.bit.bold = false;
break; break;
case invisible_mode: case invisible_mode:
if ( attr->invisible ) if ( attr->attr.bit.invisible )
attr->invisible = false; attr->attr.bit.invisible = false;
break; break;
case protected_mode: case protected_mode:
if ( attr->protect ) if ( attr->attr.bit.protect )
attr->protect = false; attr->attr.bit.protect = false;
break; break;
case alt_charset_mode: case alt_charset_mode:
if ( attr->alt_charset ) if ( attr->attr.bit.alt_charset )
attr->alt_charset = false; attr->attr.bit.alt_charset = false;
break; break;
case italic_mode: case italic_mode:
if ( attr->italic ) if ( attr->attr.bit.italic )
attr->italic = false; attr->attr.bit.italic = false;
break; break;
default: default:
@ -1408,19 +1408,19 @@ inline void FOptiAttr::resetAttribute (char_data*& attr)
{ {
if ( attr ) if ( attr )
{ {
attr->bold = \ attr->attr.bit.bold = \
attr->dim = \ attr->attr.bit.dim = \
attr->italic = \ attr->attr.bit.italic = \
attr->underline = \ attr->attr.bit.underline = \
attr->blink = \ attr->attr.bit.blink = \
attr->reverse = \ attr->attr.bit.reverse = \
attr->standout = \ attr->attr.bit.standout = \
attr->invisible = \ attr->attr.bit.invisible = \
attr->protect = \ attr->attr.bit.protect = \
attr->crossed_out = \ attr->attr.bit.crossed_out = \
attr->dbl_underline = \ attr->attr.bit.dbl_underline = \
attr->alt_charset = \ attr->attr.bit.alt_charset = \
attr->pc_charset = 0; attr->attr.bit.pc_charset = 0;
} }
} }
@ -1469,19 +1469,19 @@ inline void FOptiAttr::detectSwitchOn (char_data*& term, char_data*& next)
if ( ! (term && next) ) if ( ! (term && next) )
return; return;
on.bold = ! term->bold && next->bold; on.attr.bit.bold = ! term->attr.bit.bold && next->attr.bit.bold;
on.dim = ! term->dim && next->dim; on.attr.bit.dim = ! term->attr.bit.dim && next->attr.bit.dim;
on.italic = ! term->italic && next->italic; on.attr.bit.italic = ! term->attr.bit.italic && next->attr.bit.italic;
on.underline = ! term->underline && next->underline; on.attr.bit.underline = ! term->attr.bit.underline && next->attr.bit.underline;
on.blink = ! term->blink && next->blink; on.attr.bit.blink = ! term->attr.bit.blink && next->attr.bit.blink;
on.reverse = ! term->reverse && next->reverse; on.attr.bit.reverse = ! term->attr.bit.reverse && next->attr.bit.reverse;
on.standout = ! term->standout && next->standout; on.attr.bit.standout = ! term->attr.bit.standout && next->attr.bit.standout;
on.invisible = ! term->invisible && next->invisible; on.attr.bit.invisible = ! term->attr.bit.invisible && next->attr.bit.invisible;
on.protect = ! term->protect && next->protect; on.attr.bit.protect = ! term->attr.bit.protect && next->attr.bit.protect;
on.crossed_out = ! term->crossed_out && next->crossed_out; on.attr.bit.crossed_out = ! term->attr.bit.crossed_out && next->attr.bit.crossed_out;
on.dbl_underline = ! term->dbl_underline && next->dbl_underline; on.attr.bit.dbl_underline = ! term->attr.bit.dbl_underline && next->attr.bit.dbl_underline;
on.alt_charset = ! term->alt_charset && next->alt_charset; on.attr.bit.alt_charset = ! term->attr.bit.alt_charset && next->attr.bit.alt_charset;
on.pc_charset = ! term->pc_charset && next->pc_charset; on.attr.bit.pc_charset = ! term->attr.bit.pc_charset && next->attr.bit.pc_charset;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1490,19 +1490,19 @@ inline void FOptiAttr::detectSwitchOff (char_data*& term, char_data*& next)
if ( ! (term && next) ) if ( ! (term && next) )
return; return;
off.bold = term->bold && ! next->bold; off.attr.bit.bold = term->attr.bit.bold && ! next->attr.bit.bold;
off.dim = term->dim && ! next->dim; off.attr.bit.dim = term->attr.bit.dim && ! next->attr.bit.dim;
off.italic = term->italic && ! next->italic; off.attr.bit.italic = term->attr.bit.italic && ! next->attr.bit.italic;
off.underline = term->underline && ! next->underline; off.attr.bit.underline = term->attr.bit.underline && ! next->attr.bit.underline;
off.blink = term->blink && ! next->blink; off.attr.bit.blink = term->attr.bit.blink && ! next->attr.bit.blink;
off.reverse = term->reverse && ! next->reverse; off.attr.bit.reverse = term->attr.bit.reverse && ! next->attr.bit.reverse;
off.standout = term->standout && ! next->standout; off.attr.bit.standout = term->attr.bit.standout && ! next->attr.bit.standout;
off.invisible = term->invisible && ! next->invisible; off.attr.bit.invisible = term->attr.bit.invisible && ! next->attr.bit.invisible;
off.protect = term->protect && ! next->protect; off.attr.bit.protect = term->attr.bit.protect && ! next->attr.bit.protect;
off.crossed_out = term->crossed_out && ! next->crossed_out; off.attr.bit.crossed_out = term->attr.bit.crossed_out && ! next->attr.bit.crossed_out;
off.dbl_underline = term->dbl_underline && ! next->dbl_underline; off.attr.bit.dbl_underline = term->attr.bit.dbl_underline && ! next->attr.bit.dbl_underline;
off.alt_charset = term->alt_charset && ! next->alt_charset; off.attr.bit.alt_charset = term->attr.bit.alt_charset && ! next->attr.bit.alt_charset;
off.pc_charset = term->pc_charset && ! next->pc_charset; off.attr.bit.pc_charset = term->attr.bit.pc_charset && ! next->attr.bit.pc_charset;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -39,25 +39,40 @@ class FOptiAttr
int code; // character code int code; // character code
short fg_color; // foreground color short fg_color; // foreground color
short bg_color; // background color short bg_color; // background color
uChar bold : 1; // bold
uChar dim : 1; // dim union attribute
uChar italic : 1; // italic {
uChar underline : 1; // underline struct
uChar blink : 1; // blink {
uChar reverse : 1; // reverse // Attribute byte #1
uChar standout : 1; // standout uChar bold : 1; // bold
uChar invisible : 1; // invisible uChar dim : 1; // dim
uChar protect : 1; // protect mode uChar italic : 1; // italic
uChar crossed_out : 1; // crossed out uChar underline : 1; // underline
uChar dbl_underline : 1; // double underline uChar blink : 1; // blink
uChar alt_charset : 1; // alternate character set (vt100) uChar reverse : 1; // reverse
uChar pc_charset : 1; // pc character set (CP437) uChar standout : 1; // standout
uChar transparent : 1; // transparent uChar invisible : 1; // invisible
uChar trans_shadow : 1; // transparent shadow // Attribute byte #2
uChar inherit_bg : 1; // inherit background uChar protect : 1; // protect mode
uChar no_changes : 1; // no changes required uChar crossed_out : 1; // crossed out
uChar printed : 1; // is printed to VTerm uChar dbl_underline : 1; // double underline
uChar : 6; // padding bits uChar alt_charset : 1; // alternate character set (vt100)
uChar pc_charset : 1; // pc character set (CP437)
uChar transparent : 1; // transparent
uChar trans_shadow : 1; // transparent shadow
uChar inherit_bg : 1; // inherit background
// Attribute byte #3
uChar no_changes : 1; // no changes required
uChar printed : 1; // is printed to VTerm
uChar : 6; // padding bits
} bit;
uChar byte1;
uChar byte2;
uChar byte3;
} attr;
} char_data; } char_data;
// Constructor // Constructor
@ -264,25 +279,11 @@ class FOptiAttr
inline bool operator == ( const FOptiAttr::char_data& lhs, inline bool operator == ( const FOptiAttr::char_data& lhs,
const FOptiAttr::char_data& rhs ) const FOptiAttr::char_data& rhs )
{ {
return lhs.code == rhs.code return lhs.code == rhs.code
&& lhs.fg_color == rhs.fg_color && lhs.fg_color == rhs.fg_color
&& lhs.bg_color == rhs.bg_color && lhs.bg_color == rhs.bg_color
&& lhs.bold == rhs.bold && lhs.attr.byte1 == rhs.attr.byte1
&& lhs.dim == rhs.dim && lhs.attr.byte2 == rhs.attr.byte2;
&& lhs.italic == rhs.italic
&& lhs.underline == rhs.underline
&& lhs.blink == rhs.blink
&& lhs.reverse == rhs.reverse
&& lhs.standout == rhs.standout
&& lhs.invisible == rhs.invisible
&& lhs.protect == rhs.protect
&& lhs.crossed_out == rhs.crossed_out
&& lhs.dbl_underline == rhs.dbl_underline
&& lhs.alt_charset == rhs.alt_charset
&& lhs.pc_charset == rhs.pc_charset
&& lhs.transparent == rhs.transparent
&& lhs.trans_shadow == rhs.trans_shadow
&& lhs.inherit_bg == rhs.inherit_bg;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -119,8 +119,8 @@ int FTermBuffer::write (const FString& s)
char_data nc; // next character char_data nc; // next character
nc = FVTerm::getAttribute(); nc = FVTerm::getAttribute();
nc.code = *p; nc.code = *p;
nc.no_changes = false; nc.attr.bit.no_changes = false;
nc.printed = false; nc.attr.bit.printed = false;
data.push_back(nc); data.push_back(nc);
@ -138,8 +138,8 @@ int FTermBuffer::write (register int c)
char_data nc; // next character char_data nc; // next character
nc = FVTerm::getAttribute(); nc = FVTerm::getAttribute();
nc.code = c; nc.code = c;
nc.no_changes = false; nc.attr.bit.no_changes = false;
nc.printed = false; nc.attr.bit.printed = false;
data.push_back(nc); data.push_back(nc);
return 1; return 1;

View File

@ -476,27 +476,27 @@ int FVTerm::print (term_area* area, const FString& s)
int ay = area->cursor_y - 1; int ay = area->cursor_y - 1;
char_data nc; // next character char_data nc; // next character
nc.code = *p; nc.code = *p;
nc.fg_color = next_attribute.fg_color; nc.fg_color = next_attribute.fg_color;
nc.bg_color = next_attribute.bg_color; nc.bg_color = next_attribute.bg_color;
nc.bold = next_attribute.bold; nc.attr.bit.bold = next_attribute.attr.bit.bold;
nc.dim = next_attribute.dim; nc.attr.bit.dim = next_attribute.attr.bit.dim;
nc.italic = next_attribute.italic; nc.attr.bit.italic = next_attribute.attr.bit.italic;
nc.underline = next_attribute.underline; nc.attr.bit.underline = next_attribute.attr.bit.underline;
nc.blink = next_attribute.blink; nc.attr.bit.blink = next_attribute.attr.bit.blink;
nc.reverse = next_attribute.reverse; nc.attr.bit.reverse = next_attribute.attr.bit.reverse;
nc.standout = next_attribute.standout; nc.attr.bit.standout = next_attribute.attr.bit.standout;
nc.invisible = next_attribute.invisible; nc.attr.bit.invisible = next_attribute.attr.bit.invisible;
nc.protect = next_attribute.protect; nc.attr.bit.protect = next_attribute.attr.bit.protect;
nc.crossed_out = next_attribute.crossed_out; nc.attr.bit.crossed_out = next_attribute.attr.bit.crossed_out;
nc.dbl_underline = next_attribute.dbl_underline; nc.attr.bit.dbl_underline = next_attribute.attr.bit.dbl_underline;
nc.alt_charset = next_attribute.alt_charset; nc.attr.bit.alt_charset = next_attribute.attr.bit.alt_charset;
nc.pc_charset = next_attribute.pc_charset; nc.attr.bit.pc_charset = next_attribute.attr.bit.pc_charset;
nc.transparent = next_attribute.transparent; nc.attr.bit.transparent = next_attribute.attr.bit.transparent;
nc.trans_shadow = next_attribute.trans_shadow; nc.attr.bit.trans_shadow = next_attribute.attr.bit.trans_shadow;
nc.inherit_bg = next_attribute.inherit_bg; nc.attr.bit.inherit_bg = next_attribute.attr.bit.inherit_bg;
nc.no_changes = false; nc.attr.bit.no_changes = false;
nc.printed = false; nc.attr.bit.printed = false;
if ( area->cursor_x > 0 if ( area->cursor_x > 0
&& area->cursor_y > 0 && area->cursor_y > 0
@ -509,16 +509,16 @@ int FVTerm::print (term_area* area, const FString& s)
if ( *ac != nc ) // compare with an overloaded operator if ( *ac != nc ) // compare with an overloaded operator
{ {
if ( ( ! ac->transparent && nc.transparent ) if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->trans_shadow && nc.trans_shadow ) || ( ! ac->attr.bit.trans_shadow && nc.attr.bit.trans_shadow )
|| ( ! ac->inherit_bg && nc.inherit_bg ) ) || ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
{ {
// add one transparent character form line // add one transparent character form line
area->changes[ay].trans_count++; area->changes[ay].trans_count++;
} }
else if ( ( ac->transparent && ! nc.transparent ) else if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->trans_shadow && ! nc.trans_shadow ) || ( ac->attr.bit.trans_shadow && ! nc.attr.bit.trans_shadow )
|| ( ac->inherit_bg && ! nc.inherit_bg ) ) || ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
{ {
// remove one transparent character from line // remove one transparent character from line
area->changes[ay].trans_count--; area->changes[ay].trans_count--;
@ -645,16 +645,16 @@ int FVTerm::print (term_area* area, const std::vector<char_data>& termString)
if ( *ac != nc ) // compare with an overloaded operator if ( *ac != nc ) // compare with an overloaded operator
{ {
if ( ( ! ac->transparent && nc.transparent ) if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->trans_shadow && nc.trans_shadow ) || ( ! ac->attr.bit.trans_shadow && nc.attr.bit.trans_shadow )
|| ( ! ac->inherit_bg && nc.inherit_bg ) ) || ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
{ {
// add one transparent character form line // add one transparent character form line
area->changes[ay].trans_count++; area->changes[ay].trans_count++;
} }
else if ( ( ac->transparent && ! nc.transparent ) else if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->trans_shadow && ! nc.trans_shadow ) || ( ac->attr.bit.trans_shadow && ! nc.attr.bit.trans_shadow )
|| ( ac->inherit_bg && ! nc.inherit_bg ) ) || ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
{ {
// remove one transparent character from line // remove one transparent character from line
area->changes[ay].trans_count--; area->changes[ay].trans_count--;
@ -726,27 +726,27 @@ int FVTerm::print (term_area* area, register int c)
ax = area->cursor_x - 1; ax = area->cursor_x - 1;
ay = area->cursor_y - 1; ay = area->cursor_y - 1;
nc.code = c; nc.code = c;
nc.fg_color = next_attribute.fg_color; nc.fg_color = next_attribute.fg_color;
nc.bg_color = next_attribute.bg_color; nc.bg_color = next_attribute.bg_color;
nc.bold = next_attribute.bold; nc.attr.bit.bold = next_attribute.attr.bit.bold;
nc.dim = next_attribute.dim; nc.attr.bit.dim = next_attribute.attr.bit.dim;
nc.italic = next_attribute.italic; nc.attr.bit.italic = next_attribute.attr.bit.italic;
nc.underline = next_attribute.underline; nc.attr.bit.underline = next_attribute.attr.bit.underline;
nc.blink = next_attribute.blink; nc.attr.bit.blink = next_attribute.attr.bit.blink;
nc.reverse = next_attribute.reverse; nc.attr.bit.reverse = next_attribute.attr.bit.reverse;
nc.standout = next_attribute.standout; nc.attr.bit.standout = next_attribute.attr.bit.standout;
nc.invisible = next_attribute.invisible; nc.attr.bit.invisible = next_attribute.attr.bit.invisible;
nc.protect = next_attribute.protect; nc.attr.bit.protect = next_attribute.attr.bit.protect;
nc.crossed_out = next_attribute.crossed_out; nc.attr.bit.crossed_out = next_attribute.attr.bit.crossed_out;
nc.dbl_underline = next_attribute.dbl_underline; nc.attr.bit.dbl_underline = next_attribute.attr.bit.dbl_underline;
nc.alt_charset = next_attribute.alt_charset; nc.attr.bit.alt_charset = next_attribute.attr.bit.alt_charset;
nc.pc_charset = next_attribute.pc_charset; nc.attr.bit.pc_charset = next_attribute.attr.bit.pc_charset;
nc.transparent = next_attribute.transparent; nc.attr.bit.transparent = next_attribute.attr.bit.transparent;
nc.trans_shadow = next_attribute.trans_shadow; nc.attr.bit.trans_shadow = next_attribute.attr.bit.trans_shadow;
nc.inherit_bg = next_attribute.inherit_bg; nc.attr.bit.inherit_bg = next_attribute.attr.bit.inherit_bg;
nc.no_changes = false; nc.attr.bit.no_changes = false;
nc.printed = false; nc.attr.bit.printed = false;
if ( area->cursor_x > 0 if ( area->cursor_x > 0
&& area->cursor_y > 0 && area->cursor_y > 0
@ -759,17 +759,17 @@ int FVTerm::print (term_area* area, register int c)
if ( *ac != nc ) // compare with an overloaded operator if ( *ac != nc ) // compare with an overloaded operator
{ {
if ( ( ! ac->transparent && nc.transparent ) if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->trans_shadow && nc.trans_shadow ) || ( ! ac->attr.bit.trans_shadow && nc.attr.bit.trans_shadow )
|| ( ! ac->inherit_bg && nc.inherit_bg ) ) || ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
{ {
// add one transparent character form line // add one transparent character form line
area->changes[ay].trans_count++; area->changes[ay].trans_count++;
} }
if ( ( ac->transparent && ! nc.transparent ) if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->trans_shadow && ! nc.trans_shadow ) || ( ac->attr.bit.trans_shadow && ! nc.attr.bit.trans_shadow )
|| ( ac->inherit_bg && ! nc.inherit_bg ) ) || ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
{ {
// remove one transparent character from line // remove one transparent character from line
area->changes[ay].trans_count--; area->changes[ay].trans_count--;
@ -1020,27 +1020,27 @@ void FVTerm::resizeArea ( int offset_left, int offset_top
area->bottom_shadow = bsh; area->bottom_shadow = bsh;
area->has_changes = false; area->has_changes = false;
default_char.code = ' '; default_char.code = ' ';
default_char.fg_color = fc::Default; default_char.fg_color = fc::Default;
default_char.bg_color = fc::Default; default_char.bg_color = fc::Default;
default_char.bold = 0; default_char.attr.bit.bold = 0;
default_char.dim = 0; default_char.attr.bit.dim = 0;
default_char.italic = 0; default_char.attr.bit.italic = 0;
default_char.underline = 0; default_char.attr.bit.underline = 0;
default_char.blink = 0; default_char.attr.bit.blink = 0;
default_char.reverse = 0; default_char.attr.bit.reverse = 0;
default_char.standout = 0; default_char.attr.bit.standout = 0;
default_char.invisible = 0; default_char.attr.bit.invisible = 0;
default_char.protect = 0; default_char.attr.bit.protect = 0;
default_char.crossed_out = 0; default_char.attr.bit.crossed_out = 0;
default_char.dbl_underline = 0; default_char.attr.bit.dbl_underline = 0;
default_char.alt_charset = 0; default_char.attr.bit.alt_charset = 0;
default_char.pc_charset = 0; default_char.attr.bit.pc_charset = 0;
default_char.transparent = 0; default_char.attr.bit.transparent = 0;
default_char.trans_shadow = 0; default_char.attr.bit.trans_shadow = 0;
default_char.inherit_bg = 0; default_char.attr.bit.inherit_bg = 0;
default_char.no_changes = 0; default_char.attr.bit.no_changes = 0;
default_char.printed = 0; default_char.attr.bit.printed = 0;
std::fill_n (area->text, area_size, default_char); std::fill_n (area->text, area_size, default_char);
@ -1156,16 +1156,16 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
int line_len = win->width + win->right_shadow; int line_len = win->width + win->right_shadow;
tmp = &win->text[(ty+y-win_y) * line_len + (tx+x-win_x)]; tmp = &win->text[(ty+y-win_y) * line_len + (tx+x-win_x)];
if ( ! tmp->transparent ) // current character not transparent if ( ! tmp->attr.bit.transparent ) // current character not transparent
{ {
if ( tmp->trans_shadow ) // transparent shadow if ( tmp->attr.bit.trans_shadow ) // transparent shadow
{ {
// keep the current vterm character // keep the current vterm character
std::memcpy (&s_ch, sc, sizeof(char_data)); std::memcpy (&s_ch, sc, sizeof(char_data));
s_ch.fg_color = tmp->fg_color; s_ch.fg_color = tmp->fg_color;
s_ch.bg_color = tmp->bg_color; s_ch.bg_color = tmp->bg_color;
s_ch.reverse = false; s_ch.attr.bit.reverse = false;
s_ch.standout = false; s_ch.attr.bit.standout = false;
if ( s_ch.code == fc::LowerHalfBlock if ( s_ch.code == fc::LowerHalfBlock
|| s_ch.code == fc::UpperHalfBlock || s_ch.code == fc::UpperHalfBlock
@ -1177,7 +1177,7 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
sc = &s_ch; sc = &s_ch;
} }
else if ( tmp->inherit_bg ) else if ( tmp->attr.bit.inherit_bg )
{ {
// add the covered background to this character // add the covered background to this character
std::memcpy (&i_ch, tmp, sizeof(char_data)); std::memcpy (&i_ch, tmp, sizeof(char_data));
@ -1254,11 +1254,11 @@ FVTerm::covered_state FVTerm::isCovered ( int x, int y
int line_len = win->width + win->right_shadow; int line_len = win->width + win->right_shadow;
tmp = &win->text[(y-win_y) * line_len + (x-win_x)]; tmp = &win->text[(y-win_y) * line_len + (x-win_x)];
if ( tmp->trans_shadow ) if ( tmp->attr.bit.trans_shadow )
{ {
is_covered = half_covered; is_covered = half_covered;
} }
else if ( ! tmp->transparent ) else if ( ! tmp->attr.bit.transparent )
{ {
is_covered = fully_covered; is_covered = fully_covered;
break; break;
@ -1426,8 +1426,8 @@ void FVTerm::updateVTerm (term_area* area)
oc = getOverlappedCharacter (gx+1 - ol, gy+1, area->widget); oc = getOverlappedCharacter (gx+1 - ol, gy+1, area->widget);
ch.fg_color = oc.fg_color; ch.fg_color = oc.fg_color;
ch.bg_color = oc.bg_color; ch.bg_color = oc.bg_color;
ch.reverse = false; ch.attr.bit.reverse = false;
ch.standout = false; ch.attr.bit.standout = false;
if ( ch.code == fc::LowerHalfBlock if ( ch.code == fc::LowerHalfBlock
|| ch.code == fc::UpperHalfBlock || ch.code == fc::UpperHalfBlock
@ -1437,28 +1437,28 @@ void FVTerm::updateVTerm (term_area* area)
|| ch.code == fc::FullBlock ) || ch.code == fc::FullBlock )
ch.code = ' '; ch.code = ' ';
ch.no_changes = bool(tc->printed && *tc == ch); ch.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data)); std::memcpy (tc, &ch, sizeof(char_data));
} }
else if ( ac->transparent ) // transparent else if ( ac->attr.bit.transparent ) // transparent
{ {
// restore one character on vterm // restore one character on vterm
char_data ch; char_data ch;
ch = getCoveredCharacter (gx+1 - ol, gy+1, area->widget); ch = getCoveredCharacter (gx+1 - ol, gy+1, area->widget);
ch.no_changes = bool(tc->printed && *tc == ch); ch.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data)); std::memcpy (tc, &ch, sizeof(char_data));
} }
else // not transparent else // not transparent
{ {
if ( ac->trans_shadow ) // transparent shadow if ( ac->attr.bit.trans_shadow ) // transparent shadow
{ {
// get covered character + add the current color // get covered character + add the current color
char_data ch; char_data ch;
ch = getCoveredCharacter (gx+1 - ol, gy+1, area->widget); ch = getCoveredCharacter (gx+1 - ol, gy+1, area->widget);
ch.fg_color = ac->fg_color; ch.fg_color = ac->fg_color;
ch.bg_color = ac->bg_color; ch.bg_color = ac->bg_color;
ch.reverse = false; ch.attr.bit.reverse = false;
ch.standout = false; ch.attr.bit.standout = false;
if ( ch.code == fc::LowerHalfBlock if ( ch.code == fc::LowerHalfBlock
|| ch.code == fc::UpperHalfBlock || ch.code == fc::UpperHalfBlock
@ -1468,30 +1468,30 @@ void FVTerm::updateVTerm (term_area* area)
|| ch.code == fc::FullBlock ) || ch.code == fc::FullBlock )
ch.code = ' '; ch.code = ' ';
ch.no_changes = bool(tc->printed && *tc == ch); ch.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data)); std::memcpy (tc, &ch, sizeof(char_data));
} }
else if ( ac->inherit_bg ) else if ( ac->attr.bit.inherit_bg )
{ {
// add the covered background to this character // add the covered background to this character
char_data ch, cc; char_data ch, cc;
std::memcpy (&ch, ac, sizeof(char_data)); std::memcpy (&ch, ac, sizeof(char_data));
cc = getCoveredCharacter (gx+1 - ol, gy+1, area->widget); cc = getCoveredCharacter (gx+1 - ol, gy+1, area->widget);
ch.bg_color = cc.bg_color; ch.bg_color = cc.bg_color;
ch.no_changes = bool(tc->printed && *tc == ch); ch.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == ch);
std::memcpy (tc, &ch, sizeof(char_data)); std::memcpy (tc, &ch, sizeof(char_data));
} }
else // default else // default
{ {
if ( tc->printed && *tc == *ac ) if ( tc->attr.bit.printed && *tc == *ac )
{ {
std::memcpy (tc, ac, sizeof(char_data)); std::memcpy (tc, ac, sizeof(char_data));
tc->no_changes = true; tc->attr.bit.no_changes = true;
} }
else else
{ {
std::memcpy (tc, ac, sizeof(char_data)); std::memcpy (tc, ac, sizeof(char_data));
tc->no_changes = false; tc->attr.bit.no_changes = false;
} }
} }
} }
@ -1774,7 +1774,7 @@ void FVTerm::putArea (int ax, int ay, term_area* area)
tc = &vterm->text[(ay+y) * vterm->width + (ax+x)]; tc = &vterm->text[(ay+y) * vterm->width + (ax+x)];
ac = &area->text[y * line_len + ol + x]; ac = &area->text[y * line_len + ol + x];
if ( ac->transparent ) // transparent if ( ac->attr.bit.transparent ) // transparent
{ {
// restore one character on vterm // restore one character on vterm
char_data ch; char_data ch;
@ -1783,15 +1783,15 @@ void FVTerm::putArea (int ax, int ay, term_area* area)
} }
else // not transparent else // not transparent
{ {
if ( ac->trans_shadow ) // transparent shadow if ( ac->attr.bit.trans_shadow ) // transparent shadow
{ {
// get covered character + add the current color // get covered character + add the current color
char_data ch; char_data ch;
ch = getCoveredCharacter (ax+x+1, ay+y+1, area->widget); ch = getCoveredCharacter (ax+x+1, ay+y+1, area->widget);
ch.fg_color = ac->fg_color; ch.fg_color = ac->fg_color;
ch.bg_color = ac->bg_color; ch.bg_color = ac->bg_color;
ch.reverse = false; ch.attr.bit.reverse = false;
ch.standout = false; ch.attr.bit.standout = false;
if ( ch.code == fc::LowerHalfBlock if ( ch.code == fc::LowerHalfBlock
|| ch.code == fc::UpperHalfBlock || ch.code == fc::UpperHalfBlock
@ -1803,7 +1803,7 @@ void FVTerm::putArea (int ax, int ay, term_area* area)
std::memcpy (tc, &ch, sizeof(char_data)); std::memcpy (tc, &ch, sizeof(char_data));
} }
else if ( ac->inherit_bg ) else if ( ac->attr.bit.inherit_bg )
{ {
// add the covered background to this character // add the covered background to this character
char_data ch, cc; char_data ch, cc;
@ -1975,7 +1975,7 @@ void FVTerm::clearArea (term_area* area, int fillchar)
{ {
if ( clearTerm (fillchar) ) if ( clearTerm (fillchar) )
{ {
nc.printed = true; nc.attr.bit.printed = true;
std::fill_n (vterm->text, area_size, nc); std::fill_n (vterm->text, area_size, nc);
} }
else else
@ -1996,7 +1996,7 @@ void FVTerm::clearArea (term_area* area, int fillchar)
else else
{ {
char_data t_char = nc; char_data t_char = nc;
t_char.transparent = true; t_char.attr.bit.transparent = true;
for (int y=0; y < area->height; y++) for (int y=0; y < area->height; y++)
{ {
@ -2020,9 +2020,9 @@ void FVTerm::clearArea (term_area* area, int fillchar)
area->changes[i].xmin = 0; area->changes[i].xmin = 0;
area->changes[i].xmax = w - 1; area->changes[i].xmax = w - 1;
if ( nc.transparent if ( nc.attr.bit.transparent
|| nc.trans_shadow || nc.attr.bit.trans_shadow
|| nc.inherit_bg ) || nc.attr.bit.inherit_bg )
area->changes[i].trans_count = w; area->changes[i].trans_count = w;
else if ( area->right_shadow != 0 ) else if ( area->right_shadow != 0 )
area->changes[i].trans_count = uInt(area->right_shadow); area->changes[i].trans_count = uInt(area->right_shadow);
@ -2127,19 +2127,19 @@ FVTerm::char_data FVTerm::getCharacter ( character_type char_type
tmp = &win->text[(y-win_y) * line_len + (x-win_x)]; tmp = &win->text[(y-win_y) * line_len + (x-win_x)];
// current character not transparent // current character not transparent
if ( ! tmp->transparent ) if ( ! tmp->attr.bit.transparent )
{ {
if ( tmp->trans_shadow ) // transparent shadow if ( tmp->attr.bit.trans_shadow ) // transparent shadow
{ {
// keep the current vterm character // keep the current vterm character
std::memcpy (&s_ch, cc, sizeof(char_data)); std::memcpy (&s_ch, cc, sizeof(char_data));
s_ch.fg_color = tmp->fg_color; s_ch.fg_color = tmp->fg_color;
s_ch.bg_color = tmp->bg_color; s_ch.bg_color = tmp->bg_color;
s_ch.reverse = false; s_ch.attr.bit.reverse = false;
s_ch.standout = false; s_ch.attr.bit.standout = false;
cc = &s_ch; cc = &s_ch;
} }
else if ( tmp->inherit_bg ) else if ( tmp->attr.bit.inherit_bg )
{ {
// add the covered background to this character // add the covered background to this character
std::memcpy (&i_ch, tmp, sizeof(char_data)); std::memcpy (&i_ch, tmp, sizeof(char_data));
@ -2273,27 +2273,27 @@ void FVTerm::init()
stop_terminal_updates = false; stop_terminal_updates = false;
// term_attribute stores the current state of the terminal // term_attribute stores the current state of the terminal
term_attribute.code = '\0'; term_attribute.code = '\0';
term_attribute.fg_color = fc::Default; term_attribute.fg_color = fc::Default;
term_attribute.bg_color = fc::Default; term_attribute.bg_color = fc::Default;
term_attribute.bold = \ term_attribute.attr.bit.bold = \
term_attribute.dim = \ term_attribute.attr.bit.dim = \
term_attribute.italic = \ term_attribute.attr.bit.italic = \
term_attribute.underline = \ term_attribute.attr.bit.underline = \
term_attribute.blink = \ term_attribute.attr.bit.blink = \
term_attribute.reverse = \ term_attribute.attr.bit.reverse = \
term_attribute.standout = \ term_attribute.attr.bit.standout = \
term_attribute.invisible = \ term_attribute.attr.bit.invisible = \
term_attribute.protect = \ term_attribute.attr.bit.protect = \
term_attribute.crossed_out = \ term_attribute.attr.bit.crossed_out = \
term_attribute.dbl_underline = \ term_attribute.attr.bit.dbl_underline = \
term_attribute.alt_charset = \ term_attribute.attr.bit.alt_charset = \
term_attribute.pc_charset = \ term_attribute.attr.bit.pc_charset = \
term_attribute.transparent = \ term_attribute.attr.bit.transparent = \
term_attribute.trans_shadow = \ term_attribute.attr.bit.trans_shadow = \
term_attribute.inherit_bg = \ term_attribute.attr.bit.inherit_bg = \
term_attribute.no_changes = \ term_attribute.attr.bit.no_changes = \
term_attribute.printed = false; term_attribute.attr.bit.printed = false;
// next_attribute contains the state of the next printed character // next_attribute contains the state of the next printed character
std::memcpy (&next_attribute, &term_attribute, sizeof(char_data)); std::memcpy (&next_attribute, &term_attribute, sizeof(char_data));
@ -2506,10 +2506,10 @@ void FVTerm::updateTerminalLine (uInt y)
{ {
char_data* print_char; char_data* print_char;
print_char = &vt->text[y * uInt(vt->width) + x]; print_char = &vt->text[y * uInt(vt->width) + x];
print_char->printed = true; print_char->attr.bit.printed = true;
// skip character with no changes // skip character with no changes
if ( print_char->no_changes ) if ( print_char->attr.bit.no_changes )
{ {
uInt count = 1; uInt count = 1;
@ -2517,7 +2517,7 @@ void FVTerm::updateTerminalLine (uInt y)
{ {
char_data* ch = &vt->text[y * uInt(vt->width) + i]; char_data* ch = &vt->text[y * uInt(vt->width) + i];
if ( ch->no_changes ) if ( ch->attr.bit.no_changes )
count++; count++;
else else
break; break;
@ -2705,7 +2705,7 @@ inline void FVTerm::markAsPrinted (uInt pos, uInt line)
{ {
// Marks a character as printed // Marks a character as printed
vterm->text[line * uInt(vterm->width) + pos].printed = true; vterm->text[line * uInt(vterm->width) + pos].attr.bit.printed = true;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -2714,7 +2714,7 @@ inline void FVTerm::markAsPrinted (uInt from, uInt to, uInt line)
// Marks characters in the specified range [from .. to] as printed // Marks characters in the specified range [from .. to] as printed
for (uInt x=from; x <= to; x++) for (uInt x=from; x <= to; x++)
vterm->text[line * uInt(vterm->width) + x].printed = true; vterm->text[line * uInt(vterm->width) + x].attr.bit.printed = true;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -2778,10 +2778,10 @@ inline void FVTerm::charsetChanges (char_data*& next_char)
next_char->code = int(ch_enc); next_char->code = int(ch_enc);
if ( Encoding == fc::VT100 ) if ( Encoding == fc::VT100 )
next_char->alt_charset = true; next_char->attr.bit.alt_charset = true;
else if ( Encoding == fc::PC ) else if ( Encoding == fc::PC )
{ {
next_char->pc_charset = true; next_char->attr.bit.pc_charset = true;
if ( isXTerminal() && hasUTF8() && ch_enc < 0x20 ) // Character 0x00..0x1f if ( isXTerminal() && hasUTF8() && ch_enc < 0x20 ) // Character 0x00..0x1f
next_char->code = int(charEncode(code, fc::ASCII)); next_char->code = int(charEncode(code, fc::ASCII));

View File

@ -482,31 +482,31 @@ inline void FVTerm::setColor (register short fg, register short bg)
inline void FVTerm::setNormal() inline void FVTerm::setNormal()
{ {
// reset all character attributes // reset all character attributes
next_attribute.bold = \ next_attribute.attr.bit.bold = \
next_attribute.dim = \ next_attribute.attr.bit.dim = \
next_attribute.italic = \ next_attribute.attr.bit.italic = \
next_attribute.underline = \ next_attribute.attr.bit.underline = \
next_attribute.blink = \ next_attribute.attr.bit.blink = \
next_attribute.reverse = \ next_attribute.attr.bit.reverse = \
next_attribute.standout = \ next_attribute.attr.bit.standout = \
next_attribute.invisible = \ next_attribute.attr.bit.invisible = \
next_attribute.protect = \ next_attribute.attr.bit.protect = \
next_attribute.crossed_out = \ next_attribute.attr.bit.crossed_out = \
next_attribute.dbl_underline = \ next_attribute.attr.bit.dbl_underline = \
next_attribute.alt_charset = \ next_attribute.attr.bit.alt_charset = \
next_attribute.pc_charset = \ next_attribute.attr.bit.pc_charset = \
next_attribute.transparent = \ next_attribute.attr.bit.transparent = \
next_attribute.trans_shadow = \ next_attribute.attr.bit.trans_shadow = \
next_attribute.inherit_bg = \ next_attribute.attr.bit.inherit_bg = \
next_attribute.no_changes = false; next_attribute.attr.bit.no_changes = false;
next_attribute.fg_color = fc::Default; next_attribute.fg_color = fc::Default;
next_attribute.bg_color = fc::Default; next_attribute.bg_color = fc::Default;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setBold (register bool on) inline bool FVTerm::setBold (register bool on)
{ return (next_attribute.bold = on); } { return (next_attribute.attr.bit.bold = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setBold() inline bool FVTerm::setBold()
@ -518,7 +518,7 @@ inline bool FVTerm::unsetBold()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setDim (register bool on) inline bool FVTerm::setDim (register bool on)
{ return (next_attribute.dim = on); } { return (next_attribute.attr.bit.dim = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setDim() inline bool FVTerm::setDim()
@ -530,7 +530,7 @@ inline bool FVTerm::unsetDim()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setItalic (register bool on) inline bool FVTerm::setItalic (register bool on)
{ return (next_attribute.italic = on); } { return (next_attribute.attr.bit.italic = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setItalic() inline bool FVTerm::setItalic()
@ -542,7 +542,7 @@ inline bool FVTerm::unsetItalic()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setUnderline (register bool on) inline bool FVTerm::setUnderline (register bool on)
{ return (next_attribute.underline = on); } { return (next_attribute.attr.bit.underline = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setUnderline() inline bool FVTerm::setUnderline()
@ -554,7 +554,7 @@ inline bool FVTerm::unsetUnderline()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setBlink (register bool on) inline bool FVTerm::setBlink (register bool on)
{ return (next_attribute.blink = on); } { return (next_attribute.attr.bit.blink = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setBlink() inline bool FVTerm::setBlink()
@ -566,7 +566,7 @@ inline bool FVTerm::unsetBlink()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setReverse (register bool on) inline bool FVTerm::setReverse (register bool on)
{ return (next_attribute.reverse = on); } { return (next_attribute.attr.bit.reverse = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setReverse() inline bool FVTerm::setReverse()
@ -578,7 +578,7 @@ inline bool FVTerm::unsetReverse()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setStandout (register bool on) inline bool FVTerm::setStandout (register bool on)
{ return (next_attribute.standout = on); } { return (next_attribute.attr.bit.standout = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setStandout() inline bool FVTerm::setStandout()
@ -590,7 +590,7 @@ inline bool FVTerm::unsetStandout()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setInvisible (register bool on) inline bool FVTerm::setInvisible (register bool on)
{ return (next_attribute.invisible = on); } { return (next_attribute.attr.bit.invisible = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setInvisible() inline bool FVTerm::setInvisible()
@ -602,7 +602,7 @@ inline bool FVTerm::unsetInvisible()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setProtected (register bool on) inline bool FVTerm::setProtected (register bool on)
{ return (next_attribute.protect = on); } { return (next_attribute.attr.bit.protect = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setProtected() inline bool FVTerm::setProtected()
@ -614,7 +614,7 @@ inline bool FVTerm::unsetProtected()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setCrossedOut (register bool on) inline bool FVTerm::setCrossedOut (register bool on)
{ return (next_attribute.crossed_out = on); } { return (next_attribute.attr.bit.crossed_out = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setCrossedOut() inline bool FVTerm::setCrossedOut()
@ -626,7 +626,7 @@ inline bool FVTerm::unsetCrossedOut()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setDoubleUnderline (register bool on) inline bool FVTerm::setDoubleUnderline (register bool on)
{ return (next_attribute.dbl_underline = on); } { return (next_attribute.attr.bit.dbl_underline = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setDoubleUnderline() inline bool FVTerm::setDoubleUnderline()
@ -638,7 +638,7 @@ inline bool FVTerm::unsetDoubleUnderline()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setAltCharset (register bool on) inline bool FVTerm::setAltCharset (register bool on)
{ return (next_attribute.alt_charset = on); } { return (next_attribute.attr.bit.alt_charset = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setAltCharset() inline bool FVTerm::setAltCharset()
@ -650,7 +650,7 @@ inline bool FVTerm::unsetAltCharset()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setPCcharset (register bool on) inline bool FVTerm::setPCcharset (register bool on)
{ return (next_attribute.pc_charset = on); } { return (next_attribute.attr.bit.pc_charset = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setPCcharset() inline bool FVTerm::setPCcharset()
@ -662,7 +662,7 @@ inline bool FVTerm::unsetPCcharset()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setTransparent (register bool on) inline bool FVTerm::setTransparent (register bool on)
{ return (next_attribute.transparent = on); } { return (next_attribute.attr.bit.transparent = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setTransparent() inline bool FVTerm::setTransparent()
@ -674,7 +674,7 @@ inline bool FVTerm::unsetTransparent()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setTransShadow (register bool on) inline bool FVTerm::setTransShadow (register bool on)
{ return (next_attribute.trans_shadow = on); } { return (next_attribute.attr.bit.trans_shadow = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setTransShadow() inline bool FVTerm::setTransShadow()
@ -686,7 +686,7 @@ inline bool FVTerm::unsetTransShadow()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setInheritBackground (register bool on) inline bool FVTerm::setInheritBackground (register bool on)
{ return (next_attribute.inherit_bg = on); } { return (next_attribute.attr.bit.inherit_bg = on); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::setInheritBackground() inline bool FVTerm::setInheritBackground()
@ -702,67 +702,67 @@ inline bool FVTerm::isCursorHidden()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isBold() inline bool FVTerm::isBold()
{ return next_attribute.bold; } { return next_attribute.attr.bit.bold; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isDim() inline bool FVTerm::isDim()
{ return next_attribute.dim; } { return next_attribute.attr.bit.dim; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isItalic() inline bool FVTerm::isItalic()
{ return next_attribute.italic; } { return next_attribute.attr.bit.italic; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isUnderline() inline bool FVTerm::isUnderline()
{ return next_attribute.underline; } { return next_attribute.attr.bit.underline; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isBlink() inline bool FVTerm::isBlink()
{ return next_attribute.blink; } { return next_attribute.attr.bit.blink; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isReverse() inline bool FVTerm::isReverse()
{ return next_attribute.reverse; } { return next_attribute.attr.bit.reverse; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isStandout() inline bool FVTerm::isStandout()
{ return next_attribute.standout; } { return next_attribute.attr.bit.standout; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isInvisible() inline bool FVTerm::isInvisible()
{ return next_attribute.invisible; } { return next_attribute.attr.bit.invisible; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isProtected() inline bool FVTerm::isProtected()
{ return next_attribute.protect; } { return next_attribute.attr.bit.protect; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isCrossedOut() inline bool FVTerm::isCrossedOut()
{ return next_attribute.crossed_out; } { return next_attribute.attr.bit.crossed_out; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isDoubleUnderline() inline bool FVTerm::isDoubleUnderline()
{ return next_attribute.dbl_underline; } { return next_attribute.attr.bit.dbl_underline; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isAltCharset() inline bool FVTerm::isAltCharset()
{ return next_attribute.alt_charset; } { return next_attribute.attr.bit.alt_charset; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isPCcharset() inline bool FVTerm::isPCcharset()
{ return next_attribute.pc_charset; } { return next_attribute.attr.bit.pc_charset; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isTransparent() inline bool FVTerm::isTransparent()
{ return next_attribute.transparent; } { return next_attribute.attr.bit.transparent; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isTransShadow() inline bool FVTerm::isTransShadow()
{ return next_attribute.trans_shadow; } { return next_attribute.attr.bit.trans_shadow; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isInheritBackground() inline bool FVTerm::isInheritBackground()
{ return next_attribute.inherit_bg; } { return next_attribute.attr.bit.inherit_bg; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FVTerm& FVTerm::print() inline FVTerm& FVTerm::print()

View File

@ -1099,25 +1099,25 @@ void FWidget::redraw()
{ {
// draw windows // draw windows
FOptiAttr::char_data default_char; FOptiAttr::char_data default_char;
default_char.code = ' '; default_char.code = ' ';
default_char.fg_color = fc::Black; default_char.fg_color = fc::Black;
default_char.bg_color = fc::Black; default_char.bg_color = fc::Black;
default_char.bold = 0; default_char.attr.bit.bold = 0;
default_char.dim = 0; default_char.attr.bit.dim = 0;
default_char.italic = 0; default_char.attr.bit.italic = 0;
default_char.underline = 0; default_char.attr.bit.underline = 0;
default_char.blink = 0; default_char.attr.bit.blink = 0;
default_char.reverse = 0; default_char.attr.bit.reverse = 0;
default_char.standout = 0; default_char.attr.bit.standout = 0;
default_char.invisible = 0; default_char.attr.bit.invisible = 0;
default_char.protect = 0; default_char.attr.bit.protect = 0;
default_char.crossed_out = 0; default_char.attr.bit.crossed_out = 0;
default_char.dbl_underline = 0; default_char.attr.bit.dbl_underline = 0;
default_char.alt_charset = 0; default_char.attr.bit.alt_charset = 0;
default_char.pc_charset = 0; default_char.attr.bit.pc_charset = 0;
default_char.transparent = 0; default_char.attr.bit.transparent = 0;
default_char.trans_shadow = 0; default_char.attr.bit.trans_shadow = 0;
default_char.inherit_bg = 0; default_char.attr.bit.inherit_bg = 0;
if ( window_list && ! window_list->empty() ) if ( window_list && ! window_list->empty() )
{ {