More faster header inline code
This commit is contained in:
parent
4bef3e8f7b
commit
56a6878f46
|
@ -1,3 +1,6 @@
|
|||
2015-10-17 Markus Gans <guru.mail@muenster.de>
|
||||
* More faster header inline code
|
||||
|
||||
2015-10-16 Markus Gans <guru.mail@muenster.de>
|
||||
* Fixed: calculator behavior for negative values
|
||||
in trigonometric functions
|
||||
|
|
|
@ -148,7 +148,7 @@ void FApplication::cmd_options ()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
#ifdef F_HAVE_LIBGPM
|
||||
inline int FApplication::gpmEvent(bool clear)
|
||||
int FApplication::gpmEvent (bool clear)
|
||||
{
|
||||
register int result;
|
||||
register int max = (gpm_fd > stdin_no) ? gpm_fd : stdin_no;
|
||||
|
@ -948,13 +948,10 @@ void FApplication::processMouseEvent()
|
|||
|| b_state.wheel_up == Pressed
|
||||
|| b_state.wheel_down == Pressed ) )
|
||||
{
|
||||
FWidget* window = FWindow::windowWidgetAt ( mouse->getX()
|
||||
, mouse->getY() );
|
||||
FWidget* window = FWindow::windowWidgetAt (*mouse);
|
||||
if ( window )
|
||||
{
|
||||
FWidget* child = childWidgetAt ( window
|
||||
, mouse->getX()
|
||||
, mouse->getY() );
|
||||
FWidget* child = childWidgetAt (window, *mouse);
|
||||
clicked_widget = (child != 0) ? child : window;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,9 +146,9 @@ void FButton::draw()
|
|||
space = int(' ');
|
||||
|
||||
if ( isMonochron() || getMaxColor() < 16 )
|
||||
ButtonText = new wchar_t[length+3];
|
||||
ButtonText = new wchar_t[length+3]();
|
||||
else
|
||||
ButtonText = new wchar_t[length+1];
|
||||
ButtonText = new wchar_t[length+1]();
|
||||
|
||||
txt = text;
|
||||
src = const_cast<wchar_t*>(txt.wc_str());
|
||||
|
|
|
@ -208,7 +208,7 @@ void FButtonGroup::drawLabel()
|
|||
txt = " " + text + " ";
|
||||
length = txt.getLength();
|
||||
hotkeypos = -1;
|
||||
LabelText = new wchar_t[length+1];
|
||||
LabelText = new wchar_t[length+1]();
|
||||
src = const_cast<wchar_t*>(txt.wc_str());
|
||||
dest = const_cast<wchar_t*>(LabelText);
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ void FDialog::init()
|
|||
setFocus();
|
||||
old_focus->redraw();
|
||||
}
|
||||
accelerator_list = new Accelerators;
|
||||
accelerator_list = new Accelerators();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -255,7 +255,7 @@ void FLabel::draw()
|
|||
while ( y < text_lines && y < uInt(height) )
|
||||
{
|
||||
length = multiline_text[y].getLength();
|
||||
LabelText = new wchar_t[length+1];
|
||||
LabelText = new wchar_t[length+1]();
|
||||
src = const_cast<wchar_t*>(multiline_text[y].wc_str());
|
||||
dest = const_cast<wchar_t*>(LabelText);
|
||||
|
||||
|
@ -285,7 +285,7 @@ void FLabel::draw()
|
|||
else
|
||||
{
|
||||
length = text.getLength();
|
||||
LabelText = new wchar_t[length+1];
|
||||
LabelText = new wchar_t[length+1]();
|
||||
src = const_cast<wchar_t*>(text.wc_str());
|
||||
dest = const_cast<wchar_t*>(LabelText);
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ void FMenu::drawItems()
|
|||
|
||||
txt = (*iter)->getText();
|
||||
txt_length = uInt(txt.getLength());
|
||||
item_text = new wchar_t[txt_length+1];
|
||||
item_text = new wchar_t[txt_length+1]();
|
||||
src = const_cast<wchar_t*>(txt.wc_str());
|
||||
dest = const_cast<wchar_t*>(item_text);
|
||||
to_char = int(txt_length);
|
||||
|
|
|
@ -180,7 +180,7 @@ void FMenuBar::drawItems()
|
|||
|
||||
txt = (*iter)->getText();
|
||||
txt_length = uInt(txt.getLength());
|
||||
item_text = new wchar_t[txt_length+1];
|
||||
item_text = new wchar_t[txt_length+1]();
|
||||
src = const_cast<wchar_t*>(txt.wc_str());
|
||||
dest = const_cast<wchar_t*>(item_text);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ FObject::FObject (FObject* parent)
|
|||
if ( parent == 0 )
|
||||
{
|
||||
modify_timer = false;
|
||||
timer_list = new TimerList;
|
||||
timer_list = new TimerList();
|
||||
}
|
||||
else
|
||||
has_parent = true;
|
||||
|
@ -132,7 +132,7 @@ int FObject::addTimer (int interval)
|
|||
modify_timer = true;
|
||||
|
||||
if ( ! timer_list )
|
||||
timer_list = new TimerList;
|
||||
timer_list = new TimerList();
|
||||
|
||||
// find an unused timer id
|
||||
if ( ! timer_list->empty() )
|
||||
|
|
|
@ -114,7 +114,7 @@ void FStatusKey::setStatusbar (FStatusBar* sb)
|
|||
|
||||
// public methods of FStatusKey
|
||||
//----------------------------------------------------------------------
|
||||
inline void FStatusKey::setActive()
|
||||
void FStatusKey::setActive()
|
||||
{
|
||||
active = true;
|
||||
processActivate();
|
||||
|
|
|
@ -288,10 +288,8 @@ int FTerm::getScreenFont()
|
|||
font.width = 32;
|
||||
font.height = 32;
|
||||
font.charcount = 512;
|
||||
font.data = new uChar[data_size];
|
||||
|
||||
// initialize with 0
|
||||
memset(font.data, 0, data_size);
|
||||
font.data = new uChar[data_size]();
|
||||
|
||||
// font operation
|
||||
ret = ioctl (fd_tty, KDFONTOP, &font);
|
||||
|
@ -337,7 +335,7 @@ int FTerm::setScreenFont ( uChar* fontdata, uInt count
|
|||
|
||||
try
|
||||
{
|
||||
font.data = new uChar[data_size];
|
||||
font.data = new uChar[data_size](); // initialize with 0
|
||||
}
|
||||
catch (const std::bad_alloc& ex)
|
||||
{
|
||||
|
@ -345,9 +343,6 @@ int FTerm::setScreenFont ( uChar* fontdata, uInt count
|
|||
return -1;
|
||||
}
|
||||
|
||||
// initialize with 0
|
||||
memset(font.data, 0, data_size);
|
||||
|
||||
for (uInt i=0; i < count; i++)
|
||||
memcpy ( const_cast<uChar*>(font.data + bytes_per_line*32*i)
|
||||
, &fontdata[i * font.height]
|
||||
|
@ -397,7 +392,7 @@ int FTerm::getUnicodeMap()
|
|||
|
||||
try
|
||||
{
|
||||
unimap.entries = new struct unipair[count];
|
||||
unimap.entries = new struct unipair[count]();
|
||||
}
|
||||
catch (const std::bad_alloc& ex)
|
||||
{
|
||||
|
@ -1920,15 +1915,6 @@ void FTerm::restoreVTerm (int x, int y, int w, int h)
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FTerm::isCovered(const FPoint& pos, FTerm::term_area* area) const
|
||||
{
|
||||
if ( area == 0 )
|
||||
return false;
|
||||
|
||||
return isCovered (pos.getX(), pos.getY(), area);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FTerm::isCovered(int x, int y, FTerm::term_area* area) const
|
||||
{
|
||||
|
@ -2084,14 +2070,6 @@ void FTerm::setUpdateVTerm (bool on)
|
|||
updateVTerm (last_area);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTerm::getArea (const FPoint& pos, FTerm::term_area* area)
|
||||
{
|
||||
if ( area == 0 )
|
||||
return;
|
||||
getArea (pos.getX(), pos.getY(), area);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FTerm::getArea (int ax, int ay, FTerm::term_area* area)
|
||||
{
|
||||
|
@ -2128,16 +2106,6 @@ void FTerm::getArea (int ax, int ay, FTerm::term_area* area)
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTerm::getArea (const FRect& box, FTerm::term_area* area)
|
||||
{
|
||||
getArea ( box.getX()
|
||||
, box.getY()
|
||||
, box.getWidth()
|
||||
, box.getHeight()
|
||||
, area );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FTerm::getArea (int x, int y, int w, int h, FTerm::term_area* area)
|
||||
{
|
||||
|
@ -2250,12 +2218,6 @@ void FTerm::putArea (int ax, int ay, FTerm::term_area* area)
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FTerm::char_data FTerm::getCoveredCharacter (const FPoint& pos, FTerm* obj)
|
||||
{
|
||||
return getCoveredCharacter (pos.getX(), pos.getY(), obj);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FTerm::char_data FTerm::getCoveredCharacter (int x, int y, FTerm* obj)
|
||||
{
|
||||
|
@ -2703,7 +2665,7 @@ void FTerm::setKDECursor(fc::kde_konsole_CursorShape style)
|
|||
//----------------------------------------------------------------------
|
||||
FString FTerm::getXTermFont()
|
||||
{
|
||||
FString font = "";
|
||||
FString font("");
|
||||
|
||||
if ( raw_mode && non_blocking_stdin )
|
||||
{
|
||||
|
@ -2714,7 +2676,7 @@ FString FTerm::getXTermFont()
|
|||
usleep(150000); // wait 150 ms
|
||||
// read the answer
|
||||
n = int(read(fileno(stdin), &temp, sizeof(temp)-1));
|
||||
// Esc \ = OSC String Terminator
|
||||
// Esc + \ = OSC string terminator
|
||||
if ( n >= 2 && temp[n-1] == '\\' && temp[n-2] == 0x1b )
|
||||
{
|
||||
temp[n-2] = '\0';
|
||||
|
@ -2730,7 +2692,7 @@ FString FTerm::getXTermFont()
|
|||
//----------------------------------------------------------------------
|
||||
FString FTerm::getXTermTitle()
|
||||
{
|
||||
FString title = "";
|
||||
FString title("");
|
||||
|
||||
if ( kde_konsole )
|
||||
return title;
|
||||
|
@ -2744,7 +2706,7 @@ FString FTerm::getXTermTitle()
|
|||
usleep(150000); // wait 150 ms
|
||||
// read the answer
|
||||
n = int(read(fileno(stdin), &temp, sizeof(temp)-1));
|
||||
// Esc \ = OSC String Terminator
|
||||
// Esc + \ = OSC string terminator
|
||||
if ( n >= 2 && temp[n-1] == '\\' && temp[n-2] == 0x1b )
|
||||
{
|
||||
temp[n-2] = '\0';
|
||||
|
@ -3713,7 +3675,7 @@ int FTerm::printf (const char* format, ...)
|
|||
|
||||
if ( len >= int(sizeof(buf)) )
|
||||
{
|
||||
buffer = new char[len+1];
|
||||
buffer = new char[len+1]();
|
||||
va_start (args, format);
|
||||
vsnprintf (buffer, uLong(len+1), format, args);
|
||||
va_end (args);
|
||||
|
@ -4017,7 +3979,7 @@ inline void FTerm::appendCharacter (char_data*& screen_char)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTerm::appendAttributes (char_data*& screen_attr)
|
||||
void FTerm::appendAttributes (char_data*& screen_attr)
|
||||
{
|
||||
if ( screen_attr->fg_color != fg_term_color
|
||||
|| screen_attr->bg_color != bg_term_color )
|
||||
|
|
28
src/fterm.h
28
src/fterm.h
|
@ -431,15 +431,37 @@ class FTerm
|
|||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
// FTerm inline functions
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FTerm::isCovered(const FPoint& pos, FTerm::term_area* area) const
|
||||
{ return isCovered (pos.getX(), pos.getY(), area); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTerm::getArea (const FPoint& pos, FTerm::term_area* area)
|
||||
{ return getArea (pos.getX(), pos.getY(), area); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTerm::getArea (const FRect& box, FTerm::term_area* area)
|
||||
{
|
||||
getArea ( box.getX()
|
||||
, box.getY()
|
||||
, box.getWidth()
|
||||
, box.getHeight()
|
||||
, area );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FTerm::char_data FTerm::getCoveredCharacter (const FPoint& pos, FTerm* obj)
|
||||
{ return getCoveredCharacter (pos.getX(), pos.getY(), obj); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline const char* FTerm::getClassName() const
|
||||
{ return "FTerm"; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FTerm::term_area* FTerm::getVWin() const
|
||||
{
|
||||
return vwin;
|
||||
}
|
||||
{ return vwin; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline int FTerm::getLineNumber()
|
||||
|
|
|
@ -198,7 +198,7 @@ void FToggleButton::drawLabel()
|
|||
length = text.getLength();
|
||||
hotkeypos = -1;
|
||||
|
||||
LabelText = new wchar_t[length+1];
|
||||
LabelText = new wchar_t[length+1]();
|
||||
txt = text;
|
||||
src = const_cast<wchar_t*>(txt.wc_str());
|
||||
dest = const_cast<wchar_t*>(LabelText);
|
||||
|
|
125
src/fwidget.cpp
125
src/fwidget.cpp
|
@ -124,8 +124,8 @@ FWidget::~FWidget() // destructor
|
|||
//----------------------------------------------------------------------
|
||||
void FWidget::init()
|
||||
{
|
||||
window_list = new widgetList;
|
||||
close_widget = new widgetList;
|
||||
window_list = new widgetList();
|
||||
close_widget = new widgetList();
|
||||
|
||||
getTermGeometry(); // <-----.
|
||||
// |
|
||||
|
@ -161,7 +161,7 @@ void FWidget::init()
|
|||
setColor (foregroundColor, backgroundColor);
|
||||
clrscr();
|
||||
|
||||
accelerator_list = new Accelerators;
|
||||
accelerator_list = new Accelerators();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -181,12 +181,6 @@ void FWidget::finish()
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::processDestroy()
|
||||
{
|
||||
emitCallback("destroy");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::draw()
|
||||
{ }
|
||||
|
@ -386,12 +380,6 @@ FTerm::term_area* FWidget::getPrintArea()
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setPrintArea(term_area* area)
|
||||
{
|
||||
print_area = area;
|
||||
}
|
||||
|
||||
// protected methods of FWidget
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::adjustSize()
|
||||
|
@ -839,12 +827,6 @@ void FWidget::setMainWidget(FWidget* obj)
|
|||
fapp->setMainWidget(obj);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget* FWidget::childWidgetAt (FWidget* p, const FPoint& pos)
|
||||
{
|
||||
return childWidgetAt (p, pos.getX(), pos.getY());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::childWidgetAt (FWidget* p, int x, int y)
|
||||
{
|
||||
|
@ -875,14 +857,14 @@ FWidget* FWidget::childWidgetAt (FWidget* p, int x, int y)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget* FWidget::getFocusWidget() const
|
||||
FWidget* FWidget::getFocusWidget() const
|
||||
{
|
||||
FWidget* focus_widget = static_cast<FWidget*>(FApplication::focus_widget);
|
||||
return focus_widget;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setFocusWidget(FWidget* obj)
|
||||
void FWidget::setFocusWidget(FWidget* obj)
|
||||
{
|
||||
FApplication::focus_widget = obj;
|
||||
}
|
||||
|
@ -1330,18 +1312,6 @@ void FWidget::hide()
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setEnable(bool on)
|
||||
{
|
||||
return enable = (on) ? true : false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setVisibleCursor(bool on)
|
||||
{
|
||||
return visibleCursor = (on) ? true : false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FWidget::focusFirstChild (void)
|
||||
{
|
||||
|
@ -1446,27 +1416,6 @@ bool FWidget::setFocus(bool on)
|
|||
return focus = (on) ? true : false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FPoint FWidget::globalToLocalPos (const FPoint& gPos)
|
||||
{
|
||||
return FPoint ( gPos.getX() - xpos - xmin + 2
|
||||
, gPos.getY() - ypos - ymin + 2 );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setForegroundColor (int color)
|
||||
{
|
||||
if ( color >> 8 == 0 ) // valid colors 0..254
|
||||
foregroundColor = color;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setBackgroundColor (int color)
|
||||
{
|
||||
if ( color >> 8 == 0 ) // valid colors 0..254
|
||||
backgroundColor = color;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setX (int x, bool adjust)
|
||||
{
|
||||
|
@ -1513,12 +1462,6 @@ void FWidget::setY (int y, bool adjust)
|
|||
adjustSize();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setPos (const FPoint& p, bool adjust)
|
||||
{
|
||||
setPos (p.getX(), p.getY(), adjust);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setPos (int x, int y, bool adjust)
|
||||
{
|
||||
|
@ -1668,16 +1611,6 @@ void FWidget::setTermGeometry (int w, int h)
|
|||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setGeometry (const FRect& box, bool adjust)
|
||||
{
|
||||
setGeometry ( box.getX()
|
||||
, box.getY()
|
||||
, box.getWidth()
|
||||
, box.getHeight()
|
||||
, adjust );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setGeometry (int x, int y, int w, int h, bool adjust)
|
||||
{
|
||||
|
@ -1720,12 +1653,6 @@ void FWidget::setGeometry (int x, int y, int w, int h, bool adjust)
|
|||
double_flatline_mask.left.resize (uLong(height), false);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::move (const FPoint& pos)
|
||||
{
|
||||
move( pos.getX(), pos.getY() );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::move (int x, int y)
|
||||
{
|
||||
|
@ -1761,12 +1688,6 @@ bool FWidget::setCursor()
|
|||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FWidget::setCursorPos (const FPoint& pos)
|
||||
{
|
||||
return setCursorPos (pos.getX(), pos.getY());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FWidget::setCursorPos (register int x, register int y)
|
||||
{
|
||||
|
@ -1778,24 +1699,6 @@ bool FWidget::setCursorPos (register int x, register int y)
|
|||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::unsetCursorPos()
|
||||
{
|
||||
widgetCursorPosition.setPoint(-1,-1);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::gotoxy (const FPoint& pos)
|
||||
{
|
||||
gotoxy (pos.getX(), pos.getY());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::gotoxy (register int x, register int y)
|
||||
{
|
||||
cursor->setPoint(x,y);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::clrscr()
|
||||
{
|
||||
|
@ -1841,24 +1744,6 @@ void FWidget::clrscr()
|
|||
putArea (xpos+xmin-1, ypos+ymin-1, area);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FWidget::setBold (register bool on)
|
||||
{
|
||||
return (bold = on);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FWidget::setReverse (register bool on)
|
||||
{
|
||||
return (reverse = on);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FWidget::setUnderline (register bool on)
|
||||
{
|
||||
return (underline = on);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::drawShadow()
|
||||
{
|
||||
|
|
|
@ -472,10 +472,23 @@ class FWidget : public FObject, public FTerm
|
|||
|
||||
#pragma pack(pop)
|
||||
|
||||
// FWidget inline functions
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::processDestroy()
|
||||
{ emitCallback("destroy"); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setPrintArea (term_area* area)
|
||||
{ print_area = area; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline const char* FWidget::getClassName() const
|
||||
{ return "FWidget"; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget* FWidget::childWidgetAt (FWidget* p, const FPoint& pos)
|
||||
{ return childWidgetAt (p, pos.getX(), pos.getY()); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget* FWidget::parentWidget() const
|
||||
{ return static_cast<FWidget*>(getParent()); }
|
||||
|
@ -512,6 +525,10 @@ inline bool FWidget::isShown() const
|
|||
inline bool FWidget::isWindow() const
|
||||
{ return window_object; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setEnable (bool on)
|
||||
{ return enable = (on) ? true : false; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setEnable()
|
||||
{ return setEnable(true); }
|
||||
|
@ -528,6 +545,10 @@ inline bool FWidget::setDisable()
|
|||
inline bool FWidget::isEnabled() const
|
||||
{ return enable; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setVisibleCursor (bool on)
|
||||
{ return visibleCursor = (on) ? true : false; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setVisibleCursor()
|
||||
{ return setVisibleCursor(true); }
|
||||
|
@ -608,6 +629,31 @@ inline int FWidget::getGlobalY() const
|
|||
inline const FPoint FWidget::getGlobalPos() const
|
||||
{ return FPoint(xpos+xmin-1, ypos+ymin-1); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FPoint FWidget::globalToLocalPos (const FPoint& gPos)
|
||||
{
|
||||
return FPoint ( gPos.getX() - xpos - xmin + 2
|
||||
, gPos.getY() - ypos - ymin + 2 );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setForegroundColor (int color)
|
||||
{
|
||||
if ( color >> 8 == 0 ) // valid colors 0..254
|
||||
foregroundColor = color;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setBackgroundColor (int color)
|
||||
{
|
||||
if ( color >> 8 == 0 ) // valid colors 0..254
|
||||
backgroundColor = color;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setPos (const FPoint& p, bool adjust)
|
||||
{ setPos (p.getX(), p.getY(), adjust); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline int FWidget::getWidth() const
|
||||
{ return width; }
|
||||
|
@ -660,6 +706,20 @@ inline const FRect& FWidget::getGeometryGlobal() const
|
|||
inline const FRect& FWidget::getGeometryGlobalShadow() const
|
||||
{ return adjustWidgetSizeGlobalShadow; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setGeometry (const FRect& box, bool adjust)
|
||||
{
|
||||
setGeometry ( box.getX()
|
||||
, box.getY()
|
||||
, box.getWidth()
|
||||
, box.getHeight()
|
||||
, adjust );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::move (const FPoint& pos)
|
||||
{ move( pos.getX(), pos.getY() ); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline int FWidget::getFlags() const
|
||||
{ return flags; }
|
||||
|
@ -668,6 +728,26 @@ inline int FWidget::getFlags() const
|
|||
inline FPoint FWidget::getCursorPos()
|
||||
{ return widgetCursorPosition; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setCursorPos (const FPoint& pos)
|
||||
{ return setCursorPos (pos.getX(), pos.getY()); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::unsetCursorPos()
|
||||
{ widgetCursorPosition.setPoint(-1,-1); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::gotoxy (const FPoint& pos)
|
||||
{ gotoxy (pos.getX(), pos.getY()); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::gotoxy (register int x, register int y)
|
||||
{ cursor->setPoint(x,y); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setBold (register bool on)
|
||||
{ return (bold = on); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setBold()
|
||||
{ return setBold(true); }
|
||||
|
@ -680,6 +760,10 @@ inline bool FWidget::unsetBold()
|
|||
inline bool FWidget::isBold()
|
||||
{ return bold; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setReverse (register bool on)
|
||||
{ return (reverse = on); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setReverse()
|
||||
{ return setReverse(true); }
|
||||
|
@ -692,6 +776,10 @@ inline bool FWidget::unsetReverse()
|
|||
inline bool FWidget::isReverse()
|
||||
{ return reverse; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setUnderline (register bool on)
|
||||
{ return (underline = on); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setUnderline()
|
||||
{ return setUnderline(true); }
|
||||
|
|
|
@ -86,12 +86,6 @@ void FWindow::hide()
|
|||
FWidget::hide();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWindow* FWindow::windowWidgetAt(const FPoint& pos)
|
||||
{
|
||||
return windowWidgetAt(pos.getX(), pos.getY());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWindow* FWindow::windowWidgetAt(int x, int y)
|
||||
{
|
||||
|
|
|
@ -91,6 +91,10 @@ class FWindow : public FWidget
|
|||
inline const char* FWindow::getClassName() const
|
||||
{ return "FWindow"; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWindow* FWindow::windowWidgetAt (const FPoint& pos)
|
||||
{ return windowWidgetAt(pos.getX(), pos.getY()); }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWindow::raiseWindow()
|
||||
{ return raiseWindow(this); }
|
||||
|
|
Loading…
Reference in New Issue