More code cleanups
This commit is contained in:
parent
937654710b
commit
b0080b00cf
23
README.md
23
README.md
|
@ -85,19 +85,16 @@ FINAL CUT uses a virtual terminal to print character via an update method on the
|
||||||
print(...)
|
print(...)
|
||||||
printf(...)
|
printf(...)
|
||||||
│
|
│
|
||||||
│ ╔═════════════════════════[ vterm ]═════════════════════════╗
|
│ ╔════════════════════════[ vterm ]════════════════════════╗
|
||||||
│ ║createVTerm() ║
|
│ ║createVTerm() ║
|
||||||
│ ║ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ║
|
│ ║ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ║
|
||||||
│ ║ ║
|
│ ║ ║
|
||||||
│ ║ │ restoreVTerm(x,y,w,h) │ ║
|
│ ║ │ restoreVTerm(x,y,w,h) │ ║
|
||||||
│ ║ ║
|
│ ┌───────╨────[ vwin ]────────────┐ ║
|
||||||
│ ║ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ║
|
│ │createArea(area) │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ║
|
||||||
│ ║ ║
|
|
||||||
│ ┌───────╨─────[ vwin ]─────────────┐ ║
|
|
||||||
│ │createArea(area) │ ║
|
|
||||||
│ │ │ ║
|
│ │ │ ║
|
||||||
│ │ │ ║
|
│ │ │ ║
|
||||||
└───┼────────► putArea(area) ────► ║
|
└──┼────────► putArea(area) ────► ║
|
||||||
│ │ ║
|
│ │ ║
|
||||||
│ putArea(x,y,area) ────► ║
|
│ putArea(x,y,area) ────► ║
|
||||||
│ │ ║
|
│ │ ║
|
||||||
|
@ -106,12 +103,10 @@ printf(...)
|
||||||
│ │ ║
|
│ │ ║
|
||||||
│ │ ║
|
│ │ ║
|
||||||
│ resizeArea(area)│ ║
|
│ resizeArea(area)│ ║
|
||||||
└───────╥──────────────────────────┘ ║
|
└───────╥────────────────────────┘ ║
|
||||||
║ ║
|
|
||||||
║ ║
|
|
||||||
║ ║
|
║ ║
|
||||||
║ │ resizeVTerm()║
|
║ │ resizeVTerm()║
|
||||||
╚═══▼═══════════════════════════════════════════════════════╝
|
╚═══════▼═════════════════════════════════════════════════╝
|
||||||
│
|
│
|
||||||
│ putVTerm()
|
│ putVTerm()
|
||||||
└──────────────────► updateTerminalLine(y)
|
└──────────────────► updateTerminalLine(y)
|
||||||
|
@ -121,10 +116,8 @@ printf(...)
|
||||||
│ output_buffer │
|
│ output_buffer │
|
||||||
└───────────────┘
|
└───────────────┘
|
||||||
│
|
│
|
||||||
│ flush_out()
|
│ flushOutputBuffer()
|
||||||
│ +
|
│ and putchar(char)
|
||||||
│ Fputchar(char)
|
|
||||||
│
|
|
||||||
▼
|
▼
|
||||||
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
||||||
▌ ▐
|
▌ ▐
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
The virtual terminal (vterm)
|
The virtual terminal (vterm)
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
FINAL CUT uses a virtual terminal to print character via an update
|
FINAL CUT uses a virtual terminal to print character via an update method
|
||||||
method on the screen. It provides (as an overlying layer) virtual windows
|
on the screen. It provides (as an overlying layer) virtual windows for
|
||||||
for the realization of window movements. The update methods only transfer
|
the realization of window movements. The update methods only transfer
|
||||||
differences to the virtual terminal or physical screen.
|
differences to the virtual terminal or physical screen.
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,19 +11,16 @@ differences to the virtual terminal or physical screen.
|
||||||
print(...)
|
print(...)
|
||||||
printf(...)
|
printf(...)
|
||||||
│
|
│
|
||||||
│ ╔═════════════════════════[ vterm ]═════════════════════════╗
|
│ ╔════════════════════════[ vterm ]════════════════════════╗
|
||||||
│ ║createVTerm() ║
|
│ ║createVTerm() ║
|
||||||
│ ║ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ║
|
│ ║ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ║
|
||||||
│ ║ ║
|
│ ║ ║
|
||||||
│ ║ │ restoreVTerm(x,y,w,h) │ ║
|
│ ║ │ restoreVTerm(x,y,w,h) │ ║
|
||||||
│ ║ ║
|
│ ┌───────╨────[ vwin ]────────────┐ ║
|
||||||
│ ║ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ║
|
│ │createArea(area) │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ║
|
||||||
│ ║ ║
|
|
||||||
│ ┌───────╨─────[ vwin ]─────────────┐ ║
|
|
||||||
│ │createArea(area) │ ║
|
|
||||||
│ │ │ ║
|
│ │ │ ║
|
||||||
│ │ │ ║
|
│ │ │ ║
|
||||||
└───┼────────► putArea(area) ────► ║
|
└──┼────────► putArea(area) ────► ║
|
||||||
│ │ ║
|
│ │ ║
|
||||||
│ putArea(x,y,area) ────► ║
|
│ putArea(x,y,area) ────► ║
|
||||||
│ │ ║
|
│ │ ║
|
||||||
|
@ -32,12 +29,10 @@ printf(...)
|
||||||
│ │ ║
|
│ │ ║
|
||||||
│ │ ║
|
│ │ ║
|
||||||
│ resizeArea(area)│ ║
|
│ resizeArea(area)│ ║
|
||||||
└───────╥──────────────────────────┘ ║
|
└───────╥────────────────────────┘ ║
|
||||||
║ ║
|
|
||||||
║ ║
|
|
||||||
║ ║
|
║ ║
|
||||||
║ │ resizeVTerm()║
|
║ │ resizeVTerm()║
|
||||||
╚═══▼═══════════════════════════════════════════════════════╝
|
╚═══════▼═════════════════════════════════════════════════╝
|
||||||
│
|
│
|
||||||
│ putVTerm()
|
│ putVTerm()
|
||||||
└──────────────────► updateTerminalLine(y)
|
└──────────────────► updateTerminalLine(y)
|
||||||
|
@ -47,10 +42,8 @@ printf(...)
|
||||||
│ output_buffer │
|
│ output_buffer │
|
||||||
└───────────────┘
|
└───────────────┘
|
||||||
│
|
│
|
||||||
│ flush_out()
|
│ flushOutputBuffer()
|
||||||
│ +
|
│ and putchar(char)
|
||||||
│ Fputchar(char)
|
|
||||||
│
|
|
||||||
▼
|
▼
|
||||||
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
||||||
▌ ▐
|
▌ ▐
|
||||||
|
@ -61,4 +54,3 @@ printf(...)
|
||||||
▀▀▀▀▀▀▀███▀▀▀▀▀▀▀
|
▀▀▀▀▀▀▀███▀▀▀▀▀▀▀
|
||||||
███
|
███
|
||||||
▀▀▀▀▀▀▀▀▀
|
▀▀▀▀▀▀▀▀▀
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,7 @@ class MouseDraw : public finalcut::FDialog
|
||||||
void cb_colorChanged (finalcut::FWidget*, FDataPtr);
|
void cb_colorChanged (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
term_area* canvas{nullptr};
|
FTermArea* canvas{nullptr};
|
||||||
ColorChooser c_chooser{this};
|
ColorChooser c_chooser{this};
|
||||||
Brushes brush{this};
|
Brushes brush{this};
|
||||||
};
|
};
|
||||||
|
@ -495,13 +495,13 @@ void MouseDraw::drawCanvas()
|
||||||
|
|
||||||
for (int y{0}; y < y_end; y++) // line loop
|
for (int y{0}; y < y_end; y++) // line loop
|
||||||
{
|
{
|
||||||
finalcut::charData* canvaschar{}; // canvas character
|
finalcut::FChar* canvaschar{}; // canvas character
|
||||||
finalcut::charData* winchar{}; // window character
|
finalcut::FChar* winchar{}; // window character
|
||||||
canvaschar = &canvas->text[y * x_end];
|
canvaschar = &canvas->data[y * x_end];
|
||||||
winchar = &printarea->text[(ay + y) * w_line_len + ax];
|
winchar = &printarea->data[(ay + y) * w_line_len + ax];
|
||||||
std::memcpy ( winchar
|
std::memcpy ( winchar
|
||||||
, canvaschar
|
, canvaschar
|
||||||
, sizeof(finalcut::charData) * unsigned(x_end) );
|
, sizeof(finalcut::FChar) * unsigned(x_end) );
|
||||||
|
|
||||||
if ( int(printarea->changes[ay + y].xmin) > ax )
|
if ( int(printarea->changes[ay + y].xmin) > ax )
|
||||||
printarea->changes[ay + y].xmin = uInt(ax);
|
printarea->changes[ay + y].xmin = uInt(ax);
|
||||||
|
|
|
@ -267,7 +267,7 @@ void MainWindow::onTimer (finalcut::FTimerEvent*)
|
||||||
line1 = line1.right(length - 1) + first_Char[0];
|
line1 = line1.right(length - 1) + first_Char[0];
|
||||||
line2 = line2.right(length - 1) + first_Char[1];
|
line2 = line2.right(length - 1) + first_Char[1];
|
||||||
redraw();
|
redraw();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -136,7 +136,7 @@ void ProgressDialog::onTimer (finalcut::FTimerEvent*)
|
||||||
{
|
{
|
||||||
auto p = progressBar.getPercentage();
|
auto p = progressBar.getPercentage();
|
||||||
progressBar.setPercentage(++p);
|
progressBar.setPercentage(++p);
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
|
|
||||||
if ( p != 100 )
|
if ( p != 100 )
|
||||||
return;
|
return;
|
||||||
|
@ -154,7 +154,7 @@ void ProgressDialog::onTimer (finalcut::FTimerEvent*)
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Dec 01 21:28:25 UTC 2018 - Markus Gans <guru.mail@muenster.de>
|
||||||
|
- Release (version 0.5.1)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 28 23:36:24 UTC 2018 - Markus Gans <guru.mail@muenster.de>
|
||||||
|
- Package name adjustment
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 26 11:22:27 UTC 2018 - mvetter@suse.com
|
||||||
|
|
||||||
|
- Prepare to push to devel project
|
||||||
|
- Remove old tarball: finalcut-0.3.0.tar.gz
|
||||||
|
- Remove old tarball: finalcut-0.4.0.tar.gz
|
||||||
|
- Clean spec with spec-cleaner
|
||||||
|
- Add changes file
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Nov 25 00:03:36 UTC 2018 - Markus Gans <guru.mail@muenster.de>
|
Sun Nov 25 00:03:36 UTC 2018 - Markus Gans <guru.mail@muenster.de>
|
||||||
- Release (version 0.5.0)
|
- Release (version 0.5.0)
|
||||||
|
@ -17,3 +34,4 @@ Sat Dec 19 21:01:48 UTC 2015 - Markus Gans <guru.mail@muenster.de>
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Sep 18 22:35:57 UTC 2015 - Markus Gans <guru.mail@muenster.de>
|
Fri Sep 18 22:35:57 UTC 2015 - Markus Gans <guru.mail@muenster.de>
|
||||||
- Initial Release (version 0.1.1)
|
- Initial Release (version 0.1.1)
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ libfinal_la_SOURCES = \
|
||||||
ftermdetection.cpp \
|
ftermdetection.cpp \
|
||||||
ftermios.cpp \
|
ftermios.cpp \
|
||||||
fterm.cpp \
|
fterm.cpp \
|
||||||
|
fterm_functions.cpp \
|
||||||
fvterm.cpp \
|
fvterm.cpp \
|
||||||
fevent.cpp \
|
fevent.cpp \
|
||||||
foptiattr.cpp \
|
foptiattr.cpp \
|
||||||
|
@ -66,6 +67,7 @@ libfinal_la_SOURCES = \
|
||||||
fcolorpalette.cpp \
|
fcolorpalette.cpp \
|
||||||
fwidgetcolors.cpp \
|
fwidgetcolors.cpp \
|
||||||
fwidget.cpp \
|
fwidget.cpp \
|
||||||
|
fwidget_functions.cpp \
|
||||||
fobject.cpp
|
fobject.cpp
|
||||||
|
|
||||||
libfinal_la_LDFLAGS = -version-info @SO_VERSION@
|
libfinal_la_LDFLAGS = -version-info @SO_VERSION@
|
||||||
|
|
|
@ -118,6 +118,7 @@ OBJS = \
|
||||||
fstartoptions.o \
|
fstartoptions.o \
|
||||||
ftermcap.o \
|
ftermcap.o \
|
||||||
fterm.o \
|
fterm.o \
|
||||||
|
fterm_functions.o \
|
||||||
ftermdebugdata.o \
|
ftermdebugdata.o \
|
||||||
ftermios.o \
|
ftermios.o \
|
||||||
ftermdetection.o \
|
ftermdetection.o \
|
||||||
|
@ -134,6 +135,7 @@ OBJS = \
|
||||||
fcolorpalette.o \
|
fcolorpalette.o \
|
||||||
fwidgetcolors.o \
|
fwidgetcolors.o \
|
||||||
fwidget.o \
|
fwidget.o \
|
||||||
|
fwidget_functions.o \
|
||||||
fevent.o \
|
fevent.o \
|
||||||
fobject.o
|
fobject.o
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ OBJS = \
|
||||||
ftermcap.o \
|
ftermcap.o \
|
||||||
fstartoptions.o \
|
fstartoptions.o \
|
||||||
fterm.o \
|
fterm.o \
|
||||||
|
fterm_functions.o \
|
||||||
ftermdebugdata.o \
|
ftermdebugdata.o \
|
||||||
ftermios.o \
|
ftermios.o \
|
||||||
ftermdetection.o \
|
ftermdetection.o \
|
||||||
|
@ -134,6 +135,7 @@ OBJS = \
|
||||||
fcolorpalette.o \
|
fcolorpalette.o \
|
||||||
fwidgetcolors.o \
|
fwidgetcolors.o \
|
||||||
fwidget.o \
|
fwidget.o \
|
||||||
|
fwidget_functions.o \
|
||||||
fevent.o \
|
fevent.o \
|
||||||
fobject.o
|
fobject.o
|
||||||
|
|
||||||
|
|
|
@ -122,12 +122,12 @@ int FApplication::exec() // run
|
||||||
quit_now = false;
|
quit_now = false;
|
||||||
quit_code = 0;
|
quit_code = 0;
|
||||||
|
|
||||||
enter_loop();
|
enterLoop();
|
||||||
return quit_code;
|
return quit_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int FApplication::enter_loop() // event loop
|
int FApplication::enterLoop() // event loop
|
||||||
{
|
{
|
||||||
loop_level++;
|
loop_level++;
|
||||||
quit_now = false;
|
quit_now = false;
|
||||||
|
@ -144,7 +144,7 @@ int FApplication::enter_loop() // event loop
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FApplication::exit_loop()
|
void FApplication::exitLoop()
|
||||||
{
|
{
|
||||||
app_exit_loop = true;
|
app_exit_loop = true;
|
||||||
}
|
}
|
||||||
|
@ -172,10 +172,7 @@ void FApplication::quit()
|
||||||
bool FApplication::sendEvent ( const FObject* receiver
|
bool FApplication::sendEvent ( const FObject* receiver
|
||||||
, const FEvent* event )
|
, const FEvent* event )
|
||||||
{
|
{
|
||||||
if ( quit_now || app_exit_loop )
|
if ( quit_now || app_exit_loop || ! receiver )
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( ! receiver )
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( receiver->isWidget() )
|
if ( receiver->isWidget() )
|
||||||
|
@ -672,7 +669,7 @@ void FApplication::processKeyboardEvent()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
findKeyboardWidget();
|
findKeyboardWidget();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
keyboard->clearKeyBufferOnTimeout();
|
keyboard->clearKeyBufferOnTimeout();
|
||||||
|
|
||||||
if ( isKeyPressed() )
|
if ( isKeyPressed() )
|
||||||
|
@ -776,10 +773,7 @@ FWidget*& FApplication::determineClickedWidget()
|
||||||
{
|
{
|
||||||
FWidget*& clicked = FWidget::getClickedWidget();
|
FWidget*& clicked = FWidget::getClickedWidget();
|
||||||
|
|
||||||
if ( clicked )
|
if ( clicked || ! mouse )
|
||||||
return clicked;
|
|
||||||
|
|
||||||
if ( ! mouse )
|
|
||||||
return clicked;
|
return clicked;
|
||||||
|
|
||||||
if ( ! mouse->isLeftButtonPressed()
|
if ( ! mouse->isLeftButtonPressed()
|
||||||
|
@ -861,7 +855,7 @@ void FApplication::closeOpenMenu()
|
||||||
FWidget::getStatusBar()->drawMessage();
|
FWidget::getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -875,13 +869,7 @@ void FApplication::unselectMenubarItems()
|
||||||
if ( openmenu || (mouse && mouse->isMoved()) )
|
if ( openmenu || (mouse && mouse->isMoved()) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( ! menu_bar )
|
if ( ! (menu_bar && menu_bar->hasSelectedItem() && mouse) )
|
||||||
return;
|
|
||||||
|
|
||||||
if ( ! menu_bar->hasSelectedItem() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( ! mouse )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto& mouse_position = mouse->getPos();
|
const auto& mouse_position = mouse->getPos();
|
||||||
|
@ -902,7 +890,7 @@ void FApplication::unselectMenubarItems()
|
||||||
FWidget::getStatusBar()->drawMessage();
|
FWidget::getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -911,10 +899,7 @@ void FApplication::sendMouseEvent()
|
||||||
{
|
{
|
||||||
auto clicked = FWidget::getClickedWidget();
|
auto clicked = FWidget::getClickedWidget();
|
||||||
|
|
||||||
if ( ! clicked )
|
if ( ! (clicked && mouse) )
|
||||||
return;
|
|
||||||
|
|
||||||
if ( ! mouse )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto& mouse_position = mouse->getPos();
|
const auto& mouse_position = mouse->getPos();
|
||||||
|
|
|
@ -364,7 +364,7 @@ void FButtonGroup::onFocusIn (FFocusEvent* in_ev)
|
||||||
{
|
{
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ void FButtonGroup::directFocus()
|
||||||
{
|
{
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ void FDialog::show()
|
||||||
if ( isModal() )
|
if ( isModal() )
|
||||||
{
|
{
|
||||||
auto fapp = FApplication::getApplicationObject();
|
auto fapp = FApplication::getApplicationObject();
|
||||||
fapp->enter_loop();
|
fapp->enterLoop();
|
||||||
|
|
||||||
if ( this == getMainWidget() )
|
if ( this == getMainWidget() )
|
||||||
fapp->quit();
|
fapp->quit();
|
||||||
|
@ -150,7 +150,7 @@ void FDialog::hide()
|
||||||
if ( isModal() )
|
if ( isModal() )
|
||||||
{
|
{
|
||||||
auto fapp = FApplication::getApplicationObject();
|
auto fapp = FApplication::getApplicationObject();
|
||||||
fapp->exit_loop();
|
fapp->exitLoop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -925,14 +925,10 @@ void FDialog::drawBorder()
|
||||||
<< fc::NF_rev_border_line_right; // border right⎹
|
<< fc::NF_rev_border_line_right; // border right⎹
|
||||||
}
|
}
|
||||||
|
|
||||||
print() << r.getLowerLeftPos() // lower left corner border ⎣
|
print() << r.getLowerLeftPos()
|
||||||
<< fc::NF_border_corner_lower_left;
|
<< fc::NF_border_corner_lower_left // ⎣
|
||||||
|
<< FString(r.getWidth() - 2, fc::NF_border_line_bottom) // _
|
||||||
for (int x = r.getX1() + 1; x < r.getX2(); x++)
|
<< fc::NF_rev_border_corner_lower_right; // ⎦
|
||||||
print (fc::NF_border_line_bottom); // low line _
|
|
||||||
|
|
||||||
// lower right corner border ⎦
|
|
||||||
print (fc::NF_rev_border_corner_lower_right);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1187,7 +1183,7 @@ void FDialog::leaveMenu()
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1232,7 +1228,7 @@ void FDialog::selectFirstMenuItem()
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace finalcut
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
fkeymap Fkey[] =
|
FKeyMap fkey[] =
|
||||||
{
|
{
|
||||||
{ fc::Fkey_backspace , 0, "kb" }, // backspace key
|
{ fc::Fkey_backspace , 0, "kb" }, // backspace key
|
||||||
{ fc::Fkey_catab , 0, "ka" }, // clear-all-tabs key
|
{ fc::Fkey_catab , 0, "ka" }, // clear-all-tabs key
|
||||||
|
@ -205,7 +205,7 @@ fkeymap Fkey[] =
|
||||||
{ 0 , 0, "\0" }
|
{ 0 , 0, "\0" }
|
||||||
};
|
};
|
||||||
|
|
||||||
fmetakeymap Fmetakey[] =
|
FMetakeyMap fmetakey[] =
|
||||||
{
|
{
|
||||||
{ fc::Fmkey_ic , "\033[2;3~" }, // M-insert
|
{ fc::Fmkey_ic , "\033[2;3~" }, // M-insert
|
||||||
{ fc::Fmkey_ic , "\033\033[2~" }, // M-insert
|
{ fc::Fmkey_ic , "\033\033[2~" }, // M-insert
|
||||||
|
@ -438,7 +438,7 @@ fmetakeymap Fmetakey[] =
|
||||||
{ 0 , "\0" }
|
{ 0 , "\0" }
|
||||||
};
|
};
|
||||||
|
|
||||||
keyname FkeyName[] =
|
FKeyName fkeyname[] =
|
||||||
{
|
{
|
||||||
{ fc::Fckey_a , "Ctrl+A" },
|
{ fc::Fckey_a , "Ctrl+A" },
|
||||||
{ fc::Fckey_b , "Ctrl+B" },
|
{ fc::Fckey_b , "Ctrl+B" },
|
||||||
|
|
|
@ -83,9 +83,9 @@ void FKeyboard::fetchKeyCode()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
const FString FKeyboard::getKeyName (FKey keynum)
|
const FString FKeyboard::getKeyName (FKey keynum)
|
||||||
{
|
{
|
||||||
for (std::size_t i{0}; fc::FkeyName[i].string[0] != 0; i++)
|
for (std::size_t i{0}; fc::fkeyname[i].string[0] != 0; i++)
|
||||||
if ( fc::FkeyName[i].num && fc::FkeyName[i].num == keynum )
|
if ( fc::fkeyname[i].num && fc::fkeyname[i].num == keynum )
|
||||||
return FString(fc::FkeyName[i].string);
|
return FString(fc::fkeyname[i].string);
|
||||||
|
|
||||||
if ( keynum > 32 && keynum < 127 )
|
if ( keynum > 32 && keynum < 127 )
|
||||||
return FString(char(keynum));
|
return FString(char(keynum));
|
||||||
|
@ -94,7 +94,7 @@ const FString FKeyboard::getKeyName (FKey keynum)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FKeyboard::setTermcapMap (fc::fkeymap* keymap)
|
void FKeyboard::setTermcapMap (fc::FKeyMap* keymap)
|
||||||
{
|
{
|
||||||
key_map = keymap;
|
key_map = keymap;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ inline FKey FKeyboard::getTermcapKey()
|
||||||
fifo_buf[n] = '\0';
|
fifo_buf[n] = '\0';
|
||||||
|
|
||||||
input_data_pending = bool(fifo_buf[0] != '\0');
|
input_data_pending = bool(fifo_buf[0] != '\0');
|
||||||
return fc::Fkey[i].num;
|
return fc::fkey[i].num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,9 +245,9 @@ inline FKey FKeyboard::getMetaKey()
|
||||||
|
|
||||||
assert ( FIFO_BUF_SIZE > 0 );
|
assert ( FIFO_BUF_SIZE > 0 );
|
||||||
|
|
||||||
for (std::size_t i{0}; fc::Fmetakey[i].string[0] != 0; i++)
|
for (std::size_t i{0}; fc::fmetakey[i].string[0] != 0; i++)
|
||||||
{
|
{
|
||||||
char* kmeta = fc::Fmetakey[i].string; // The string is never null
|
char* kmeta = fc::fmetakey[i].string; // The string is never null
|
||||||
std::size_t len = std::strlen(kmeta);
|
std::size_t len = std::strlen(kmeta);
|
||||||
|
|
||||||
if ( std::strncmp(kmeta, fifo_buf, len) == 0 ) // found
|
if ( std::strncmp(kmeta, fifo_buf, len) == 0 ) // found
|
||||||
|
@ -269,7 +269,7 @@ inline FKey FKeyboard::getMetaKey()
|
||||||
fifo_buf[n] = '\0';
|
fifo_buf[n] = '\0';
|
||||||
|
|
||||||
input_data_pending = bool(fifo_buf[0] != '\0');
|
input_data_pending = bool(fifo_buf[0] != '\0');
|
||||||
return fc::Fmetakey[i].num;
|
return fc::fmetakey[i].num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@ void FLabel::onMouseDown (FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
accel_widget->getStatusBar()->drawMessage();
|
accel_widget->getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ void FLabel::onAccel (FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
accel_widget->getStatusBar()->drawMessage();
|
accel_widget->getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -464,7 +464,7 @@ void FLabel::printLine (FString&& line)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
to_column = width - 2;
|
to_column = width - 2;
|
||||||
to_char = getColumnWidthToLength(line, to_column);
|
to_char = getLengthFromColumnWidth(line, to_column);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( hasReverseMode() )
|
if ( hasReverseMode() )
|
||||||
|
|
|
@ -596,7 +596,7 @@ void FLineEdit::onAccel (FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -623,7 +623,7 @@ void FLineEdit::onFocusIn (FFocusEvent*)
|
||||||
{
|
{
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,7 +381,7 @@ void FListBox::onMouseDown (FMouseEvent* ev)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ void FListBox::onMouseMove (FMouseEvent* ev)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-scrolling when dragging mouse outside the widget
|
// Auto-scrolling when dragging mouse outside the widget
|
||||||
|
@ -526,7 +526,7 @@ void FListBox::onTimer (FTimerEvent*)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -572,7 +572,7 @@ void FListBox::onWheel (FWheelEvent* ev)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1116,7 +1116,7 @@ inline void FListBox::updateDrawing (bool draw_vbar, bool draw_hbar)
|
||||||
hbar->drawBar();
|
hbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1816,7 +1816,7 @@ void FListBox::cb_VBarChange (FWidget*, FDataPtr)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1869,7 +1869,7 @@ void FListBox::cb_HBarChange (FWidget*, FDataPtr)
|
||||||
{
|
{
|
||||||
drawList();
|
drawList();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( scrollType >= FScrollbar::scrollStepBackward )
|
if ( scrollType >= FScrollbar::scrollStepBackward )
|
||||||
|
@ -1880,7 +1880,7 @@ void FListBox::cb_HBarChange (FWidget*, FDataPtr)
|
||||||
hbar->drawBar();
|
hbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -968,7 +968,7 @@ void FListView::onMouseDown (FMouseEvent* ev)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1073,7 +1073,7 @@ void FListView::onMouseMove (FMouseEvent* ev)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// auto-scrolling when dragging mouse outside the widget
|
// auto-scrolling when dragging mouse outside the widget
|
||||||
|
@ -1160,7 +1160,7 @@ void FListView::onTimer (FTimerEvent*)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1199,7 +1199,7 @@ void FListView::onWheel (FWheelEvent* ev)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1823,7 +1823,7 @@ void FListView::drawBufferedHeadline()
|
||||||
std::size_t offset{0};
|
std::size_t offset{0};
|
||||||
bool left_truncated_fullwidth{false};
|
bool left_truncated_fullwidth{false};
|
||||||
bool right_truncated_fullwidth{false};
|
bool right_truncated_fullwidth{false};
|
||||||
std::vector<charData>::const_iterator first{}, last{};
|
std::vector<FChar>::const_iterator first{}, last{};
|
||||||
last = headerline.end();
|
last = headerline.end();
|
||||||
|
|
||||||
// Search for the start position
|
// Search for the start position
|
||||||
|
@ -1934,7 +1934,7 @@ void FListView::updateDrawing (bool draw_vbar, bool draw_hbar)
|
||||||
hbar->drawBar();
|
hbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -2642,7 +2642,7 @@ void FListView::cb_VBarChange (FWidget*, FDataPtr)
|
||||||
vbar->drawBar();
|
vbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2694,7 +2694,7 @@ void FListView::cb_HBarChange (FWidget*, FDataPtr)
|
||||||
drawHeadlines();
|
drawHeadlines();
|
||||||
drawList();
|
drawList();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( scrollType >= FScrollbar::scrollStepBackward )
|
if ( scrollType >= FScrollbar::scrollStepBackward )
|
||||||
|
@ -2705,7 +2705,7 @@ void FListView::cb_HBarChange (FWidget*, FDataPtr)
|
||||||
hbar->drawBar();
|
hbar->drawBar();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ void FMenu::hide()
|
||||||
const auto& t_geometry = getTermGeometryWithShadow();
|
const auto& t_geometry = getTermGeometryWithShadow();
|
||||||
restoreVTerm (t_geometry);
|
restoreVTerm (t_geometry);
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
|
|
||||||
if ( ! isSubMenu() )
|
if ( ! isSubMenu() )
|
||||||
{
|
{
|
||||||
|
@ -204,7 +204,7 @@ void FMenu::onMouseDown (FMouseEvent* ev)
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -313,7 +313,7 @@ void FMenu::onMouseMove (FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
closeOpenedSubMenu();
|
closeOpenedSubMenu();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ void FMenu::openSubMenu (FMenu* sub_menu, bool select)
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -696,7 +696,7 @@ void FMenu::mouseDownSubmenu (FMenuItem* m_item)
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,7 +764,7 @@ bool FMenu::mouseUpOverList (FPoint mouse_pos)
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1038,7 +1038,7 @@ bool FMenu::selectNextItem()
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,7 +1088,7 @@ bool FMenu::selectPrevItem()
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1151,7 +1151,7 @@ bool FMenu::hotkeyMenu (FKeyEvent* ev)
|
||||||
hide();
|
hide();
|
||||||
hideSuperMenus();
|
hideSuperMenus();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
item->processClicked();
|
item->processClicked();
|
||||||
}
|
}
|
||||||
|
@ -1494,7 +1494,7 @@ inline void FMenu::selectPrevMenu (FKeyEvent* ev)
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
keypressMenuBar(ev); // select previous menu
|
keypressMenuBar(ev); // select previous menu
|
||||||
|
@ -1567,7 +1567,7 @@ inline void FMenu::closeMenu()
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -971,7 +971,7 @@ void FMenuBar::leaveMenuBar()
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
mouse_down = false;
|
mouse_down = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ void FMenuItem::setText (const FString& txt)
|
||||||
void FMenuItem::addAccelerator (FKey key, FWidget* obj)
|
void FMenuItem::addAccelerator (FKey key, FWidget* obj)
|
||||||
{
|
{
|
||||||
auto root = getRootWidget();
|
auto root = getRootWidget();
|
||||||
accelerator accel = { key, obj };
|
FAccelerator accel = { key, obj };
|
||||||
|
|
||||||
if ( root && root->getAcceleratorList() )
|
if ( root && root->getAcceleratorList() )
|
||||||
{
|
{
|
||||||
|
@ -270,7 +270,7 @@ void FMenuItem::openMenu()
|
||||||
dd_menu->raiseWindow();
|
dd_menu->raiseWindow();
|
||||||
dd_menu->redraw();
|
dd_menu->redraw();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -215,7 +215,7 @@ void FMouse::clearButtonState()
|
||||||
|
|
||||||
// protected methods of FMouse
|
// protected methods of FMouse
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FMouse::button& FMouse::getButtonState()
|
inline FMouse::FMouseButton& FMouse::getButtonState()
|
||||||
{
|
{
|
||||||
return b_state;
|
return b_state;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace finalcut
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
bool FObject::timer_modify_lock;
|
bool FObject::timer_modify_lock;
|
||||||
FObject::TimerList* FObject::timer_list{nullptr};
|
FObject::FTimerList* FObject::timer_list{nullptr};
|
||||||
const FString* fc::emptyFString::empty_string{nullptr};
|
const FString* fc::emptyFString::empty_string{nullptr};
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ FObject::FObject (FObject* parent)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
timer_list = new TimerList;
|
timer_list = new FTimerList;
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc& ex)
|
catch (const std::bad_alloc& ex)
|
||||||
{
|
{
|
||||||
|
@ -281,7 +281,7 @@ int FObject::addTimer (int interval)
|
||||||
time_interval.tv_usec = (interval % 1000) * 1000;
|
time_interval.tv_usec = (interval % 1000) * 1000;
|
||||||
getCurrentTime (¤tTime);
|
getCurrentTime (¤tTime);
|
||||||
timeval timeout = currentTime + time_interval;
|
timeval timeout = currentTime + time_interval;
|
||||||
timer_data t{ id, time_interval, timeout, this };
|
FTimerData t{ id, time_interval, timeout, this };
|
||||||
|
|
||||||
// insert in list sorted by timeout
|
// insert in list sorted by timeout
|
||||||
auto iter = timer_list->begin();
|
auto iter = timer_list->begin();
|
||||||
|
|
|
@ -450,7 +450,7 @@ void FOptiAttr::set_orig_orig_colors (char cap[])
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FOptiAttr::isNormal (charData*& ch)
|
bool FOptiAttr::isNormal (FChar*& ch)
|
||||||
{
|
{
|
||||||
return hasNoAttribute(ch) && ! hasColor(ch);
|
return hasNoAttribute(ch) && ! hasColor(ch);
|
||||||
}
|
}
|
||||||
|
@ -542,7 +542,7 @@ FColor FOptiAttr::vga2ansi (FColor color)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
char* FOptiAttr::changeAttribute (charData*& term, charData*& next)
|
char* FOptiAttr::changeAttribute (FChar*& term, FChar*& next)
|
||||||
{
|
{
|
||||||
const bool next_has_color = hasColor(next);
|
const bool next_has_color = hasColor(next);
|
||||||
fake_reverse = false;
|
fake_reverse = false;
|
||||||
|
@ -558,7 +558,7 @@ char* FOptiAttr::changeAttribute (charData*& term, charData*& next)
|
||||||
|
|
||||||
// Simulate invisible characters
|
// Simulate invisible characters
|
||||||
if ( ! F_enter_secure_mode.cap && next->attr.bit.invisible )
|
if ( ! F_enter_secure_mode.cap && next->attr.bit.invisible )
|
||||||
next->encoded_code = ' ';
|
next->encoded_char = ' ';
|
||||||
|
|
||||||
// Look for no changes
|
// Look for no changes
|
||||||
if ( ! (switchOn() || switchOff() || hasColorChanged(term, next)) )
|
if ( ! (switchOn() || switchOff() || hasColorChanged(term, next)) )
|
||||||
|
@ -584,7 +584,7 @@ char* FOptiAttr::changeAttribute (charData*& term, charData*& next)
|
||||||
|
|
||||||
// private methods of FOptiAttr
|
// private methods of FOptiAttr
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermBold (charData*& term)
|
inline bool FOptiAttr::setTermBold (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -598,7 +598,7 @@ inline bool FOptiAttr::setTermBold (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermBold (charData*& term)
|
inline bool FOptiAttr::unsetTermBold (FChar*& term)
|
||||||
{
|
{
|
||||||
// Back to normal intensity (turns off bold + dim)
|
// Back to normal intensity (turns off bold + dim)
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ inline bool FOptiAttr::unsetTermBold (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermDim (charData*& term)
|
inline bool FOptiAttr::setTermDim (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -634,7 +634,7 @@ inline bool FOptiAttr::setTermDim (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermDim (charData*& term)
|
inline bool FOptiAttr::unsetTermDim (FChar*& term)
|
||||||
{
|
{
|
||||||
// Back to normal intensity (turns off bold + dim)
|
// Back to normal intensity (turns off bold + dim)
|
||||||
|
|
||||||
|
@ -656,7 +656,7 @@ inline bool FOptiAttr::unsetTermDim (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermItalic (charData*& term)
|
inline bool FOptiAttr::setTermItalic (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -670,7 +670,7 @@ inline bool FOptiAttr::setTermItalic (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermItalic (charData*& term)
|
inline bool FOptiAttr::unsetTermItalic (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -687,7 +687,7 @@ inline bool FOptiAttr::unsetTermItalic (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermUnderline (charData*& term)
|
inline bool FOptiAttr::setTermUnderline (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -701,7 +701,7 @@ inline bool FOptiAttr::setTermUnderline (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermUnderline (charData*& term)
|
inline bool FOptiAttr::unsetTermUnderline (FChar*& term)
|
||||||
{
|
{
|
||||||
// Turns off every underlining
|
// Turns off every underlining
|
||||||
|
|
||||||
|
@ -723,7 +723,7 @@ inline bool FOptiAttr::unsetTermUnderline (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermBlink (charData*& term)
|
inline bool FOptiAttr::setTermBlink (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -737,7 +737,7 @@ inline bool FOptiAttr::setTermBlink (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermBlink (charData*& term)
|
inline bool FOptiAttr::unsetTermBlink (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -754,7 +754,7 @@ inline bool FOptiAttr::unsetTermBlink (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermReverse (charData*& term)
|
inline bool FOptiAttr::setTermReverse (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -768,7 +768,7 @@ inline bool FOptiAttr::setTermReverse (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermReverse (charData*& term)
|
inline bool FOptiAttr::unsetTermReverse (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -785,7 +785,7 @@ inline bool FOptiAttr::unsetTermReverse (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermStandout (charData*& term)
|
inline bool FOptiAttr::setTermStandout (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -799,7 +799,7 @@ inline bool FOptiAttr::setTermStandout (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermStandout (charData*& term)
|
inline bool FOptiAttr::unsetTermStandout (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -816,7 +816,7 @@ inline bool FOptiAttr::unsetTermStandout (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermInvisible (charData*& term)
|
inline bool FOptiAttr::setTermInvisible (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -830,7 +830,7 @@ inline bool FOptiAttr::setTermInvisible (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermInvisible (charData*& term)
|
inline bool FOptiAttr::unsetTermInvisible (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -847,7 +847,7 @@ inline bool FOptiAttr::unsetTermInvisible (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermProtected (charData*& term)
|
inline bool FOptiAttr::setTermProtected (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -861,7 +861,7 @@ inline bool FOptiAttr::setTermProtected (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermProtected (charData*& term)
|
inline bool FOptiAttr::unsetTermProtected (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -878,7 +878,7 @@ inline bool FOptiAttr::unsetTermProtected (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermCrossedOut (charData*& term)
|
inline bool FOptiAttr::setTermCrossedOut (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -892,7 +892,7 @@ inline bool FOptiAttr::setTermCrossedOut (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermCrossedOut (charData*& term)
|
inline bool FOptiAttr::unsetTermCrossedOut (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -909,7 +909,7 @@ inline bool FOptiAttr::unsetTermCrossedOut (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermDoubleUnderline (charData*& term)
|
inline bool FOptiAttr::setTermDoubleUnderline (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -923,7 +923,7 @@ inline bool FOptiAttr::setTermDoubleUnderline (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermDoubleUnderline (charData*& term)
|
inline bool FOptiAttr::unsetTermDoubleUnderline (FChar*& term)
|
||||||
{
|
{
|
||||||
// Turns off every underlining
|
// Turns off every underlining
|
||||||
|
|
||||||
|
@ -945,7 +945,7 @@ inline bool FOptiAttr::unsetTermDoubleUnderline (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FOptiAttr::setTermAttributes ( charData*& term
|
bool FOptiAttr::setTermAttributes ( FChar*& term
|
||||||
, bool p1, bool p2, bool p3
|
, bool p1, bool p2, bool p3
|
||||||
, bool p4, bool p5, bool p6
|
, bool p4, bool p5, bool p6
|
||||||
, bool p7, bool p8, bool p9 )
|
, bool p7, bool p8, bool p9 )
|
||||||
|
@ -985,7 +985,7 @@ bool FOptiAttr::setTermAttributes ( charData*& term
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermAttributes (charData*& term)
|
inline bool FOptiAttr::unsetTermAttributes (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -999,7 +999,7 @@ inline bool FOptiAttr::unsetTermAttributes (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermAltCharset (charData*& term)
|
inline bool FOptiAttr::setTermAltCharset (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -1016,7 +1016,7 @@ inline bool FOptiAttr::setTermAltCharset (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermAltCharset (charData*& term)
|
inline bool FOptiAttr::unsetTermAltCharset (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -1033,7 +1033,7 @@ inline bool FOptiAttr::unsetTermAltCharset (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::setTermPCcharset (charData*& term)
|
inline bool FOptiAttr::setTermPCcharset (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -1050,7 +1050,7 @@ inline bool FOptiAttr::setTermPCcharset (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::unsetTermPCcharset (charData*& term)
|
inline bool FOptiAttr::unsetTermPCcharset (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -1067,7 +1067,7 @@ inline bool FOptiAttr::unsetTermPCcharset (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FOptiAttr::setTermDefaultColor (charData*& term)
|
bool FOptiAttr::setTermDefaultColor (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( ! term )
|
if ( ! term )
|
||||||
return false;
|
return false;
|
||||||
|
@ -1090,7 +1090,7 @@ bool FOptiAttr::setTermDefaultColor (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FOptiAttr::setAttributesOn (charData*& term)
|
void FOptiAttr::setAttributesOn (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( on.attr.bit.alt_charset )
|
if ( on.attr.bit.alt_charset )
|
||||||
setTermAltCharset(term);
|
setTermAltCharset(term);
|
||||||
|
@ -1133,7 +1133,7 @@ void FOptiAttr::setAttributesOn (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FOptiAttr::setAttributesOff (charData*& term)
|
void FOptiAttr::setAttributesOff (FChar*& term)
|
||||||
{
|
{
|
||||||
if ( off.attr.bit.pc_charset )
|
if ( off.attr.bit.pc_charset )
|
||||||
unsetTermPCcharset(term);
|
unsetTermPCcharset(term);
|
||||||
|
@ -1176,7 +1176,7 @@ void FOptiAttr::setAttributesOff (charData*& term)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FOptiAttr::hasColor (charData*& attr)
|
bool FOptiAttr::hasColor (FChar*& attr)
|
||||||
{
|
{
|
||||||
if ( attr
|
if ( attr
|
||||||
&& attr->fg_color == fc::Default
|
&& attr->fg_color == fc::Default
|
||||||
|
@ -1187,7 +1187,7 @@ bool FOptiAttr::hasColor (charData*& attr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FOptiAttr::hasAttribute (charData*& attr)
|
bool FOptiAttr::hasAttribute (FChar*& attr)
|
||||||
{
|
{
|
||||||
if ( attr )
|
if ( attr )
|
||||||
{
|
{
|
||||||
|
@ -1210,13 +1210,13 @@ bool FOptiAttr::hasAttribute (charData*& attr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FOptiAttr::hasNoAttribute (charData*& attr)
|
bool FOptiAttr::hasNoAttribute (FChar*& attr)
|
||||||
{
|
{
|
||||||
return ! hasAttribute(attr);
|
return ! hasAttribute(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FOptiAttr::hasColorChanged (charData*& term, charData*& next)
|
inline bool FOptiAttr::hasColorChanged (FChar*& term, FChar*& next)
|
||||||
{
|
{
|
||||||
if ( term && next )
|
if ( term && next )
|
||||||
{
|
{
|
||||||
|
@ -1233,7 +1233,7 @@ inline bool FOptiAttr::hasColorChanged (charData*& term, charData*& next)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::resetColor (charData*& attr)
|
inline void FOptiAttr::resetColor (FChar*& attr)
|
||||||
{
|
{
|
||||||
if ( attr )
|
if ( attr )
|
||||||
{
|
{
|
||||||
|
@ -1243,7 +1243,7 @@ inline void FOptiAttr::resetColor (charData*& attr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::prevent_no_color_video_attributes ( charData*& attr
|
inline void FOptiAttr::prevent_no_color_video_attributes ( FChar*& attr
|
||||||
, bool next_has_color )
|
, bool next_has_color )
|
||||||
{
|
{
|
||||||
// Ignore attributes which can not combined with a color
|
// Ignore attributes which can not combined with a color
|
||||||
|
@ -1304,8 +1304,8 @@ inline void FOptiAttr::prevent_no_color_video_attributes ( charData*& attr
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::deactivateAttributes ( charData*& term
|
inline void FOptiAttr::deactivateAttributes ( FChar*& term
|
||||||
, charData*& next )
|
, FChar*& next )
|
||||||
{
|
{
|
||||||
if ( hasAttribute(term) )
|
if ( hasAttribute(term) )
|
||||||
{
|
{
|
||||||
|
@ -1328,8 +1328,8 @@ inline void FOptiAttr::deactivateAttributes ( charData*& term
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::changeAttributeSGR ( charData*& term
|
inline void FOptiAttr::changeAttributeSGR ( FChar*& term
|
||||||
, charData*& next )
|
, FChar*& next )
|
||||||
{
|
{
|
||||||
bool pc_charset_usable{true};
|
bool pc_charset_usable{true};
|
||||||
|
|
||||||
|
@ -1378,8 +1378,8 @@ inline void FOptiAttr::changeAttributeSGR ( charData*& term
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::changeAttributeSeparately ( charData*& term
|
inline void FOptiAttr::changeAttributeSeparately ( FChar*& term
|
||||||
, charData*& next )
|
, FChar*& next )
|
||||||
{
|
{
|
||||||
setAttributesOff(term);
|
setAttributesOff(term);
|
||||||
|
|
||||||
|
@ -1391,7 +1391,7 @@ inline void FOptiAttr::changeAttributeSeparately ( charData*& term
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FOptiAttr::change_color (charData*& term, charData*& next)
|
void FOptiAttr::change_color (FChar*& term, FChar*& next)
|
||||||
{
|
{
|
||||||
if ( ! (term && next) )
|
if ( ! (term && next) )
|
||||||
return;
|
return;
|
||||||
|
@ -1434,8 +1434,8 @@ void FOptiAttr::change_color (charData*& term, charData*& next)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::change_to_default_color ( charData*& term
|
inline void FOptiAttr::change_to_default_color ( FChar*& term
|
||||||
, charData*& next
|
, FChar*& next
|
||||||
, FColor& fg, FColor& bg )
|
, FColor& fg, FColor& bg )
|
||||||
{
|
{
|
||||||
if ( ansi_default_color )
|
if ( ansi_default_color )
|
||||||
|
@ -1474,7 +1474,7 @@ inline void FOptiAttr::change_to_default_color ( charData*& term
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::change_current_color ( charData*& term
|
inline void FOptiAttr::change_current_color ( FChar*& term
|
||||||
, FColor fg, FColor bg )
|
, FColor fg, FColor bg )
|
||||||
{
|
{
|
||||||
char* color_str{};
|
char* color_str{};
|
||||||
|
@ -1522,7 +1522,7 @@ inline void FOptiAttr::change_current_color ( charData*& term
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::resetAttribute (charData*& attr)
|
inline void FOptiAttr::resetAttribute (FChar*& attr)
|
||||||
{
|
{
|
||||||
if ( attr )
|
if ( attr )
|
||||||
{
|
{
|
||||||
|
@ -1532,7 +1532,7 @@ inline void FOptiAttr::resetAttribute (charData*& attr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::reset (charData*& attr)
|
inline void FOptiAttr::reset (FChar*& attr)
|
||||||
{
|
{
|
||||||
if ( attr )
|
if ( attr )
|
||||||
{
|
{
|
||||||
|
@ -1593,7 +1593,7 @@ inline bool FOptiAttr::hasCharsetEquivalence()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::detectSwitchOn (charData*& term, charData*& next)
|
inline void FOptiAttr::detectSwitchOn (FChar*& term, FChar*& next)
|
||||||
{
|
{
|
||||||
if ( ! (term && next) )
|
if ( ! (term && next) )
|
||||||
return;
|
return;
|
||||||
|
@ -1614,7 +1614,7 @@ inline void FOptiAttr::detectSwitchOn (charData*& term, charData*& next)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FOptiAttr::detectSwitchOff (charData*& term, charData*& next)
|
inline void FOptiAttr::detectSwitchOff (FChar*& term, FChar*& next)
|
||||||
{
|
{
|
||||||
if ( ! (term && next) )
|
if ( ! (term && next) )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -133,7 +133,7 @@ void FProgressbar::draw()
|
||||||
if ( getFlags().shadow )
|
if ( getFlags().shadow )
|
||||||
drawShadow(this);
|
drawShadow(this);
|
||||||
|
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -179,7 +179,7 @@ void FProgressbar::drawProgressBar()
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -589,7 +589,7 @@ void FScrollView::onChildFocusOut (FFocusEvent* out_ev)
|
||||||
|
|
||||||
// protected methods of FScrollView
|
// protected methods of FScrollView
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FVTerm::term_area* FScrollView::getPrintArea()
|
FVTerm::FTermArea* FScrollView::getPrintArea()
|
||||||
{
|
{
|
||||||
// returns print area or viewport
|
// returns print area or viewport
|
||||||
|
|
||||||
|
@ -675,13 +675,13 @@ void FScrollView::copy2area()
|
||||||
|
|
||||||
for (int y{0}; y < y_end; y++) // line loop
|
for (int y{0}; y < y_end; y++) // line loop
|
||||||
{
|
{
|
||||||
charData* vc{}; // viewport character
|
FChar* vc{}; // viewport character
|
||||||
charData* ac{}; // area character
|
FChar* ac{}; // area character
|
||||||
int v_line_len = viewport->width;
|
int v_line_len = viewport->width;
|
||||||
int a_line_len = printarea->width + printarea->right_shadow;
|
int a_line_len = printarea->width + printarea->right_shadow;
|
||||||
vc = &viewport->text[(dy + y) * v_line_len + dx];
|
vc = &viewport->data[(dy + y) * v_line_len + dx];
|
||||||
ac = &printarea->text[(ay + y) * a_line_len + ax];
|
ac = &printarea->data[(ay + y) * a_line_len + ax];
|
||||||
std::memcpy (ac, vc, sizeof(charData) * unsigned(x_end));
|
std::memcpy (ac, vc, sizeof(FChar) * unsigned(x_end));
|
||||||
|
|
||||||
if ( int(printarea->changes[ay + y].xmin) > ax )
|
if ( int(printarea->changes[ay + y].xmin) > ax )
|
||||||
printarea->changes[ay + y].xmin = uInt(ax);
|
printarea->changes[ay + y].xmin = uInt(ax);
|
||||||
|
|
|
@ -124,7 +124,7 @@ void FSwitch::draw()
|
||||||
drawCheckButton();
|
drawCheckButton();
|
||||||
FToggleButton::draw();
|
FToggleButton::draw();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
264
src/fterm.cpp
264
src/fterm.cpp
|
@ -93,8 +93,6 @@ FMouseControl* FTerm::mouse {nullptr};
|
||||||
FTermDebugData* FTerm::debug_data {nullptr};
|
FTermDebugData* FTerm::debug_data {nullptr};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// function prototypes
|
|
||||||
uInt env2uint (const char*);
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FTerm
|
// class FTerm
|
||||||
|
@ -416,7 +414,7 @@ FTermDebugData& FTerm::getFTermDebugData()
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FTerm::isNormal (charData*& ch)
|
bool FTerm::isNormal (FChar*& ch)
|
||||||
{
|
{
|
||||||
return opti_attr->isNormal(ch);
|
return opti_attr->isNormal(ch);
|
||||||
}
|
}
|
||||||
|
@ -1290,8 +1288,8 @@ void FTerm::initScreenSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
char* FTerm::changeAttribute ( charData*& term_attr
|
char* FTerm::changeAttribute ( FChar*& term_attr
|
||||||
, charData*& next_attr )
|
, FChar*& next_attr )
|
||||||
{
|
{
|
||||||
return opti_attr->changeAttribute (term_attr, next_attr);
|
return opti_attr->changeAttribute (term_attr, next_attr);
|
||||||
}
|
}
|
||||||
|
@ -2268,7 +2266,7 @@ void FTerm::init (bool disable_alt_screen)
|
||||||
init_alt_charset();
|
init_alt_charset();
|
||||||
|
|
||||||
// Pass the terminal capabilities to the keyboard object
|
// Pass the terminal capabilities to the keyboard object
|
||||||
keyboard->setTermcapMap (fc::Fkey);
|
keyboard->setTermcapMap (fc::fkey);
|
||||||
|
|
||||||
// Initializes locale information
|
// Initializes locale information
|
||||||
init_locale();
|
init_locale();
|
||||||
|
@ -2539,258 +2537,4 @@ void FTerm::signal_handler (int signum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FTerm non-member functions
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
uInt env2uint (const char* env)
|
|
||||||
{
|
|
||||||
FString str(getenv(env));
|
|
||||||
|
|
||||||
if ( str.isEmpty() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return str.toUInt();
|
|
||||||
}
|
|
||||||
catch (const std::exception&)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
wchar_t cp437_to_unicode (uChar c)
|
|
||||||
{
|
|
||||||
constexpr std::size_t CP437 = 0;
|
|
||||||
constexpr std::size_t UNICODE = 1;
|
|
||||||
wchar_t ucs = c;
|
|
||||||
|
|
||||||
for (std::size_t i{0}; i <= fc::lastCP437Item; i++)
|
|
||||||
{
|
|
||||||
if ( fc::cp437_ucs[i][CP437] == c ) // found
|
|
||||||
{
|
|
||||||
ucs = fc::cp437_ucs[i][UNICODE];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ucs;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
uChar unicode_to_cp437 (wchar_t ucs)
|
|
||||||
{
|
|
||||||
constexpr std::size_t CP437 = 0;
|
|
||||||
constexpr std::size_t UNICODE = 1;
|
|
||||||
uChar c{'?'};
|
|
||||||
|
|
||||||
for (std::size_t i{0}; i <= fc::lastCP437Item; i++)
|
|
||||||
{
|
|
||||||
if ( fc::cp437_ucs[i][UNICODE] == ucs ) // found
|
|
||||||
{
|
|
||||||
c = uChar(fc::cp437_ucs[i][CP437]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
FString getFullWidth (const FString& str)
|
|
||||||
{
|
|
||||||
// Converts half-width to full-width characters
|
|
||||||
|
|
||||||
FString s(str);
|
|
||||||
constexpr std::size_t HALF = 0;
|
|
||||||
constexpr std::size_t FULL = 1;
|
|
||||||
|
|
||||||
for (auto&& c : s)
|
|
||||||
{
|
|
||||||
if ( c > L'\x20' && c < L'\x7f' ) // half-width ASCII
|
|
||||||
{
|
|
||||||
c += 0xfee0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (std::size_t i{0}; i <= fc::lastHalfWidthItem; i++)
|
|
||||||
{
|
|
||||||
if ( fc::halfWidth_fullWidth[i][HALF] == c ) // found
|
|
||||||
c = fc::halfWidth_fullWidth[i][FULL];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
FString getHalfWidth (const FString& str)
|
|
||||||
{
|
|
||||||
// Converts full-width to half-width characters
|
|
||||||
|
|
||||||
FString s(str);
|
|
||||||
constexpr std::size_t HALF = 0;
|
|
||||||
constexpr std::size_t FULL = 1;
|
|
||||||
|
|
||||||
for (auto&& c : s)
|
|
||||||
{
|
|
||||||
if ( c > L'\xff00' && c < L'\xff5f' ) // full-width ASCII
|
|
||||||
{
|
|
||||||
c -= 0xfee0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (std::size_t i{0}; i <= fc::lastHalfWidthItem; i++)
|
|
||||||
{
|
|
||||||
if ( fc::halfWidth_fullWidth[i][FULL] == c ) // found
|
|
||||||
c = fc::halfWidth_fullWidth[i][HALF];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getColumnWidthToLength ( const FString& str
|
|
||||||
, std::size_t col_len )
|
|
||||||
{
|
|
||||||
std::size_t column_width{0}, length{0};
|
|
||||||
|
|
||||||
for (auto&& ch : str)
|
|
||||||
{
|
|
||||||
if ( column_width < col_len )
|
|
||||||
{
|
|
||||||
column_width += getColumnWidth(ch);
|
|
||||||
length++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
FString getColumnSubString ( const FString& str
|
|
||||||
, std::size_t col_pos, std::size_t col_len )
|
|
||||||
{
|
|
||||||
FString s(str);
|
|
||||||
std::size_t col_first{1}, col_num{0}, first{1}, num{0};
|
|
||||||
|
|
||||||
if ( col_len == 0 || s.isEmpty() )
|
|
||||||
return FString(L"");
|
|
||||||
|
|
||||||
if ( col_pos == 0 )
|
|
||||||
col_pos = 1;
|
|
||||||
|
|
||||||
for (auto&& ch : s)
|
|
||||||
{
|
|
||||||
std::size_t width = getColumnWidth(ch);
|
|
||||||
|
|
||||||
if ( col_first < col_pos )
|
|
||||||
{
|
|
||||||
if ( col_first + width <= col_pos )
|
|
||||||
{
|
|
||||||
col_first += width;
|
|
||||||
first++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ch = fc::SingleLeftAngleQuotationMark; // ‹
|
|
||||||
num = col_num = 1;
|
|
||||||
col_pos = col_first;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( col_num + width <= col_len )
|
|
||||||
{
|
|
||||||
col_num += width;
|
|
||||||
num++;
|
|
||||||
}
|
|
||||||
else if ( col_num < col_len )
|
|
||||||
{
|
|
||||||
ch = fc::SingleRightAngleQuotationMark; // ›
|
|
||||||
num++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( col_first < col_pos ) // String length < col_pos
|
|
||||||
return FString(L"");
|
|
||||||
|
|
||||||
return s.mid(first, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getColumnWidth (const FString& s, std::size_t pos)
|
|
||||||
{
|
|
||||||
if ( s.isEmpty() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
std::size_t column_width{0};
|
|
||||||
auto length = s.getLength();
|
|
||||||
|
|
||||||
if ( pos > length )
|
|
||||||
pos = length;
|
|
||||||
|
|
||||||
for (std::size_t i{0}; i < pos; i++)
|
|
||||||
column_width += getColumnWidth(s[i]);
|
|
||||||
|
|
||||||
return column_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getColumnWidth (const FString& s)
|
|
||||||
{
|
|
||||||
if ( s.isEmpty() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
const wchar_t* str = s.wc_str();
|
|
||||||
size_t len = std::wcslen(str);
|
|
||||||
int column_width = wcswidth (str, len);
|
|
||||||
return ( column_width == -1 ) ? 0 : std::size_t(column_width);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getColumnWidth (const wchar_t wchar)
|
|
||||||
{
|
|
||||||
int column_width{};
|
|
||||||
|
|
||||||
if ( wchar >= fc::NF_rev_left_arrow2 && wchar <= fc::NF_check_mark )
|
|
||||||
column_width = 1;
|
|
||||||
else
|
|
||||||
column_width = wcwidth(wchar);
|
|
||||||
|
|
||||||
return ( column_width == -1 ) ? 0 : std::size_t(column_width);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getColumnWidth (charData& term_char)
|
|
||||||
{
|
|
||||||
std::size_t char_width = getColumnWidth(term_char.code);
|
|
||||||
|
|
||||||
if ( char_width == 2 && FTerm::getEncoding() != fc::UTF8 )
|
|
||||||
{
|
|
||||||
term_char.code = '.';
|
|
||||||
term_char.attr.bit.char_width = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
term_char.attr.bit.char_width = char_width & 0x03;
|
|
||||||
|
|
||||||
return char_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getColumnWidth (const FTermBuffer& termbuffer)
|
|
||||||
{
|
|
||||||
std::size_t column_width{0};
|
|
||||||
|
|
||||||
for (auto&& tc : termbuffer)
|
|
||||||
column_width += tc.attr.bit.char_width;
|
|
||||||
|
|
||||||
return column_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
|
@ -0,0 +1,285 @@
|
||||||
|
/***********************************************************************
|
||||||
|
* fterm_functions.cpp - FTerm helper functions *
|
||||||
|
* *
|
||||||
|
* This file is part of the Final Cut widget toolkit *
|
||||||
|
* *
|
||||||
|
* Copyright 2019 Markus Gans *
|
||||||
|
* *
|
||||||
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
* as published by the Free Software Foundation; either version 3 of *
|
||||||
|
* the License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* The Final Cut is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU Lesser General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU Lesser General Public *
|
||||||
|
* License along with this program. If not, see *
|
||||||
|
* <http://www.gnu.org/licenses/>. *
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include "final/fcharmap.h"
|
||||||
|
#include "final/fterm.h"
|
||||||
|
#include "final/ftermbuffer.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
|
// FTerm non-member functions
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
uInt env2uint (const char* env)
|
||||||
|
{
|
||||||
|
FString str(getenv(env));
|
||||||
|
|
||||||
|
if ( str.isEmpty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return str.toUInt();
|
||||||
|
}
|
||||||
|
catch (const std::exception&)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
wchar_t cp437_to_unicode (uChar c)
|
||||||
|
{
|
||||||
|
constexpr std::size_t CP437 = 0;
|
||||||
|
constexpr std::size_t UNICODE = 1;
|
||||||
|
wchar_t ucs = c;
|
||||||
|
|
||||||
|
for (std::size_t i{0}; i <= fc::lastCP437Item; i++)
|
||||||
|
{
|
||||||
|
if ( fc::cp437_ucs[i][CP437] == c ) // found
|
||||||
|
{
|
||||||
|
ucs = fc::cp437_ucs[i][UNICODE];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ucs;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
uChar unicode_to_cp437 (wchar_t ucs)
|
||||||
|
{
|
||||||
|
constexpr std::size_t CP437 = 0;
|
||||||
|
constexpr std::size_t UNICODE = 1;
|
||||||
|
uChar c{'?'};
|
||||||
|
|
||||||
|
for (std::size_t i{0}; i <= fc::lastCP437Item; i++)
|
||||||
|
{
|
||||||
|
if ( fc::cp437_ucs[i][UNICODE] == ucs ) // found
|
||||||
|
{
|
||||||
|
c = uChar(fc::cp437_ucs[i][CP437]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
FString getFullWidth (const FString& str)
|
||||||
|
{
|
||||||
|
// Converts half-width to full-width characters
|
||||||
|
|
||||||
|
FString s(str);
|
||||||
|
constexpr std::size_t HALF = 0;
|
||||||
|
constexpr std::size_t FULL = 1;
|
||||||
|
|
||||||
|
for (auto&& c : s)
|
||||||
|
{
|
||||||
|
if ( c > L'\x20' && c < L'\x7f' ) // half-width ASCII
|
||||||
|
{
|
||||||
|
c += 0xfee0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (std::size_t i{0}; i <= fc::lastHalfWidthItem; i++)
|
||||||
|
{
|
||||||
|
if ( fc::halfWidth_fullWidth[i][HALF] == c ) // found
|
||||||
|
c = fc::halfWidth_fullWidth[i][FULL];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
FString getHalfWidth (const FString& str)
|
||||||
|
{
|
||||||
|
// Converts full-width to half-width characters
|
||||||
|
|
||||||
|
FString s(str);
|
||||||
|
constexpr std::size_t HALF = 0;
|
||||||
|
constexpr std::size_t FULL = 1;
|
||||||
|
|
||||||
|
for (auto&& c : s)
|
||||||
|
{
|
||||||
|
if ( c > L'\xff00' && c < L'\xff5f' ) // full-width ASCII
|
||||||
|
{
|
||||||
|
c -= 0xfee0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (std::size_t i{0}; i <= fc::lastHalfWidthItem; i++)
|
||||||
|
{
|
||||||
|
if ( fc::halfWidth_fullWidth[i][FULL] == c ) // found
|
||||||
|
c = fc::halfWidth_fullWidth[i][HALF];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
FString getColumnSubString ( const FString& str
|
||||||
|
, std::size_t col_pos, std::size_t col_len )
|
||||||
|
{
|
||||||
|
FString s(str);
|
||||||
|
std::size_t col_first{1}, col_num{0}, first{1}, num{0};
|
||||||
|
|
||||||
|
if ( col_len == 0 || s.isEmpty() )
|
||||||
|
return FString(L"");
|
||||||
|
|
||||||
|
if ( col_pos == 0 )
|
||||||
|
col_pos = 1;
|
||||||
|
|
||||||
|
for (auto&& ch : s)
|
||||||
|
{
|
||||||
|
std::size_t width = getColumnWidth(ch);
|
||||||
|
|
||||||
|
if ( col_first < col_pos )
|
||||||
|
{
|
||||||
|
if ( col_first + width <= col_pos )
|
||||||
|
{
|
||||||
|
col_first += width;
|
||||||
|
first++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ch = fc::SingleLeftAngleQuotationMark; // ‹
|
||||||
|
num = col_num = 1;
|
||||||
|
col_pos = col_first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( col_num + width <= col_len )
|
||||||
|
{
|
||||||
|
col_num += width;
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
else if ( col_num < col_len )
|
||||||
|
{
|
||||||
|
ch = fc::SingleRightAngleQuotationMark; // ›
|
||||||
|
num++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( col_first < col_pos ) // String length < col_pos
|
||||||
|
return FString(L"");
|
||||||
|
|
||||||
|
return s.mid(first, num);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getLengthFromColumnWidth ( const FString& str
|
||||||
|
, std::size_t col_len )
|
||||||
|
{
|
||||||
|
std::size_t column_width{0}, length{0};
|
||||||
|
|
||||||
|
for (auto&& ch : str)
|
||||||
|
{
|
||||||
|
if ( column_width < col_len )
|
||||||
|
{
|
||||||
|
column_width += getColumnWidth(ch);
|
||||||
|
length++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getColumnWidth (const FString& s, std::size_t pos)
|
||||||
|
{
|
||||||
|
if ( s.isEmpty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
std::size_t column_width{0};
|
||||||
|
auto length = s.getLength();
|
||||||
|
|
||||||
|
if ( pos > length )
|
||||||
|
pos = length;
|
||||||
|
|
||||||
|
for (std::size_t i{0}; i < pos; i++)
|
||||||
|
column_width += getColumnWidth(s[i]);
|
||||||
|
|
||||||
|
return column_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getColumnWidth (const FString& s)
|
||||||
|
{
|
||||||
|
if ( s.isEmpty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const wchar_t* str = s.wc_str();
|
||||||
|
size_t len = std::wcslen(str);
|
||||||
|
int column_width = wcswidth (str, len);
|
||||||
|
return ( column_width == -1 ) ? 0 : std::size_t(column_width);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getColumnWidth (const wchar_t wchar)
|
||||||
|
{
|
||||||
|
int column_width{};
|
||||||
|
|
||||||
|
if ( wchar >= fc::NF_rev_left_arrow2 && wchar <= fc::NF_check_mark )
|
||||||
|
column_width = 1;
|
||||||
|
else
|
||||||
|
column_width = wcwidth(wchar);
|
||||||
|
|
||||||
|
return ( column_width == -1 ) ? 0 : std::size_t(column_width);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getColumnWidth (FChar& term_char)
|
||||||
|
{
|
||||||
|
std::size_t char_width = getColumnWidth(term_char.ch);
|
||||||
|
|
||||||
|
if ( char_width == 2 && FTerm::getEncoding() != fc::UTF8 )
|
||||||
|
{
|
||||||
|
term_char.ch = '.';
|
||||||
|
term_char.attr.bit.char_width = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
term_char.attr.bit.char_width = char_width & 0x03;
|
||||||
|
|
||||||
|
return char_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getColumnWidth (const FTermBuffer& termbuffer)
|
||||||
|
{
|
||||||
|
std::size_t column_width{0};
|
||||||
|
|
||||||
|
for (auto&& tc : termbuffer)
|
||||||
|
column_width += tc.attr.bit.char_width;
|
||||||
|
|
||||||
|
return column_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
|
@ -46,8 +46,8 @@ const FString FTermBuffer::toString() const
|
||||||
std::wstring wide_string{};
|
std::wstring wide_string{};
|
||||||
wide_string.reserve(data.size());
|
wide_string.reserve(data.size());
|
||||||
|
|
||||||
for (auto&& tc : data)
|
for (auto&& fchar : data)
|
||||||
wide_string.push_back(tc.code);
|
wide_string.push_back(fchar.ch);
|
||||||
|
|
||||||
return FString(wide_string);
|
return FString(wide_string);
|
||||||
}
|
}
|
||||||
|
@ -60,9 +60,9 @@ int FTermBuffer::write (const FString& string)
|
||||||
|
|
||||||
for (auto&& c : string)
|
for (auto&& c : string)
|
||||||
{
|
{
|
||||||
charData nc; // next character
|
FChar nc; // next character
|
||||||
nc = FVTerm::getAttribute();
|
nc = FVTerm::getAttribute();
|
||||||
nc.code = c;
|
nc.ch = c;
|
||||||
getColumnWidth(nc); // add column width
|
getColumnWidth(nc); // add column width
|
||||||
nc.attr.bit.no_changes = false;
|
nc.attr.bit.no_changes = false;
|
||||||
nc.attr.bit.printed = false;
|
nc.attr.bit.printed = false;
|
||||||
|
@ -75,8 +75,8 @@ int FTermBuffer::write (const FString& string)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int FTermBuffer::write (wchar_t ch)
|
int FTermBuffer::write (wchar_t ch)
|
||||||
{
|
{
|
||||||
charData nc = FVTerm::getAttribute(); // next character
|
FChar nc = FVTerm::getAttribute(); // next character
|
||||||
nc.code = ch;
|
nc.ch = ch;
|
||||||
getColumnWidth(nc); // add column width
|
getColumnWidth(nc); // add column width
|
||||||
nc.attr.bit.no_changes = false;
|
nc.attr.bit.no_changes = false;
|
||||||
nc.attr.bit.printed = false;
|
nc.attr.bit.printed = false;
|
||||||
|
@ -94,7 +94,7 @@ void FTermBuffer::write (const FColorPair& pair)
|
||||||
|
|
||||||
// FTermBuffer non-member operators
|
// FTermBuffer non-member operators
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FTermBuffer::charDataVector& operator << ( FTermBuffer::charDataVector& termString
|
FTermBuffer::FCharVector& operator << ( FTermBuffer::FCharVector& termString
|
||||||
, const FTermBuffer& buf )
|
, const FTermBuffer& buf )
|
||||||
{
|
{
|
||||||
if ( ! buf.data.empty() )
|
if ( ! buf.data.empty() )
|
||||||
|
|
|
@ -230,48 +230,48 @@ void FTermcap::termcapKeys (char*& buffer)
|
||||||
{
|
{
|
||||||
// Read termcap key strings
|
// Read termcap key strings
|
||||||
|
|
||||||
for (std::size_t i{0}; fc::Fkey[i].tname[0] != 0; i++)
|
for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++)
|
||||||
{
|
{
|
||||||
fc::Fkey[i].string = tgetstr(fc::Fkey[i].tname, &buffer);
|
fc::fkey[i].string = tgetstr(fc::fkey[i].tname, &buffer);
|
||||||
|
|
||||||
// Fallback for rxvt with TERM=xterm
|
// Fallback for rxvt with TERM=xterm
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "khx", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "khx", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "7~"); // Home key
|
fc::fkey[i].string = C_STR(CSI "7~"); // Home key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "@7x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "@7x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "8~"); // End key
|
fc::fkey[i].string = C_STR(CSI "8~"); // End key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k1x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k1x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "11~"); // F1
|
fc::fkey[i].string = C_STR(CSI "11~"); // F1
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k2x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k2x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "12~"); // F2
|
fc::fkey[i].string = C_STR(CSI "12~"); // F2
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k3x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k3x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "13~"); // F3
|
fc::fkey[i].string = C_STR(CSI "13~"); // F3
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k4x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k4x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "14~"); // F4
|
fc::fkey[i].string = C_STR(CSI "14~"); // F4
|
||||||
|
|
||||||
// Fallback for TERM=ansi
|
// Fallback for TERM=ansi
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "@7X", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "@7X", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "K"); // End key
|
fc::fkey[i].string = C_STR(CSI "K"); // End key
|
||||||
|
|
||||||
// Keypad keys
|
// Keypad keys
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "@8x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "@8x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "OM"); // Enter key
|
fc::fkey[i].string = C_STR(ESC "OM"); // Enter key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP1", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP1", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "Oo"); // Keypad slash
|
fc::fkey[i].string = C_STR(ESC "Oo"); // Keypad slash
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP2", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP2", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "Oj"); // Keypad asterisk
|
fc::fkey[i].string = C_STR(ESC "Oj"); // Keypad asterisk
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP3", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP3", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "Om"); // Keypad minus sign
|
fc::fkey[i].string = C_STR(ESC "Om"); // Keypad minus sign
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP4", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP4", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "Ok"); // Keypad plus sign
|
fc::fkey[i].string = C_STR(ESC "Ok"); // Keypad plus sign
|
||||||
}
|
}
|
||||||
|
|
||||||
// VT100 key codes for the arrow and function keys
|
// VT100 key codes for the arrow and function keys
|
||||||
|
@ -290,31 +290,31 @@ void FTermcap::termcapKeysVt100 (char*& buffer)
|
||||||
|| ( TCAP(fc::t_cursor_up)
|
|| ( TCAP(fc::t_cursor_up)
|
||||||
&& (std::strcmp(TCAP(fc::t_cursor_up), CSI "A") == 0) ) )
|
&& (std::strcmp(TCAP(fc::t_cursor_up), CSI "A") == 0) ) )
|
||||||
{
|
{
|
||||||
for (std::size_t i{0}; fc::Fkey[i].tname[0] != 0; i++)
|
for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++)
|
||||||
{
|
{
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kux", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kux", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "A"); // Key up
|
fc::fkey[i].string = C_STR(CSI "A"); // Key up
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kdx", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kdx", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "B"); // Key down
|
fc::fkey[i].string = C_STR(CSI "B"); // Key down
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "krx", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "krx", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "C"); // Key right
|
fc::fkey[i].string = C_STR(CSI "C"); // Key right
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "klx", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "klx", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "D"); // Key left
|
fc::fkey[i].string = C_STR(CSI "D"); // Key left
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k1X", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k1X", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "OP"); // PF1
|
fc::fkey[i].string = C_STR(ESC "OP"); // PF1
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k2X", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k2X", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "OQ"); // PF2
|
fc::fkey[i].string = C_STR(ESC "OQ"); // PF2
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k3X", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k3X", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "OR"); // PF3
|
fc::fkey[i].string = C_STR(ESC "OR"); // PF3
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k4X", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k4X", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(ESC "OS"); // PF4
|
fc::fkey[i].string = C_STR(ESC "OS"); // PF4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,71 +402,71 @@ void FTermcapQuirks::sunConsole()
|
||||||
C_STR(CSI "%p1%dD");
|
C_STR(CSI "%p1%dD");
|
||||||
|
|
||||||
// Sun Microsystems workstation console keys
|
// Sun Microsystems workstation console keys
|
||||||
for (std::size_t i{0}; fc::Fkey[i].tname[0] != 0; i++)
|
for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++)
|
||||||
{
|
{
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "K2", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "K2", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "218z"); // center of keypad
|
fc::fkey[i].string = C_STR(CSI "218z"); // center of keypad
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kb", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kb", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR("\b"); // backspace key
|
fc::fkey[i].string = C_STR("\b"); // backspace key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kD", 2) == 0
|
if ( std::strncmp(fc::fkey[i].tname, "kD", 2) == 0
|
||||||
&& std::strlen(fc::Fkey[i].tname) == 2 )
|
&& std::strlen(fc::fkey[i].tname) == 2 )
|
||||||
fc::Fkey[i].string = C_STR("\177"); // delete-character key
|
fc::fkey[i].string = C_STR("\177"); // delete-character key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "@7", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "@7", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "220z"); // end key
|
fc::fkey[i].string = C_STR(CSI "220z"); // end key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "k;", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "k;", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "233z"); // F10 function key
|
fc::fkey[i].string = C_STR(CSI "233z"); // F10 function key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "F1", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "F1", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "234z"); // F11 function key
|
fc::fkey[i].string = C_STR(CSI "234z"); // F11 function key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "F2", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "F2", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "235z"); // F12 function key
|
fc::fkey[i].string = C_STR(CSI "235z"); // F12 function key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kh", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kh", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "214z"); // home key
|
fc::fkey[i].string = C_STR(CSI "214z"); // home key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kI", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kI", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "247z"); // insert-character key
|
fc::fkey[i].string = C_STR(CSI "247z"); // insert-character key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kN", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kN", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "222z"); // next-page key
|
fc::fkey[i].string = C_STR(CSI "222z"); // next-page key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "%7", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "%7", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "194z"); // options key
|
fc::fkey[i].string = C_STR(CSI "194z"); // options key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kP", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kP", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "216z"); // prev-page key
|
fc::fkey[i].string = C_STR(CSI "216z"); // prev-page key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "&5", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "&5", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "193z"); // resume key
|
fc::fkey[i].string = C_STR(CSI "193z"); // resume key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "&8", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "&8", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "195z"); // undo key
|
fc::fkey[i].string = C_STR(CSI "195z"); // undo key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "K2", 2) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "K2", 2) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "218z"); // center of keypad
|
fc::fkey[i].string = C_STR(CSI "218z"); // center of keypad
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "kDx", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "kDx", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "249z"); // keypad delete
|
fc::fkey[i].string = C_STR(CSI "249z"); // keypad delete
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "@8x", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "@8x", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "250z"); // enter/send key
|
fc::fkey[i].string = C_STR(CSI "250z"); // enter/send key
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP1", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP1", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "212z"); // keypad slash
|
fc::fkey[i].string = C_STR(CSI "212z"); // keypad slash
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP2", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP2", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "213z"); // keypad asterisk
|
fc::fkey[i].string = C_STR(CSI "213z"); // keypad asterisk
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP3", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP3", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "254z"); // keypad minus sign
|
fc::fkey[i].string = C_STR(CSI "254z"); // keypad minus sign
|
||||||
|
|
||||||
if ( std::strncmp(fc::Fkey[i].tname, "KP4", 3) == 0 )
|
if ( std::strncmp(fc::fkey[i].tname, "KP4", 3) == 0 )
|
||||||
fc::Fkey[i].string = C_STR(CSI "253z"); // keypad plus sign
|
fc::fkey[i].string = C_STR(CSI "253z"); // keypad plus sign
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace finalcut
|
||||||
{
|
{
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
FTermDetection::terminalType FTermDetection::terminal_type{};
|
FTermDetection::FTerminalType FTermDetection::terminal_type{};
|
||||||
FTermDetection::colorEnv FTermDetection::color_env{};
|
FTermDetection::colorEnv FTermDetection::color_env{};
|
||||||
FTermDetection::secondaryDA FTermDetection::secondary_da{};
|
FTermDetection::secondaryDA FTermDetection::secondary_da{};
|
||||||
FTermData* FTermDetection::fterm_data{nullptr};
|
FTermData* FTermDetection::fterm_data{nullptr};
|
||||||
|
|
|
@ -114,7 +114,7 @@ void FTermLinux::setUTF8 (bool enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
bool FTermLinux::setPalette (FColor index, int r, int g, int b)
|
bool FTermLinux::setPalette (FColor index, int r, int g, int b)
|
||||||
{
|
{
|
||||||
if ( ! FTerm::isLinuxTerm() )
|
if ( ! FTerm::isLinuxTerm() )
|
||||||
|
@ -174,7 +174,7 @@ void FTermLinux::init()
|
||||||
getUnicodeMap();
|
getUnicodeMap();
|
||||||
getScreenFont();
|
getScreenFont();
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
// Enable 16 background colors
|
// Enable 16 background colors
|
||||||
if ( setBlinkAsIntensity(true) == 0 )
|
if ( setBlinkAsIntensity(true) == 0 )
|
||||||
FTermcap::max_color = 16;
|
FTermcap::max_color = 16;
|
||||||
|
@ -246,7 +246,7 @@ void FTermLinux::finish()
|
||||||
{
|
{
|
||||||
if ( FTerm::isLinuxTerm() )
|
if ( FTerm::isLinuxTerm() )
|
||||||
{
|
{
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
setBlinkAsIntensity (false);
|
setBlinkAsIntensity (false);
|
||||||
#endif
|
#endif
|
||||||
setLinuxCursorStyle (fc::default_cursor);
|
setLinuxCursorStyle (fc::default_cursor);
|
||||||
|
@ -383,7 +383,7 @@ bool FTermLinux::saveColorMap()
|
||||||
if ( ! FTerm::isLinuxTerm() )
|
if ( ! FTerm::isLinuxTerm() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
return saveVGAPalette();
|
return saveVGAPalette();
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
@ -396,7 +396,7 @@ bool FTermLinux::resetColorMap()
|
||||||
if ( ! FTerm::isLinuxTerm() )
|
if ( ! FTerm::isLinuxTerm() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
return resetVGAPalette();
|
return resetVGAPalette();
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
@ -752,7 +752,7 @@ void FTermLinux::setLinuxCursorStyle (CursorStyle style)
|
||||||
FTerm::putstringf (CSI "?%dc", style);
|
FTerm::putstringf (CSI "?%dc", style);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline uInt16 FTermLinux::getInputStatusRegisterOne()
|
inline uInt16 FTermLinux::getInputStatusRegisterOne()
|
||||||
{
|
{
|
||||||
|
@ -956,7 +956,7 @@ bool FTermLinux::resetVGAPalette()
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FKey FTermLinux::shiftKeyCorrection (const FKey& key_id)
|
FKey FTermLinux::shiftKeyCorrection (const FKey& key_id)
|
||||||
|
|
|
@ -39,6 +39,11 @@ namespace finalcut
|
||||||
// class FTermOpenBSD
|
// class FTermOpenBSD
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
// constructors and destructor
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
FTermOpenBSD::~FTermOpenBSD() // destructor
|
||||||
|
{ }
|
||||||
|
|
||||||
// public methods of FTermOpenBSD
|
// public methods of FTermOpenBSD
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
|
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
|
||||||
|
|
|
@ -614,7 +614,7 @@ void FTextView::draw()
|
||||||
|
|
||||||
setCursorPos (FPoint(int(getWidth()), int(getHeight())));
|
setCursorPos (FPoint(int(getWidth()), int(getHeight())));
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -235,7 +235,7 @@ void FToggleButton::onMouseDown (FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ void FToggleButton::onAccel (FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
getStatusBar()->drawMessage();
|
getStatusBar()->drawMessage();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
processClick();
|
processClick();
|
||||||
|
|
506
src/fvterm.cpp
506
src/fvterm.cpp
File diff suppressed because it is too large
Load Diff
467
src/fwidget.cpp
467
src/fwidget.cpp
|
@ -772,8 +772,8 @@ FWidget* FWidget::childWidgetAt (const FPoint& pos)
|
||||||
&& ! widget->isWindowWidget()
|
&& ! widget->isWindowWidget()
|
||||||
&& widget->getTermGeometry().contains(pos) )
|
&& widget->getTermGeometry().contains(pos) )
|
||||||
{
|
{
|
||||||
auto child = widget->childWidgetAt(pos);
|
auto sub_child = widget->childWidgetAt(pos);
|
||||||
return ( child != 0 ) ? child : widget;
|
return ( sub_child != 0 ) ? sub_child : widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -837,7 +837,7 @@ void FWidget::addCallback ( const FString& cb_signal
|
||||||
{
|
{
|
||||||
// Add a (normal) function pointer as callback
|
// Add a (normal) function pointer as callback
|
||||||
|
|
||||||
callback_data obj{ cb_signal, nullptr, cb_function, data };
|
FCallbackData obj{ cb_signal, nullptr, cb_function, data };
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,7 +849,7 @@ void FWidget::addCallback ( const FString& cb_signal
|
||||||
{
|
{
|
||||||
// Add a member function pointer as callback
|
// Add a member function pointer as callback
|
||||||
|
|
||||||
callback_data obj{ cb_signal, cb_instance, cb_function, data };
|
FCallbackData obj{ cb_signal, cb_instance, cb_function, data };
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,7 +924,7 @@ void FWidget::addAccelerator (FKey key, FWidget* obj)
|
||||||
// Adding a keyboard accelerator for the given widget
|
// Adding a keyboard accelerator for the given widget
|
||||||
|
|
||||||
auto widget = static_cast<FWidget*>(FWindow::getWindowWidget(obj));
|
auto widget = static_cast<FWidget*>(FWindow::getWindowWidget(obj));
|
||||||
accelerator accel = { key, obj };
|
FAccelerator accel = { key, obj };
|
||||||
|
|
||||||
if ( ! widget || widget == statusbar || widget == menubar )
|
if ( ! widget || widget == statusbar || widget == menubar )
|
||||||
widget = getRootWidget();
|
widget = getRootWidget();
|
||||||
|
@ -990,7 +990,7 @@ void FWidget::redraw()
|
||||||
if ( redraw_root_widget == this )
|
if ( redraw_root_widget == this )
|
||||||
{
|
{
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
redraw_root_widget = nullptr;
|
redraw_root_widget = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1070,7 +1070,7 @@ void FWidget::show()
|
||||||
{
|
{
|
||||||
finishTerminalUpdate();
|
finishTerminalUpdate();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
show_root_widget = nullptr;
|
show_root_widget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1201,7 +1201,7 @@ void FWidget::quit()
|
||||||
|
|
||||||
// protected methods of FWidget
|
// protected methods of FWidget
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FVTerm::term_area* FWidget::getPrintArea()
|
FVTerm::FTermArea* FWidget::getPrintArea()
|
||||||
{
|
{
|
||||||
// returns the print area of this object
|
// returns the print area of this object
|
||||||
|
|
||||||
|
@ -1236,7 +1236,7 @@ FVTerm::term_area* FWidget::getPrintArea()
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FWidget::addPreprocessingHandler ( FVTerm* instance
|
void FWidget::addPreprocessingHandler ( FVTerm* instance
|
||||||
, FVTermPreprocessing function )
|
, FPreprocessingFunction function )
|
||||||
{
|
{
|
||||||
if ( ! getCurrentPrintArea() )
|
if ( ! getCurrentPrintArea() )
|
||||||
FWidget::getPrintArea();
|
FWidget::getPrintArea();
|
||||||
|
@ -1390,7 +1390,7 @@ void FWidget::hideArea (const FSize& size)
|
||||||
print() << FPoint(1, 1 + y) << FString(size.getWidth(), L' ');
|
print() << FPoint(1, 1 + y) << FString(size.getWidth(), L' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1400,7 +1400,7 @@ void FWidget::createWidgetAcceleratorList()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
accelerator_list = new Accelerators();
|
accelerator_list = new FAcceleratorList();
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc& ex)
|
catch (const std::bad_alloc& ex)
|
||||||
{
|
{
|
||||||
|
@ -1911,7 +1911,7 @@ bool FWidget::changeFocus ( FWidget* follower, FWidget* parent
|
||||||
redraw();
|
redraw();
|
||||||
follower->redraw();
|
follower->redraw();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flushOutputBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1926,8 +1926,8 @@ void FWidget::draw()
|
||||||
void FWidget::drawWindows()
|
void FWidget::drawWindows()
|
||||||
{
|
{
|
||||||
// redraw windows
|
// redraw windows
|
||||||
charData default_char{};
|
FChar default_char{};
|
||||||
default_char.code = ' ';
|
default_char.ch = ' ';
|
||||||
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.attr.byte[0] = 0;
|
default_char.attr.byte[0] = 0;
|
||||||
|
@ -1940,10 +1940,10 @@ void FWidget::drawWindows()
|
||||||
{
|
{
|
||||||
if ( window->isShown() )
|
if ( window->isShown() )
|
||||||
{
|
{
|
||||||
auto win = window->getVWin();
|
auto v_win = window->getVWin();
|
||||||
int w = win->width + win->right_shadow;
|
int w = v_win->width + v_win->right_shadow;
|
||||||
int h = win->height + win->bottom_shadow;
|
int h = v_win->height + v_win->bottom_shadow;
|
||||||
std::fill_n (win->text, w * h, default_char);
|
std::fill_n (v_win->data, w * h, default_char);
|
||||||
window->redraw();
|
window->redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1997,435 +1997,4 @@ void detectTermSize()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
FKey getHotkey (const FString& text)
|
|
||||||
{
|
|
||||||
// Returns the hotkey character from a string
|
|
||||||
// e.g. "E&xit" returns 'x'
|
|
||||||
|
|
||||||
if ( text.isEmpty() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
std::size_t length = text.getLength();
|
|
||||||
|
|
||||||
for (std::size_t i{0}; i < length; i++)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( i + 1 < length && text[i] == '&' )
|
|
||||||
return FKey(text[++i]);
|
|
||||||
}
|
|
||||||
catch (const std::out_of_range&)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
std::size_t getHotkeyPos (const FString& src, FString& dest)
|
|
||||||
{
|
|
||||||
// Find hotkey position in string
|
|
||||||
// + generate a new string without the '&'-sign
|
|
||||||
|
|
||||||
constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1);
|
|
||||||
std::size_t hotkeypos{NOT_SET};
|
|
||||||
std::size_t i{0};
|
|
||||||
|
|
||||||
for (auto&& ch : src)
|
|
||||||
{
|
|
||||||
if ( ch == L'&' && hotkeypos == NOT_SET && src.getLength() != i + 1 )
|
|
||||||
hotkeypos = i;
|
|
||||||
else
|
|
||||||
dest += ch;
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hotkeypos;
|
|
||||||
}
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void setHotkeyViaString (FWidget* w, const FString& text)
|
|
||||||
{
|
|
||||||
// Set hotkey accelerator via string
|
|
||||||
|
|
||||||
if ( ! w )
|
|
||||||
return;
|
|
||||||
|
|
||||||
FKey hotkey = getHotkey(text);
|
|
||||||
|
|
||||||
if ( hotkey > 0xff00 && hotkey < 0xff5f ) // full-width character
|
|
||||||
hotkey -= 0xfee0;
|
|
||||||
|
|
||||||
if ( hotkey )
|
|
||||||
{
|
|
||||||
if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
|
|
||||||
{
|
|
||||||
w->addAccelerator (FKey(std::tolower(int(hotkey))));
|
|
||||||
w->addAccelerator (FKey(std::toupper(int(hotkey))));
|
|
||||||
// Meta + hotkey
|
|
||||||
w->addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
w->addAccelerator (hotkey);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
w->delAccelerator();
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void drawShadow (FWidget* w)
|
|
||||||
{
|
|
||||||
if ( w->isMonochron() && ! w->flags.trans_shadow )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( (w->getEncoding() == fc::VT100 && ! w->flags.trans_shadow)
|
|
||||||
|| (w->getEncoding() == fc::ASCII && ! w->flags.trans_shadow) )
|
|
||||||
{
|
|
||||||
clearShadow(w);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int x1 = 1;
|
|
||||||
int x2 = int(w->getWidth());
|
|
||||||
int y1 = 1;
|
|
||||||
int y2 = int(w->getHeight());
|
|
||||||
|
|
||||||
if ( w->flags.trans_shadow )
|
|
||||||
{
|
|
||||||
// transparent shadow
|
|
||||||
drawTransparentShadow (w, x1, y1, x2, y2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// non-transparent shadow
|
|
||||||
drawBlockShadow (w, x1, y1, x2, y2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void drawTransparentShadow (FWidget* w, int x1, int y1, int x2, int y2)
|
|
||||||
{
|
|
||||||
// transparent shadow
|
|
||||||
|
|
||||||
w->setTransparent();
|
|
||||||
w->print() << FPoint(x2 + 1, y1) << " ";
|
|
||||||
w->unsetTransparent();
|
|
||||||
w->setColor (w->wcolors.shadow_bg, w->wcolors.shadow_fg);
|
|
||||||
w->setTransShadow();
|
|
||||||
|
|
||||||
for (std::size_t y{1}; y < w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(x2 + 1, y1 + int(y)) << " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
w->unsetTransShadow();
|
|
||||||
w->setTransparent();
|
|
||||||
w->print() << FPoint(x1, y2 + 1) << " ";
|
|
||||||
w->unsetTransparent();
|
|
||||||
w->setColor (w->wcolors.shadow_bg, w->wcolors.shadow_fg);
|
|
||||||
w->setTransShadow();
|
|
||||||
|
|
||||||
for (std::size_t x{2}; x <= w->getWidth() + 1; x++)
|
|
||||||
w->print (' ');
|
|
||||||
|
|
||||||
w->unsetTransShadow();
|
|
||||||
|
|
||||||
if ( w->isMonochron() )
|
|
||||||
w->setReverse(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void drawBlockShadow (FWidget* w, int x1, int y1, int x2, int y2)
|
|
||||||
{
|
|
||||||
// non-transparent shadow
|
|
||||||
|
|
||||||
if ( ! w->hasShadowCharacter() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
w->print() << FPoint(x2 + 1, y1);
|
|
||||||
|
|
||||||
if ( w->isWindowWidget() )
|
|
||||||
{
|
|
||||||
w->setColor (w->wcolors.shadow_fg, w->wcolors.shadow_bg);
|
|
||||||
w->setInheritBackground(); // current background color will be ignored
|
|
||||||
}
|
|
||||||
else if ( auto p = w->getParentWidget() )
|
|
||||||
w->setColor (w->wcolors.shadow_fg, p->getBackgroundColor());
|
|
||||||
|
|
||||||
w->print (fc::LowerHalfBlock); // ▄
|
|
||||||
|
|
||||||
if ( w->isWindowWidget() )
|
|
||||||
w->unsetInheritBackground();
|
|
||||||
|
|
||||||
for (std::size_t y{1}; y < w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(x2 + 1, y1 + int(y)) << fc::FullBlock; // █
|
|
||||||
}
|
|
||||||
|
|
||||||
w->print() << FPoint(x1 + 1, y2 + 1);
|
|
||||||
|
|
||||||
if ( w->isWindowWidget() )
|
|
||||||
w->setInheritBackground();
|
|
||||||
|
|
||||||
for (std::size_t x{1}; x <= w->getWidth(); x++)
|
|
||||||
w->print (fc::UpperHalfBlock); // ▀
|
|
||||||
|
|
||||||
if ( w->isWindowWidget() )
|
|
||||||
w->unsetInheritBackground();
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void clearShadow (FWidget* w)
|
|
||||||
{
|
|
||||||
if ( w->isMonochron() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
int width = int(w->getWidth());
|
|
||||||
int height = int(w->getHeight());
|
|
||||||
|
|
||||||
if ( w->isWindowWidget() )
|
|
||||||
{
|
|
||||||
w->setColor (w->wcolors.shadow_fg, w->wcolors.shadow_bg);
|
|
||||||
w->setInheritBackground(); // current background color will be ignored
|
|
||||||
}
|
|
||||||
else if ( auto p = w->getParentWidget() )
|
|
||||||
w->setColor (w->wcolors.shadow_fg, p->getBackgroundColor());
|
|
||||||
|
|
||||||
if ( width <= w->woffset.getX2() )
|
|
||||||
{
|
|
||||||
for (std::size_t y{1}; y <= w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(width + 1, int(y)) << ' '; // clear █
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( height <= w->woffset.getY2() )
|
|
||||||
{
|
|
||||||
w->print() << FPoint(2, height + 1);
|
|
||||||
|
|
||||||
for (std::size_t i{1}; i <= w->getWidth(); i++)
|
|
||||||
w->print (' '); // clear ▀
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( w->isWindowWidget() )
|
|
||||||
w->unsetInheritBackground();
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void drawFlatBorder (FWidget* w)
|
|
||||||
{
|
|
||||||
if ( ! w->isNewFont() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
int x1 = 1;
|
|
||||||
int x2 = int(w->getWidth() + 1);
|
|
||||||
int y1 = 0;
|
|
||||||
int y2 = int(w->getHeight() + 1);
|
|
||||||
|
|
||||||
if ( auto p = w->getParentWidget() )
|
|
||||||
w->setColor (w->wcolors.dialog_fg, p->getBackgroundColor());
|
|
||||||
else
|
|
||||||
w->setColor (w->wcolors.dialog_fg, w->wcolors.dialog_bg);
|
|
||||||
|
|
||||||
for (std::size_t y{0}; y < w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(x1 - 1, y1 + int(y) + 1);
|
|
||||||
|
|
||||||
if ( w->double_flatline_mask.left[uLong(y)] )
|
|
||||||
// left+right line (on left side)
|
|
||||||
w->print (fc::NF_rev_border_line_right_and_left);
|
|
||||||
else
|
|
||||||
// right line (on left side)
|
|
||||||
w->print (fc::NF_rev_border_line_right);
|
|
||||||
}
|
|
||||||
|
|
||||||
w->print() << FPoint(x2, y1 + 1);
|
|
||||||
|
|
||||||
for (std::size_t y{0}; y < w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
if ( w->double_flatline_mask.right[y] )
|
|
||||||
// left+right line (on right side)
|
|
||||||
w->print (fc::NF_rev_border_line_right_and_left);
|
|
||||||
else
|
|
||||||
// left line (on right side)
|
|
||||||
w->print (fc::NF_border_line_left);
|
|
||||||
|
|
||||||
w->print() << FPoint(x2, y1 + int(y) + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
w->print() << FPoint(x1, y1);
|
|
||||||
|
|
||||||
for (std::size_t x{0}; x < w->getWidth(); x++)
|
|
||||||
{
|
|
||||||
if ( w->double_flatline_mask.top[x] )
|
|
||||||
// top+bottom line (at top)
|
|
||||||
w->print (fc::NF_border_line_up_and_down);
|
|
||||||
else
|
|
||||||
// bottom line (at top)
|
|
||||||
w->print (fc::NF_border_line_bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
w->print() << FPoint(x1, y2);
|
|
||||||
|
|
||||||
for (std::size_t x{0}; x < w->getWidth(); x++)
|
|
||||||
{
|
|
||||||
if ( w->double_flatline_mask.bottom[x] )
|
|
||||||
// top+bottom line (at bottom)
|
|
||||||
w->print (fc::NF_border_line_up_and_down);
|
|
||||||
else
|
|
||||||
// top line (at bottom)
|
|
||||||
w->print (fc::NF_border_line_upper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void clearFlatBorder (FWidget* w)
|
|
||||||
{
|
|
||||||
if ( ! w->isNewFont() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
int x1 = 1;
|
|
||||||
int x2 = int(w->getWidth() + 1);
|
|
||||||
int y1 = 0;
|
|
||||||
int y2 = int(w->getHeight() + 1);
|
|
||||||
|
|
||||||
if ( auto p = w->getParentWidget() )
|
|
||||||
w->setColor (w->wcolors.dialog_fg, p->getBackgroundColor());
|
|
||||||
else
|
|
||||||
w->setColor (w->wcolors.dialog_fg, w->wcolors.dialog_bg);
|
|
||||||
|
|
||||||
// clear on left side
|
|
||||||
for (std::size_t y{0}; y < w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(x1 - 1, y1 + int(y) + 1);
|
|
||||||
|
|
||||||
if ( w->double_flatline_mask.left[y] )
|
|
||||||
w->print (fc::NF_border_line_left);
|
|
||||||
else
|
|
||||||
w->print (' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear on right side
|
|
||||||
for (std::size_t y{0}; y < w->getHeight(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(x2, y1 + int(y) + 1);
|
|
||||||
|
|
||||||
if ( w->double_flatline_mask.right[y] )
|
|
||||||
w->print (fc::NF_rev_border_line_right);
|
|
||||||
else
|
|
||||||
w->print (' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear at top
|
|
||||||
w->print() << FPoint(x1, y1);
|
|
||||||
|
|
||||||
for (std::size_t x{0}; x < w->getWidth(); x++)
|
|
||||||
{
|
|
||||||
if ( w->double_flatline_mask.top[x] )
|
|
||||||
w->print (fc::NF_border_line_upper);
|
|
||||||
else
|
|
||||||
w->print (' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear at bottom
|
|
||||||
w->print() << FPoint(x1, y2);
|
|
||||||
|
|
||||||
for (std::size_t x{0}; x < w->getWidth(); x++)
|
|
||||||
{
|
|
||||||
if ( w->double_flatline_mask.bottom[x] )
|
|
||||||
w->print (fc::NF_border_line_bottom);
|
|
||||||
else
|
|
||||||
w->print (' ');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline void drawBox (FWidget* w, const FRect& r)
|
|
||||||
{
|
|
||||||
// Use box-drawing characters to draw a border
|
|
||||||
|
|
||||||
if ( ! w )
|
|
||||||
return;
|
|
||||||
|
|
||||||
w->print() << r.getUpperLeftPos() << fc::BoxDrawingsDownAndRight; // ┌
|
|
||||||
|
|
||||||
for (int x = r.getX1() + 1; x < r.getX2(); x++)
|
|
||||||
w->print (fc::BoxDrawingsHorizontal); // ─
|
|
||||||
|
|
||||||
w->print (fc::BoxDrawingsDownAndLeft); // ┐
|
|
||||||
|
|
||||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(r.getX1(), y)
|
|
||||||
<< fc::BoxDrawingsVertical // │
|
|
||||||
<< FPoint(r.getX2(), y)
|
|
||||||
<< fc::BoxDrawingsVertical; // │
|
|
||||||
}
|
|
||||||
|
|
||||||
w->print() << r.getLowerLeftPos() << fc::BoxDrawingsUpAndRight; // └
|
|
||||||
|
|
||||||
for (int x = r.getX1() + 1; x < r.getX2(); x++)
|
|
||||||
w->print (fc::BoxDrawingsHorizontal); // ─
|
|
||||||
|
|
||||||
w->print (fc::BoxDrawingsUpAndLeft); // ┘
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline void drawNewFontBox (FWidget* w, const FRect& r)
|
|
||||||
{
|
|
||||||
// Use new graphical font characters to draw a border
|
|
||||||
|
|
||||||
w->print() << r.getUpperLeftPos()
|
|
||||||
<< fc::NF_border_corner_middle_upper_left; // ┌
|
|
||||||
for (int x = r.getX1() + 1; x < r.getX2(); x++)
|
|
||||||
w->print (fc::BoxDrawingsHorizontal); // ─
|
|
||||||
|
|
||||||
w->print (fc::NF_border_corner_middle_upper_right); // ┐
|
|
||||||
|
|
||||||
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
|
||||||
{
|
|
||||||
w->print() << FPoint(r.getX1(), y)
|
|
||||||
<< fc::NF_border_line_left // border left ⎸
|
|
||||||
<< FPoint(r.getX2(), y)
|
|
||||||
<< fc::NF_rev_border_line_right; // border right⎹
|
|
||||||
}
|
|
||||||
|
|
||||||
w->print() << r.getLowerLeftPos()
|
|
||||||
<< fc::NF_border_corner_middle_lower_left; // └
|
|
||||||
|
|
||||||
for (int x = r.getX1() + 1; x < r.getX2(); x++)
|
|
||||||
w->print (fc::BoxDrawingsHorizontal); // ─
|
|
||||||
|
|
||||||
w->print (fc::NF_border_corner_middle_lower_right); // ┘
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void drawBorder (FWidget* w, FRect r)
|
|
||||||
{
|
|
||||||
if ( r.x1_ref() > r.x2_ref() )
|
|
||||||
std::swap (r.x1_ref(), r.x2_ref());
|
|
||||||
|
|
||||||
if ( r.y1_ref() > r.y2_ref() )
|
|
||||||
std::swap (r.y1_ref(), r.y2_ref());
|
|
||||||
|
|
||||||
if ( r.x1_ref() < 1 )
|
|
||||||
r.x1_ref() = 1;
|
|
||||||
|
|
||||||
if ( r.y1_ref() < 1 )
|
|
||||||
r.y1_ref() = 1;
|
|
||||||
|
|
||||||
if ( r.x2_ref() > int(w->getWidth()) )
|
|
||||||
r.x2_ref() = int(w->getWidth());
|
|
||||||
|
|
||||||
if ( r.y2_ref() > int(w->getHeight()) )
|
|
||||||
r.y2_ref() = int(w->getHeight());
|
|
||||||
|
|
||||||
if ( w->isNewFont() )
|
|
||||||
drawNewFontBox (w, r);
|
|
||||||
else
|
|
||||||
drawBox (w, r);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
|
@ -0,0 +1,428 @@
|
||||||
|
/***********************************************************************
|
||||||
|
* fwidget_functions.cpp - FWidget helper functions *
|
||||||
|
* *
|
||||||
|
* This file is part of the Final Cut widget toolkit *
|
||||||
|
* *
|
||||||
|
* Copyright 2019 Markus Gans *
|
||||||
|
* *
|
||||||
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
* as published by the Free Software Foundation; either version 3 of *
|
||||||
|
* the License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* The Final Cut is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU Lesser General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU Lesser General Public *
|
||||||
|
* License along with this program. If not, see *
|
||||||
|
* <http://www.gnu.org/licenses/>. *
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include "final/fwidget.h"
|
||||||
|
#include "final/fwidgetcolors.h"
|
||||||
|
|
||||||
|
namespace finalcut
|
||||||
|
{
|
||||||
|
|
||||||
|
// FWidget non-member functions
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
FKey getHotkey (const FString& text)
|
||||||
|
{
|
||||||
|
// Returns the hotkey character from a string
|
||||||
|
// e.g. "E&xit" returns 'x'
|
||||||
|
|
||||||
|
if ( text.isEmpty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
std::size_t length = text.getLength();
|
||||||
|
|
||||||
|
for (std::size_t i{0}; i < length; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ( i + 1 < length && text[i] == '&' )
|
||||||
|
return FKey(text[++i]);
|
||||||
|
}
|
||||||
|
catch (const std::out_of_range&)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
std::size_t getHotkeyPos (const FString& src, FString& dest)
|
||||||
|
{
|
||||||
|
// Find hotkey position in string
|
||||||
|
// + generate a new string without the '&'-sign
|
||||||
|
|
||||||
|
constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1);
|
||||||
|
std::size_t hotkeypos{NOT_SET};
|
||||||
|
std::size_t i{0};
|
||||||
|
|
||||||
|
for (auto&& ch : src)
|
||||||
|
{
|
||||||
|
if ( ch == L'&' && hotkeypos == NOT_SET && src.getLength() != i + 1 )
|
||||||
|
hotkeypos = i;
|
||||||
|
else
|
||||||
|
dest += ch;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hotkeypos;
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void setHotkeyViaString (FWidget* w, const FString& text)
|
||||||
|
{
|
||||||
|
// Set hotkey accelerator via string
|
||||||
|
|
||||||
|
if ( ! w )
|
||||||
|
return;
|
||||||
|
|
||||||
|
FKey hotkey = getHotkey(text);
|
||||||
|
|
||||||
|
if ( hotkey > 0xff00 && hotkey < 0xff5f ) // full-width character
|
||||||
|
hotkey -= 0xfee0;
|
||||||
|
|
||||||
|
if ( hotkey )
|
||||||
|
{
|
||||||
|
if ( std::isalpha(int(hotkey)) || std::isdigit(int(hotkey)) )
|
||||||
|
{
|
||||||
|
w->addAccelerator (FKey(std::tolower(int(hotkey))));
|
||||||
|
w->addAccelerator (FKey(std::toupper(int(hotkey))));
|
||||||
|
// Meta + hotkey
|
||||||
|
w->addAccelerator (fc::Fmkey_meta + FKey(std::tolower(int(hotkey))));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
w->addAccelerator (hotkey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
w->delAccelerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void drawShadow (FWidget* w)
|
||||||
|
{
|
||||||
|
if ( w->isMonochron() && ! w->flags.trans_shadow )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( (w->getEncoding() == fc::VT100 && ! w->flags.trans_shadow)
|
||||||
|
|| (w->getEncoding() == fc::ASCII && ! w->flags.trans_shadow) )
|
||||||
|
{
|
||||||
|
clearShadow(w);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( w->flags.trans_shadow )
|
||||||
|
drawTransparentShadow (w); // transparent shadow
|
||||||
|
else
|
||||||
|
drawBlockShadow (w); // non-transparent shadow
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void drawTransparentShadow (FWidget* w)
|
||||||
|
{
|
||||||
|
// transparent shadow
|
||||||
|
|
||||||
|
std::size_t width = w->getWidth();
|
||||||
|
std::size_t height = w->getHeight();
|
||||||
|
w->setTransparent();
|
||||||
|
w->print() << FPoint(int(width) + 1, 1) << " ";
|
||||||
|
w->unsetTransparent();
|
||||||
|
w->setColor (w->wcolors.shadow_bg, w->wcolors.shadow_fg);
|
||||||
|
w->setTransShadow();
|
||||||
|
|
||||||
|
for (std::size_t y{1}; y < height; y++)
|
||||||
|
{
|
||||||
|
w->print() << FPoint(int(width) + 1, int(y) + 1) << " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
w->unsetTransShadow();
|
||||||
|
w->setTransparent();
|
||||||
|
w->print() << FPoint(1, int(height) + 1) << " ";
|
||||||
|
w->unsetTransparent();
|
||||||
|
w->setColor (w->wcolors.shadow_bg, w->wcolors.shadow_fg);
|
||||||
|
w->setTransShadow();
|
||||||
|
w->print() << FString(width, L' ');
|
||||||
|
|
||||||
|
w->unsetTransShadow();
|
||||||
|
|
||||||
|
if ( w->isMonochron() )
|
||||||
|
w->setReverse(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void drawBlockShadow (FWidget* w)
|
||||||
|
{
|
||||||
|
// non-transparent shadow
|
||||||
|
|
||||||
|
if ( ! w->hasShadowCharacter() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::size_t width = w->getWidth();
|
||||||
|
std::size_t height = w->getHeight();
|
||||||
|
w->print() << FPoint(int(width) + 1, 1);
|
||||||
|
|
||||||
|
if ( w->isWindowWidget() )
|
||||||
|
{
|
||||||
|
w->setColor (w->wcolors.shadow_fg, w->wcolors.shadow_bg);
|
||||||
|
w->setInheritBackground(); // current background color will be ignored
|
||||||
|
}
|
||||||
|
else if ( auto p = w->getParentWidget() )
|
||||||
|
w->setColor (w->wcolors.shadow_fg, p->getBackgroundColor());
|
||||||
|
|
||||||
|
w->print (fc::LowerHalfBlock); // ▄
|
||||||
|
|
||||||
|
if ( w->isWindowWidget() )
|
||||||
|
w->unsetInheritBackground();
|
||||||
|
|
||||||
|
for (std::size_t y{1}; y < height; y++)
|
||||||
|
{
|
||||||
|
w->print() << FPoint(int(width) + 1, int(y) + 1) << fc::FullBlock; // █
|
||||||
|
}
|
||||||
|
|
||||||
|
w->print() << FPoint(2, int(height) + 1);
|
||||||
|
|
||||||
|
if ( w->isWindowWidget() )
|
||||||
|
w->setInheritBackground();
|
||||||
|
|
||||||
|
w->print() << FString(width, fc::UpperHalfBlock); // ▀
|
||||||
|
|
||||||
|
if ( w->isWindowWidget() )
|
||||||
|
w->unsetInheritBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void clearShadow (FWidget* w)
|
||||||
|
{
|
||||||
|
if ( w->isMonochron() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::size_t width = w->getWidth();
|
||||||
|
std::size_t height = w->getHeight();
|
||||||
|
|
||||||
|
if ( w->isWindowWidget() )
|
||||||
|
{
|
||||||
|
w->setColor (w->wcolors.shadow_fg, w->wcolors.shadow_bg);
|
||||||
|
w->setInheritBackground(); // current background color will be ignored
|
||||||
|
}
|
||||||
|
else if ( auto p = w->getParentWidget() )
|
||||||
|
w->setColor (w->wcolors.shadow_fg, p->getBackgroundColor());
|
||||||
|
|
||||||
|
if ( int(width) <= w->woffset.getX2() )
|
||||||
|
{
|
||||||
|
for (std::size_t y{1}; y <= height; y++)
|
||||||
|
{
|
||||||
|
w->print() << FPoint(int(width) + 1, int(y)) << ' '; // clear █
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( int(height) <= w->woffset.getY2() )
|
||||||
|
{
|
||||||
|
w->print() << FPoint(2, int(height) + 1)
|
||||||
|
<< FString(width, L' '); // clear ▀
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( w->isWindowWidget() )
|
||||||
|
w->unsetInheritBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void drawFlatBorder (FWidget* w)
|
||||||
|
{
|
||||||
|
if ( ! w->isNewFont() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( auto p = w->getParentWidget() )
|
||||||
|
w->setColor (w->wcolors.dialog_fg, p->getBackgroundColor());
|
||||||
|
else
|
||||||
|
w->setColor (w->wcolors.dialog_fg, w->wcolors.dialog_bg);
|
||||||
|
|
||||||
|
std::size_t width = w->getWidth();
|
||||||
|
std::size_t height = w->getHeight();
|
||||||
|
|
||||||
|
for (std::size_t y{0}; y < height; y++)
|
||||||
|
{
|
||||||
|
w->print() << FPoint(0, int(y) + 1);
|
||||||
|
|
||||||
|
if ( w->double_flatline_mask.left[uLong(y)] )
|
||||||
|
// left+right line (on left side)
|
||||||
|
w->print (fc::NF_rev_border_line_right_and_left);
|
||||||
|
else
|
||||||
|
// right line (on left side)
|
||||||
|
w->print (fc::NF_rev_border_line_right);
|
||||||
|
|
||||||
|
w->print() << FPoint(int(width) + 1, int(y) + 1);
|
||||||
|
|
||||||
|
if ( w->double_flatline_mask.right[y] )
|
||||||
|
// left+right line (on right side)
|
||||||
|
w->print (fc::NF_rev_border_line_right_and_left);
|
||||||
|
else
|
||||||
|
// left line (on right side)
|
||||||
|
w->print (fc::NF_border_line_left);
|
||||||
|
}
|
||||||
|
|
||||||
|
w->print() << FPoint(1, 0);
|
||||||
|
|
||||||
|
for (std::size_t x{0}; x < width; x++)
|
||||||
|
{
|
||||||
|
if ( w->double_flatline_mask.top[x] )
|
||||||
|
// top+bottom line (at top)
|
||||||
|
w->print (fc::NF_border_line_up_and_down);
|
||||||
|
else
|
||||||
|
// bottom line (at top)
|
||||||
|
w->print (fc::NF_border_line_bottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
w->print() << FPoint(1, int(height) + 1);
|
||||||
|
|
||||||
|
for (std::size_t x{0}; x < width; x++)
|
||||||
|
{
|
||||||
|
if ( w->double_flatline_mask.bottom[x] )
|
||||||
|
// top+bottom line (at bottom)
|
||||||
|
w->print (fc::NF_border_line_up_and_down);
|
||||||
|
else
|
||||||
|
// top line (at bottom)
|
||||||
|
w->print (fc::NF_border_line_upper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void clearFlatBorder (FWidget* w)
|
||||||
|
{
|
||||||
|
if ( ! w->isNewFont() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( auto p = w->getParentWidget() )
|
||||||
|
w->setColor (w->wcolors.dialog_fg, p->getBackgroundColor());
|
||||||
|
else
|
||||||
|
w->setColor (w->wcolors.dialog_fg, w->wcolors.dialog_bg);
|
||||||
|
|
||||||
|
std::size_t width = w->getWidth();
|
||||||
|
std::size_t height = w->getHeight();
|
||||||
|
|
||||||
|
for (std::size_t y{0}; y < height; y++)
|
||||||
|
{
|
||||||
|
// clear on left side
|
||||||
|
w->print() << FPoint(0, int(y) + 1);
|
||||||
|
|
||||||
|
if ( w->double_flatline_mask.left[y] )
|
||||||
|
w->print (fc::NF_border_line_left);
|
||||||
|
else
|
||||||
|
w->print (' ');
|
||||||
|
|
||||||
|
// clear on right side
|
||||||
|
w->print() << FPoint(int(width) + 1, int(y) + 1);
|
||||||
|
|
||||||
|
if ( w->double_flatline_mask.right[y] )
|
||||||
|
w->print (fc::NF_rev_border_line_right);
|
||||||
|
else
|
||||||
|
w->print (' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear at top
|
||||||
|
w->print() << FPoint(1, 0);
|
||||||
|
|
||||||
|
for (std::size_t x{0}; x < width; x++)
|
||||||
|
{
|
||||||
|
if ( w->double_flatline_mask.top[x] )
|
||||||
|
w->print (fc::NF_border_line_upper);
|
||||||
|
else
|
||||||
|
w->print (' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear at bottom
|
||||||
|
w->print() << FPoint(1, int(height) + 1);
|
||||||
|
|
||||||
|
for (std::size_t x{0}; x < width; x++)
|
||||||
|
{
|
||||||
|
if ( w->double_flatline_mask.bottom[x] )
|
||||||
|
w->print (fc::NF_border_line_bottom);
|
||||||
|
else
|
||||||
|
w->print (' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void drawBorder (FWidget* w, FRect r)
|
||||||
|
{
|
||||||
|
if ( r.x1_ref() > r.x2_ref() )
|
||||||
|
std::swap (r.x1_ref(), r.x2_ref());
|
||||||
|
|
||||||
|
if ( r.y1_ref() > r.y2_ref() )
|
||||||
|
std::swap (r.y1_ref(), r.y2_ref());
|
||||||
|
|
||||||
|
if ( r.x1_ref() < 1 )
|
||||||
|
r.x1_ref() = 1;
|
||||||
|
|
||||||
|
if ( r.y1_ref() < 1 )
|
||||||
|
r.y1_ref() = 1;
|
||||||
|
|
||||||
|
if ( r.x2_ref() > int(w->getWidth()) )
|
||||||
|
r.x2_ref() = int(w->getWidth());
|
||||||
|
|
||||||
|
if ( r.y2_ref() > int(w->getHeight()) )
|
||||||
|
r.y2_ref() = int(w->getHeight());
|
||||||
|
|
||||||
|
if ( w->isNewFont() )
|
||||||
|
drawNewFontBox (w, r);
|
||||||
|
else
|
||||||
|
drawBox (w, r);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void drawBox (FWidget* w, const FRect& r)
|
||||||
|
{
|
||||||
|
// Use box-drawing characters to draw a border
|
||||||
|
|
||||||
|
if ( ! w )
|
||||||
|
return;
|
||||||
|
|
||||||
|
w->print() << r.getUpperLeftPos()
|
||||||
|
<< fc::BoxDrawingsDownAndRight // ┌
|
||||||
|
<< FString(r.getWidth() - 2, fc::BoxDrawingsHorizontal) // ─
|
||||||
|
<< fc::BoxDrawingsDownAndLeft; // ┐
|
||||||
|
|
||||||
|
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||||
|
{
|
||||||
|
w->print() << FPoint(r.getX1(), y)
|
||||||
|
<< fc::BoxDrawingsVertical // │
|
||||||
|
<< FPoint(r.getX2(), y)
|
||||||
|
<< fc::BoxDrawingsVertical; // │
|
||||||
|
}
|
||||||
|
|
||||||
|
w->print() << r.getLowerLeftPos()
|
||||||
|
<< fc::BoxDrawingsUpAndRight // └
|
||||||
|
<< FString(r.getWidth() - 2, fc::BoxDrawingsHorizontal) // ─
|
||||||
|
<< fc::BoxDrawingsUpAndLeft; // ┘
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void drawNewFontBox (FWidget* w, const FRect& r)
|
||||||
|
{
|
||||||
|
// Use new graphical font characters to draw a border
|
||||||
|
|
||||||
|
w->print() << r.getUpperLeftPos()
|
||||||
|
<< fc::NF_border_corner_middle_upper_left // ┌
|
||||||
|
<< FString(r.getWidth() - 2, fc::BoxDrawingsHorizontal) // ─
|
||||||
|
<< fc::NF_border_corner_middle_upper_right; // ┐
|
||||||
|
|
||||||
|
for (int y = r.getY1() + 1; y < r.getY2(); y++)
|
||||||
|
{
|
||||||
|
w->print() << FPoint(r.getX1(), y)
|
||||||
|
<< fc::NF_border_line_left // border left ⎸
|
||||||
|
<< FPoint(r.getX2(), y)
|
||||||
|
<< fc::NF_rev_border_line_right; // border right⎹
|
||||||
|
}
|
||||||
|
|
||||||
|
w->print() << r.getLowerLeftPos()
|
||||||
|
<< fc::NF_border_corner_middle_lower_left // └
|
||||||
|
<< FString(r.getWidth() - 2, fc::BoxDrawingsHorizontal) // ─
|
||||||
|
<< fc::NF_border_corner_middle_lower_right; // ┘
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace finalcut
|
|
@ -117,8 +117,8 @@ class FApplication : public FWidget
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
int exec(); // run
|
int exec(); // run
|
||||||
int enter_loop();
|
int enterLoop();
|
||||||
void exit_loop();
|
void exitLoop();
|
||||||
static void exit (int = 0);
|
static void exit (int = 0);
|
||||||
void quit();
|
void quit();
|
||||||
static bool sendEvent (const FObject*, const FEvent*);
|
static bool sendEvent (const FObject*, const FEvent*);
|
||||||
|
|
|
@ -33,9 +33,9 @@ namespace finalcut
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
||||||
extern fkeymap Fkey[];
|
extern FKeyMap fkey[];
|
||||||
extern fmetakeymap Fmetakey[];
|
extern FMetakeyMap fmetakey[];
|
||||||
extern keyname FkeyName[];
|
extern FKeyName fkeyname[];
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ class FKeyboard final
|
||||||
timeval* getKeyPressedTime();
|
timeval* getKeyPressedTime();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setTermcapMap (fc::fkeymap*);
|
void setTermcapMap (fc::FKeyMap*);
|
||||||
void setKeypressTimeout (const uInt64);
|
void setKeypressTimeout (const uInt64);
|
||||||
void enableUTF8();
|
void enableUTF8();
|
||||||
void disableUTF8();
|
void disableUTF8();
|
||||||
|
@ -170,7 +170,7 @@ class FKeyboard final
|
||||||
|
|
||||||
static timeval time_keypressed;
|
static timeval time_keypressed;
|
||||||
static uInt64 key_timeout;
|
static uInt64 key_timeout;
|
||||||
fc::fkeymap* key_map{nullptr};
|
fc::FKeyMap* key_map{nullptr};
|
||||||
FKey key{0};
|
FKey key{0};
|
||||||
char read_buf[READ_BUF_SIZE]{'\0'};
|
char read_buf[READ_BUF_SIZE]{'\0'};
|
||||||
char fifo_buf[FIFO_BUF_SIZE]{'\0'};
|
char fifo_buf[FIFO_BUF_SIZE]{'\0'};
|
||||||
|
|
|
@ -149,7 +149,7 @@ class FMouse
|
||||||
uChar wheel_down : 1; // 0..1
|
uChar wheel_down : 1; // 0..1
|
||||||
uChar mouse_moved : 1; // 0..1
|
uChar mouse_moved : 1; // 0..1
|
||||||
uChar : 4; // padding bits
|
uChar : 4; // padding bits
|
||||||
} button; // bit field
|
} FMouseButton; // bit field
|
||||||
|
|
||||||
enum states
|
enum states
|
||||||
{
|
{
|
||||||
|
@ -160,7 +160,7 @@ class FMouse
|
||||||
};
|
};
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
button& getButtonState();
|
FMouseButton& getButtonState();
|
||||||
FPoint& getNewPos();
|
FPoint& getNewPos();
|
||||||
uInt16 getMaxWidth();
|
uInt16 getMaxWidth();
|
||||||
uInt16 getMaxHeight();
|
uInt16 getMaxHeight();
|
||||||
|
@ -180,7 +180,7 @@ class FMouse
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data members
|
// Data members
|
||||||
button b_state{};
|
FMouseButton b_state{};
|
||||||
bool mouse_event_occurred{false};
|
bool mouse_event_occurred{false};
|
||||||
bool input_data_pending{false};
|
bool input_data_pending{false};
|
||||||
uInt16 max_width{80};
|
uInt16 max_width{80};
|
||||||
|
|
|
@ -126,7 +126,7 @@ class FObject
|
||||||
bool delAllTimer();
|
bool delAllTimer();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct timer_data
|
struct FTimerData
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
timeval interval;
|
timeval interval;
|
||||||
|
@ -135,10 +135,10 @@ class FObject
|
||||||
};
|
};
|
||||||
|
|
||||||
// Typedefs
|
// Typedefs
|
||||||
typedef std::vector<timer_data> TimerList;
|
typedef std::vector<FTimerData> FTimerList;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
TimerList* getTimerList() const;
|
FTimerList* getTimerList() const;
|
||||||
|
|
||||||
// Mutator
|
// Mutator
|
||||||
void setWidgetProperty (bool);
|
void setWidgetProperty (bool);
|
||||||
|
@ -161,7 +161,7 @@ class FObject
|
||||||
bool has_parent{false};
|
bool has_parent{false};
|
||||||
bool widget_object{false};
|
bool widget_object{false};
|
||||||
static bool timer_modify_lock;
|
static bool timer_modify_lock;
|
||||||
static TimerList* timer_list;
|
static FTimerList* timer_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ inline bool FObject::isTimerInUpdating() const
|
||||||
{ return timer_modify_lock; }
|
{ return timer_modify_lock; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FObject::TimerList* FObject::getTimerList() const
|
inline FObject::FTimerList* FObject::getTimerList() const
|
||||||
{ return timer_list; }
|
{ return timer_list; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -126,8 +126,8 @@ class FOptiAttr final
|
||||||
FOptiAttr& operator = (const FOptiAttr&) = delete;
|
FOptiAttr& operator = (const FOptiAttr&) = delete;
|
||||||
|
|
||||||
// Friend operator functions
|
// Friend operator functions
|
||||||
friend bool operator == (const charData&, const charData&);
|
friend bool operator == (const FChar&, const FChar&);
|
||||||
friend bool operator != (const charData&, const charData&);
|
friend bool operator != (const FChar&, const FChar&);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
const FString getClassName() const;
|
const FString getClassName() const;
|
||||||
|
@ -175,12 +175,12 @@ class FOptiAttr final
|
||||||
void set_orig_orig_colors (char[]);
|
void set_orig_orig_colors (char[]);
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
static bool isNormal (charData*&);
|
static bool isNormal (FChar*&);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void initialize();
|
void initialize();
|
||||||
static FColor vga2ansi (FColor);
|
static FColor vga2ansi (FColor);
|
||||||
char* changeAttribute (charData*&, charData*&);
|
char* changeAttribute (FChar*&, FChar*&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedefs and Enumerations
|
// Typedefs and Enumerations
|
||||||
|
@ -223,62 +223,62 @@ class FOptiAttr final
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
bool setTermBold (charData*&);
|
bool setTermBold (FChar*&);
|
||||||
bool unsetTermBold (charData*&);
|
bool unsetTermBold (FChar*&);
|
||||||
bool setTermDim (charData*&);
|
bool setTermDim (FChar*&);
|
||||||
bool unsetTermDim (charData*&);
|
bool unsetTermDim (FChar*&);
|
||||||
bool setTermItalic (charData*&);
|
bool setTermItalic (FChar*&);
|
||||||
bool unsetTermItalic (charData*&);
|
bool unsetTermItalic (FChar*&);
|
||||||
bool setTermUnderline (charData*&);
|
bool setTermUnderline (FChar*&);
|
||||||
bool unsetTermUnderline (charData*&);
|
bool unsetTermUnderline (FChar*&);
|
||||||
bool setTermBlink (charData*&);
|
bool setTermBlink (FChar*&);
|
||||||
bool unsetTermBlink (charData*&);
|
bool unsetTermBlink (FChar*&);
|
||||||
bool setTermReverse (charData*&);
|
bool setTermReverse (FChar*&);
|
||||||
bool unsetTermReverse (charData*&);
|
bool unsetTermReverse (FChar*&);
|
||||||
bool setTermStandout (charData*&);
|
bool setTermStandout (FChar*&);
|
||||||
bool unsetTermStandout (charData*&);
|
bool unsetTermStandout (FChar*&);
|
||||||
bool setTermInvisible (charData*&);
|
bool setTermInvisible (FChar*&);
|
||||||
bool unsetTermInvisible (charData*&);
|
bool unsetTermInvisible (FChar*&);
|
||||||
bool setTermProtected (charData*&);
|
bool setTermProtected (FChar*&);
|
||||||
bool unsetTermProtected (charData*&);
|
bool unsetTermProtected (FChar*&);
|
||||||
bool setTermCrossedOut (charData*&);
|
bool setTermCrossedOut (FChar*&);
|
||||||
bool unsetTermCrossedOut (charData*&);
|
bool unsetTermCrossedOut (FChar*&);
|
||||||
bool setTermDoubleUnderline (charData*&);
|
bool setTermDoubleUnderline (FChar*&);
|
||||||
bool unsetTermDoubleUnderline (charData*&);
|
bool unsetTermDoubleUnderline (FChar*&);
|
||||||
bool setTermAttributes ( charData*&
|
bool setTermAttributes ( FChar*&
|
||||||
, bool, bool, bool
|
, bool, bool, bool
|
||||||
, bool, bool, bool
|
, bool, bool, bool
|
||||||
, bool, bool, bool );
|
, bool, bool, bool );
|
||||||
bool unsetTermAttributes (charData*&);
|
bool unsetTermAttributes (FChar*&);
|
||||||
bool setTermAltCharset (charData*&);
|
bool setTermAltCharset (FChar*&);
|
||||||
bool unsetTermAltCharset (charData*&);
|
bool unsetTermAltCharset (FChar*&);
|
||||||
bool setTermPCcharset (charData*&);
|
bool setTermPCcharset (FChar*&);
|
||||||
bool unsetTermPCcharset (charData*&);
|
bool unsetTermPCcharset (FChar*&);
|
||||||
bool setTermDefaultColor (charData*&);
|
bool setTermDefaultColor (FChar*&);
|
||||||
void setAttributesOn (charData*&);
|
void setAttributesOn (FChar*&);
|
||||||
void setAttributesOff (charData*&);
|
void setAttributesOff (FChar*&);
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
static bool hasColor (charData*&);
|
static bool hasColor (FChar*&);
|
||||||
static bool hasAttribute (charData*&);
|
static bool hasAttribute (FChar*&);
|
||||||
static bool hasNoAttribute (charData*&);
|
static bool hasNoAttribute (FChar*&);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
bool hasColorChanged (charData*&, charData*&);
|
bool hasColorChanged (FChar*&, FChar*&);
|
||||||
void resetColor (charData*&);
|
void resetColor (FChar*&);
|
||||||
void prevent_no_color_video_attributes (charData*&, bool = false);
|
void prevent_no_color_video_attributes (FChar*&, bool = false);
|
||||||
void deactivateAttributes (charData*&, charData*&);
|
void deactivateAttributes (FChar*&, FChar*&);
|
||||||
void changeAttributeSGR (charData*&, charData*&);
|
void changeAttributeSGR (FChar*&, FChar*&);
|
||||||
void changeAttributeSeparately (charData*&, charData*&);
|
void changeAttributeSeparately (FChar*&, FChar*&);
|
||||||
void change_color (charData*&, charData*&);
|
void change_color (FChar*&, FChar*&);
|
||||||
void change_to_default_color (charData*&, charData*&, FColor&, FColor&);
|
void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&);
|
||||||
void change_current_color (charData*&, FColor, FColor);
|
void change_current_color (FChar*&, FColor, FColor);
|
||||||
void resetAttribute (charData*&);
|
void resetAttribute (FChar*&);
|
||||||
void reset (charData*&);
|
void reset (FChar*&);
|
||||||
bool caused_reset_attributes (char[], uChar = all_tests);
|
bool caused_reset_attributes (char[], uChar = all_tests);
|
||||||
bool hasCharsetEquivalence();
|
bool hasCharsetEquivalence();
|
||||||
void detectSwitchOn (charData*&, charData*&);
|
void detectSwitchOn (FChar*&, FChar*&);
|
||||||
void detectSwitchOff (charData*&, charData*&);
|
void detectSwitchOff (FChar*&, FChar*&);
|
||||||
bool switchOn();
|
bool switchOn();
|
||||||
bool switchOff();
|
bool switchOff();
|
||||||
bool append_sequence (char[]);
|
bool append_sequence (char[]);
|
||||||
|
@ -320,9 +320,9 @@ class FOptiAttr final
|
||||||
capability F_orig_pair{};
|
capability F_orig_pair{};
|
||||||
capability F_orig_colors{};
|
capability F_orig_colors{};
|
||||||
|
|
||||||
charData on{};
|
FChar on{};
|
||||||
charData off{};
|
FChar off{};
|
||||||
charData reset_byte_mask{};
|
FChar reset_byte_mask{};
|
||||||
|
|
||||||
int max_color{1};
|
int max_color{1};
|
||||||
int attr_without_color{0};
|
int attr_without_color{0};
|
||||||
|
@ -337,10 +337,10 @@ class FOptiAttr final
|
||||||
|
|
||||||
// FOptiAttr inline functions
|
// FOptiAttr inline functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool operator == ( const charData& lhs,
|
inline bool operator == ( const FChar& lhs,
|
||||||
const charData& rhs )
|
const FChar& rhs )
|
||||||
{
|
{
|
||||||
return lhs.code == rhs.code
|
return lhs.ch == rhs.ch
|
||||||
&& 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.attr.byte[0] == rhs.attr.byte[0]
|
&& lhs.attr.byte[0] == rhs.attr.byte[0]
|
||||||
|
@ -350,8 +350,8 @@ inline bool operator == ( const charData& lhs,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool operator != ( const charData& lhs,
|
inline bool operator != ( const FChar& lhs,
|
||||||
const charData& rhs )
|
const FChar& rhs )
|
||||||
{ return ! ( lhs == rhs ); }
|
{ return ! ( lhs == rhs ); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -146,7 +146,7 @@ class FScrollView : public FWidget
|
||||||
using FVTerm::clearArea;
|
using FVTerm::clearArea;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
term_area* getPrintArea() override;
|
FTermArea* getPrintArea() override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
@ -182,7 +182,7 @@ class FScrollView : public FWidget
|
||||||
// Data members
|
// Data members
|
||||||
FRect scroll_geometry{1, 1, 1, 1};
|
FRect scroll_geometry{1, 1, 1, 1};
|
||||||
FRect viewport_geometry{};
|
FRect viewport_geometry{};
|
||||||
term_area* viewport{nullptr}; // virtual scroll content
|
FTermArea* viewport{nullptr}; // virtual scroll content
|
||||||
FScrollbarPtr vbar{nullptr};
|
FScrollbarPtr vbar{nullptr};
|
||||||
FScrollbarPtr hbar{nullptr};
|
FScrollbarPtr hbar{nullptr};
|
||||||
keyMap key_map{};
|
keyMap key_map{};
|
||||||
|
@ -279,7 +279,7 @@ inline void FScrollView::initScrollbar ( FScrollbarPtr& bar
|
||||||
, Callback cb_handler )
|
, Callback cb_handler )
|
||||||
{
|
{
|
||||||
finalcut::initScrollbar (bar, o, this, cb_handler);
|
finalcut::initScrollbar (bar, o, this, cb_handler);
|
||||||
term_area* area = getPrintArea();
|
FTermArea* area = getPrintArea();
|
||||||
bar->setPrintArea(area);
|
bar->setPrintArea(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ class FTerm final
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
static bool isNormal (charData*&);
|
static bool isNormal (FChar*&);
|
||||||
static bool isRaw();
|
static bool isRaw();
|
||||||
static bool hasUTF8();
|
static bool hasUTF8();
|
||||||
static bool hasVT100();
|
static bool hasVT100();
|
||||||
|
@ -290,8 +290,8 @@ class FTerm final
|
||||||
static int putchar_UTF8 (int);
|
static int putchar_UTF8 (int);
|
||||||
|
|
||||||
static void initScreenSettings();
|
static void initScreenSettings();
|
||||||
static char* changeAttribute ( charData*&
|
static char* changeAttribute ( FChar*&
|
||||||
, charData*& );
|
, FChar*& );
|
||||||
static void changeTermSizeFinished();
|
static void changeTermSizeFinished();
|
||||||
static void exitWithMessage (const FString&)
|
static void exitWithMessage (const FString&)
|
||||||
#if defined(__clang__) || defined(__GNUC__)
|
#if defined(__clang__) || defined(__GNUC__)
|
||||||
|
@ -385,17 +385,19 @@ class FTerm final
|
||||||
|
|
||||||
|
|
||||||
// non-member function forward declarations
|
// non-member function forward declarations
|
||||||
|
// implemented in fterm_functions.cpp
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
uInt env2uint (const char*);
|
||||||
wchar_t cp437_to_unicode (uChar);
|
wchar_t cp437_to_unicode (uChar);
|
||||||
uChar unicode_to_cp437 (wchar_t);
|
uChar unicode_to_cp437 (wchar_t);
|
||||||
FString getFullWidth (const FString&);
|
FString getFullWidth (const FString&);
|
||||||
FString getHalfWidth (const FString&);
|
FString getHalfWidth (const FString&);
|
||||||
std::size_t getColumnWidthToLength (const FString&, std::size_t);
|
|
||||||
FString getColumnSubString (const FString&, std::size_t, std::size_t);
|
FString getColumnSubString (const FString&, std::size_t, std::size_t);
|
||||||
|
std::size_t getLengthFromColumnWidth (const FString&, std::size_t);
|
||||||
std::size_t getColumnWidth (const FString&, std::size_t);
|
std::size_t getColumnWidth (const FString&, std::size_t);
|
||||||
std::size_t getColumnWidth (const FString&);
|
std::size_t getColumnWidth (const FString&);
|
||||||
std::size_t getColumnWidth (const wchar_t);
|
std::size_t getColumnWidth (const wchar_t);
|
||||||
std::size_t getColumnWidth (charData&);
|
std::size_t getColumnWidth (FChar&);
|
||||||
std::size_t getColumnWidth (const FTermBuffer&);
|
std::size_t getColumnWidth (const FTermBuffer&);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,9 @@ class FTermBuffer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Typedef
|
// Typedef
|
||||||
typedef std::vector<charData> charDataVector;
|
typedef std::vector<FChar> FCharVector;
|
||||||
typedef charDataVector::iterator iterator;
|
typedef FCharVector::iterator iterator;
|
||||||
typedef charDataVector::const_iterator const_iterator;
|
typedef FCharVector::const_iterator const_iterator;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
FTermBuffer() = default;
|
FTermBuffer() = default;
|
||||||
|
@ -69,19 +69,19 @@ class FTermBuffer
|
||||||
// Overloaded operators
|
// Overloaded operators
|
||||||
template <typename typeT>
|
template <typename typeT>
|
||||||
FTermBuffer& operator << (const typeT&);
|
FTermBuffer& operator << (const typeT&);
|
||||||
FTermBuffer& operator << (const charDataVector&);
|
FTermBuffer& operator << (const FCharVector&);
|
||||||
FTermBuffer& operator << (const std::string&);
|
FTermBuffer& operator << (const std::string&);
|
||||||
FTermBuffer& operator << (const std::wstring&);
|
FTermBuffer& operator << (const std::wstring&);
|
||||||
FTermBuffer& operator << (const FColorPair&);
|
FTermBuffer& operator << (const FColorPair&);
|
||||||
|
|
||||||
// Non-member operators
|
// Non-member operators
|
||||||
friend charDataVector& operator << ( charDataVector&
|
friend FCharVector& operator << ( FCharVector&
|
||||||
, const FTermBuffer& );
|
, const FTermBuffer& );
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const FString getClassName() const;
|
virtual const FString getClassName() const;
|
||||||
std::size_t getLength() const;
|
std::size_t getLength() const;
|
||||||
const charDataVector& getBuffer() const;
|
const FCharVector& getBuffer() const;
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
|
@ -91,8 +91,8 @@ class FTermBuffer
|
||||||
iterator end();
|
iterator end();
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
charData front() const;
|
FChar front() const;
|
||||||
charData back() const;
|
FChar back() const;
|
||||||
const FString toString() const;
|
const FString toString() const;
|
||||||
void clear();
|
void clear();
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
|
@ -103,7 +103,7 @@ class FTermBuffer
|
||||||
FTermBuffer& write ();
|
FTermBuffer& write ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
charDataVector data{};
|
FCharVector data{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ inline FTermBuffer& FTermBuffer::operator << (const typeT& s)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FTermBuffer& FTermBuffer::operator << (const charDataVector& vec)
|
inline FTermBuffer& FTermBuffer::operator << (const FCharVector& vec)
|
||||||
{
|
{
|
||||||
for (auto&& tc : vec)
|
for (auto&& tc : vec)
|
||||||
data.push_back(tc);
|
data.push_back(tc);
|
||||||
|
@ -167,7 +167,7 @@ inline std::size_t FTermBuffer::getLength() const
|
||||||
{ return data.size(); }
|
{ return data.size(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline const FTermBuffer::charDataVector& FTermBuffer::getBuffer() const
|
inline const FTermBuffer::FCharVector& FTermBuffer::getBuffer() const
|
||||||
{ return data; }
|
{ return data; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -191,11 +191,11 @@ inline FTermBuffer::const_iterator FTermBuffer::end() const
|
||||||
{ return data.end(); }
|
{ return data.end(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline charData FTermBuffer::front() const
|
inline FChar FTermBuffer::front() const
|
||||||
{ return data.front(); }
|
{ return data.front(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline charData FTermBuffer::back() const
|
inline FChar FTermBuffer::back() const
|
||||||
{ return data.back(); }
|
{ return data.back(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -77,7 +77,7 @@ class FTermDetection final
|
||||||
uInt8 screen : 1;
|
uInt8 screen : 1;
|
||||||
uInt8 tmux : 1;
|
uInt8 tmux : 1;
|
||||||
uInt8 : 5; // padding bits
|
uInt8 : 5; // padding bits
|
||||||
} terminalType;
|
} FTerminalType;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
FTermDetection();
|
FTermDetection();
|
||||||
|
@ -89,7 +89,7 @@ class FTermDetection final
|
||||||
const FString getClassName() const;
|
const FString getClassName() const;
|
||||||
static char* getTermType();
|
static char* getTermType();
|
||||||
static int getGnomeTerminalID();
|
static int getGnomeTerminalID();
|
||||||
terminalType& getTermTypeStruct();
|
FTerminalType& getTermTypeStruct();
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
static const FString& getAnswerbackString();
|
static const FString& getAnswerbackString();
|
||||||
|
@ -199,7 +199,7 @@ class FTermDetection final
|
||||||
static const FString* sec_da;
|
static const FString* sec_da;
|
||||||
static FTermData* fterm_data;
|
static FTermData* fterm_data;
|
||||||
static FSystem* fsystem;
|
static FSystem* fsystem;
|
||||||
static terminalType terminal_type;
|
static FTerminalType terminal_type;
|
||||||
|
|
||||||
static struct colorEnv
|
static struct colorEnv
|
||||||
{
|
{
|
||||||
|
@ -234,7 +234,7 @@ inline int FTermDetection::getGnomeTerminalID()
|
||||||
{ return gnome_terminal_id; }
|
{ return gnome_terminal_id; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FTermDetection::terminalType& FTermDetection::getTermTypeStruct()
|
inline FTermDetection::FTerminalType& FTermDetection::getTermTypeStruct()
|
||||||
{ return terminal_type; }
|
{ return terminal_type; }
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|
|
@ -38,9 +38,16 @@
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <linux/fb.h> // Linux framebuffer console
|
#include <linux/fb.h> // Linux framebuffer console
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__arm__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
||||||
#include <sys/io.h> // <asm/io.h> is deprecated
|
// ISA sysctl support on arm processors only up to glibc-2.29
|
||||||
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if !__GLIBC_PREREQ(2,30)
|
||||||
|
#define ARM_ISA_SYSCTL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
|
#include <sys/io.h>
|
||||||
|
#endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
|
|
||||||
#include <sys/kd.h>
|
#include <sys/kd.h>
|
||||||
#endif // defined(__linux__)
|
#endif // defined(__linux__)
|
||||||
|
@ -150,7 +157,7 @@ class FTermLinux final
|
||||||
void setLinuxCursorStyle (fc::linuxConsoleCursorStyle);
|
void setLinuxCursorStyle (fc::linuxConsoleCursorStyle);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
uInt16 getInputStatusRegisterOne();
|
uInt16 getInputStatusRegisterOne();
|
||||||
uChar readAttributeController (uChar);
|
uChar readAttributeController (uChar);
|
||||||
void writeAttributeController (uChar, uChar);
|
void writeAttributeController (uChar, uChar);
|
||||||
|
@ -162,7 +169,7 @@ class FTermLinux final
|
||||||
bool setVGAPalette (FColor, int, int, int);
|
bool setVGAPalette (FColor, int, int, int);
|
||||||
bool saveVGAPalette();
|
bool saveVGAPalette();
|
||||||
bool resetVGAPalette();
|
bool resetVGAPalette();
|
||||||
#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
|
||||||
FKey shiftKeyCorrection (const FKey&);
|
FKey shiftKeyCorrection (const FKey&);
|
||||||
FKey ctrlKeyCorrection (const FKey&);
|
FKey ctrlKeyCorrection (const FKey&);
|
||||||
FKey altKeyCorrection (const FKey&);
|
FKey altKeyCorrection (const FKey&);
|
||||||
|
|
|
@ -81,7 +81,7 @@ class FTermOpenBSD final
|
||||||
FTermOpenBSD (const FTermOpenBSD&) = delete;
|
FTermOpenBSD (const FTermOpenBSD&) = delete;
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~FTermOpenBSD() = default;
|
virtual ~FTermOpenBSD();
|
||||||
|
|
||||||
// Disable assignment operator (=)
|
// Disable assignment operator (=)
|
||||||
FTermOpenBSD& operator = (const FTermOpenBSD&) = delete;
|
FTermOpenBSD& operator = (const FTermOpenBSD&) = delete;
|
||||||
|
|
|
@ -53,9 +53,15 @@ class FTermXTerminal final
|
||||||
// Constructors
|
// Constructors
|
||||||
FTermXTerminal();
|
FTermXTerminal();
|
||||||
|
|
||||||
|
// Disable copy constructor
|
||||||
|
FTermXTerminal (const FTermXTerminal&) = delete;
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
virtual ~FTermXTerminal();
|
virtual ~FTermXTerminal();
|
||||||
|
|
||||||
|
// Disable assignment operator (=)
|
||||||
|
FTermXTerminal& operator = (const FTermXTerminal&) = delete;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void redefineDefaultColors (bool);
|
void redefineDefaultColors (bool);
|
||||||
void setCursorStyle (fc::xtermCursorStyle);
|
void setCursorStyle (fc::xtermCursorStyle);
|
||||||
|
|
|
@ -108,8 +108,8 @@ typedef std::unordered_map<wchar_t, wchar_t> charSubstitution;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
wchar_t code; // character code
|
wchar_t ch; // character code
|
||||||
wchar_t encoded_code; // encoded output character
|
wchar_t encoded_char; // encoded output character
|
||||||
FColor fg_color; // foreground color
|
FColor fg_color; // foreground color
|
||||||
FColor bg_color; // background color
|
FColor bg_color; // background color
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ typedef struct
|
||||||
|
|
||||||
uInt8 byte[4];
|
uInt8 byte[4];
|
||||||
} attr;
|
} attr;
|
||||||
} charData;
|
} FChar;
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
@ -158,21 +158,21 @@ typedef struct
|
||||||
char* string;
|
char* string;
|
||||||
char tname[4];
|
char tname[4];
|
||||||
}
|
}
|
||||||
fkeymap;
|
FKeyMap;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
FKey num;
|
FKey num;
|
||||||
char string[8];
|
char string[8];
|
||||||
}
|
}
|
||||||
fmetakeymap;
|
FMetakeyMap;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
FKey num;
|
FKey num;
|
||||||
char string[25];
|
char string[25];
|
||||||
}
|
}
|
||||||
keyname;
|
FKeyName;
|
||||||
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
||||||
|
|
|
@ -92,20 +92,20 @@ class FVTerm
|
||||||
uInt xmin; // X-position with the first change
|
uInt xmin; // X-position with the first change
|
||||||
uInt xmax; // X-position with the last change
|
uInt xmax; // X-position with the last change
|
||||||
uInt trans_count; // Number of transparent characters
|
uInt trans_count; // Number of transparent characters
|
||||||
} line_changes;
|
} FLineChanges;
|
||||||
|
|
||||||
typedef void (FVTerm::*FPreprocessingHandler)();
|
typedef void (FVTerm::*FPreprocessingHandler)();
|
||||||
typedef std::function<void()> FVTermPreprocessing;
|
typedef std::function<void()> FPreprocessingFunction;
|
||||||
|
|
||||||
struct term_area; // forward declaration
|
struct FTermArea; // forward declaration
|
||||||
|
|
||||||
struct vterm_preprocessing
|
struct FVTermPreprocessing
|
||||||
{
|
{
|
||||||
FVTerm* instance;
|
FVTerm* instance;
|
||||||
FVTermPreprocessing function;
|
FPreprocessingFunction function;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<vterm_preprocessing> FPreprocessing;
|
typedef std::vector<FVTermPreprocessing> FPreprocessing;
|
||||||
|
|
||||||
enum covered_state
|
enum covered_state
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,7 @@ class FVTerm
|
||||||
FVTerm& operator << (fc::SpecialCharacter);
|
FVTerm& operator << (fc::SpecialCharacter);
|
||||||
FVTerm& operator << (const std::string&);
|
FVTerm& operator << (const std::string&);
|
||||||
FVTerm& operator << (const FTermBuffer&);
|
FVTerm& operator << (const FTermBuffer&);
|
||||||
FVTerm& operator << (const std::vector<charData>&);
|
FVTerm& operator << (const std::vector<FChar>&);
|
||||||
FVTerm& operator << (const FPoint&);
|
FVTerm& operator << (const FPoint&);
|
||||||
FVTerm& operator << (const FColorPair&);
|
FVTerm& operator << (const FColorPair&);
|
||||||
|
|
||||||
|
@ -147,10 +147,10 @@ class FVTerm
|
||||||
virtual const FString getClassName() const;
|
virtual const FString getClassName() const;
|
||||||
static FColor getTermForegroundColor();
|
static FColor getTermForegroundColor();
|
||||||
static FColor getTermBackgroundColor();
|
static FColor getTermBackgroundColor();
|
||||||
term_area*& getVWin();
|
FTermArea*& getVWin();
|
||||||
const term_area* getVWin() const;
|
const FTermArea* getVWin() const;
|
||||||
FPoint getPrintCursor();
|
FPoint getPrintCursor();
|
||||||
static charData getAttribute();
|
static FChar getAttribute();
|
||||||
static int getMaxColor();
|
static int getMaxColor();
|
||||||
static int getTabstop();
|
static int getTabstop();
|
||||||
static fc::encoding getEncoding();
|
static fc::encoding getEncoding();
|
||||||
|
@ -290,20 +290,20 @@ class FVTerm
|
||||||
void updateTerminal (terminal_update);
|
void updateTerminal (terminal_update);
|
||||||
void updateTerminal();
|
void updateTerminal();
|
||||||
virtual void addPreprocessingHandler ( FVTerm*
|
virtual void addPreprocessingHandler ( FVTerm*
|
||||||
, FVTermPreprocessing );
|
, FPreprocessingFunction );
|
||||||
virtual void delPreprocessingHandler (FVTerm*);
|
virtual void delPreprocessingHandler (FVTerm*);
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
int printf (const FString, Args&&...);
|
int printf (const FString, Args&&...);
|
||||||
int print (const FString&);
|
int print (const FString&);
|
||||||
int print (term_area*, const FString&);
|
int print (FTermArea*, const FString&);
|
||||||
int print (const FTermBuffer&);
|
int print (const FTermBuffer&);
|
||||||
int print (term_area*, const FTermBuffer&);
|
int print (FTermArea*, const FTermBuffer&);
|
||||||
int print (const std::vector<charData>&);
|
int print (const std::vector<FChar>&);
|
||||||
int print (term_area*, const std::vector<charData>&);
|
int print (FTermArea*, const std::vector<FChar>&);
|
||||||
int print (wchar_t);
|
int print (wchar_t);
|
||||||
int print (term_area*, wchar_t);
|
int print (FTermArea*, wchar_t);
|
||||||
int print (charData&);
|
int print (FChar&);
|
||||||
int print (term_area*, charData&);
|
int print (FTermArea*, FChar&);
|
||||||
virtual void print (const FPoint&);
|
virtual void print (const FPoint&);
|
||||||
virtual void print (const FColorPair&);
|
virtual void print (const FColorPair&);
|
||||||
virtual FVTerm& print();
|
virtual FVTerm& print();
|
||||||
|
@ -312,10 +312,10 @@ class FVTerm
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual term_area* getPrintArea();
|
virtual FTermArea* getPrintArea();
|
||||||
term_area* getChildPrintArea() const;
|
FTermArea* getChildPrintArea() const;
|
||||||
term_area* getCurrentPrintArea() const;
|
FTermArea* getCurrentPrintArea() const;
|
||||||
term_area* getVirtualDesktop() const;
|
FTermArea* getVirtualDesktop() const;
|
||||||
std::size_t getLineNumber();
|
std::size_t getLineNumber();
|
||||||
std::size_t getColumnNumber();
|
std::size_t getColumnNumber();
|
||||||
static bool charEncodable (wchar_t);
|
static bool charEncodable (wchar_t);
|
||||||
|
@ -323,9 +323,9 @@ class FVTerm
|
||||||
static FMouseControl* getFMouseControl();
|
static FMouseControl* getFMouseControl();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setPrintArea (term_area*);
|
void setPrintArea (FTermArea*);
|
||||||
void setChildPrintArea (term_area*);
|
void setChildPrintArea (FTermArea*);
|
||||||
void setActiveArea (term_area*);
|
void setActiveArea (FTermArea*);
|
||||||
static void setInsertCursor (bool);
|
static void setInsertCursor (bool);
|
||||||
static void setInsertCursor();
|
static void setInsertCursor();
|
||||||
static void unsetInsertCursor();
|
static void unsetInsertCursor();
|
||||||
|
@ -341,26 +341,26 @@ class FVTerm
|
||||||
|
|
||||||
void createArea ( const FRect&
|
void createArea ( const FRect&
|
||||||
, const FSize&
|
, const FSize&
|
||||||
, term_area*& );
|
, FTermArea*& );
|
||||||
void resizeArea ( const FRect&
|
void resizeArea ( const FRect&
|
||||||
, const FSize&
|
, const FSize&
|
||||||
, term_area* );
|
, FTermArea* );
|
||||||
static void removeArea (term_area*&);
|
static void removeArea (FTermArea*&);
|
||||||
static void restoreVTerm (const FRect&);
|
static void restoreVTerm (const FRect&);
|
||||||
bool updateVTermCursor (term_area*);
|
bool updateVTermCursor (FTermArea*);
|
||||||
static void setAreaCursor ( const FPoint&
|
static void setAreaCursor ( const FPoint&
|
||||||
, bool, term_area* );
|
, bool, FTermArea* );
|
||||||
static void getArea (const FPoint&, term_area*);
|
static void getArea (const FPoint&, FTermArea*);
|
||||||
static void getArea (const FRect&, term_area*);
|
static void getArea (const FRect&, FTermArea*);
|
||||||
void putArea (term_area*);
|
void putArea (FTermArea*);
|
||||||
static void putArea (const FPoint&, term_area*);
|
static void putArea (const FPoint&, FTermArea*);
|
||||||
void scrollAreaForward (term_area*);
|
void scrollAreaForward (FTermArea*);
|
||||||
void scrollAreaReverse (term_area*);
|
void scrollAreaReverse (FTermArea*);
|
||||||
void clearArea (term_area*, int = ' ');
|
void clearArea (FTermArea*, int = ' ');
|
||||||
void processTerminalUpdate();
|
void processTerminalUpdate();
|
||||||
static void startTerminalUpdate();
|
static void startTerminalUpdate();
|
||||||
static void finishTerminalUpdate();
|
static void finishTerminalUpdate();
|
||||||
static void flush_out();
|
static void flushOutputBuffer();
|
||||||
static void initScreenSettings();
|
static void initScreenSettings();
|
||||||
static void changeTermSizeFinished();
|
static void changeTermSizeFinished();
|
||||||
static void exitWithMessage (const FString&)
|
static void exitWithMessage (const FString&)
|
||||||
|
@ -388,101 +388,101 @@ class FVTerm
|
||||||
static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768;
|
static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void setTextToDefault (term_area*, const FSize&);
|
void setTextToDefault (FTermArea*, const FSize&);
|
||||||
static bool reallocateTextArea ( term_area*
|
static bool reallocateTextArea ( FTermArea*
|
||||||
, std::size_t
|
, std::size_t
|
||||||
, std::size_t );
|
, std::size_t );
|
||||||
static bool reallocateTextArea ( term_area*
|
static bool reallocateTextArea ( FTermArea*
|
||||||
, std::size_t );
|
, std::size_t );
|
||||||
static covered_state isCovered (const FPoint&, term_area*);
|
static covered_state isCovered (const FPoint&, FTermArea*);
|
||||||
static void updateOverlappedColor ( term_area*
|
static void updateOverlappedColor ( FTermArea*
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
, const FPoint& );
|
, const FPoint& );
|
||||||
static void updateOverlappedCharacter ( term_area*
|
static void updateOverlappedCharacter ( FTermArea*
|
||||||
, const FPoint& );
|
, const FPoint& );
|
||||||
static void updateShadedCharacter ( term_area*
|
static void updateShadedCharacter ( FTermArea*
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
, const FPoint& );
|
, const FPoint& );
|
||||||
static void updateInheritBackground ( term_area*
|
static void updateInheritBackground ( FTermArea*
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
, const FPoint& );
|
, const FPoint& );
|
||||||
static void updateCharacter ( term_area*
|
static void updateCharacter ( FTermArea*
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
, const FPoint& );
|
, const FPoint& );
|
||||||
static bool updateVTermCharacter ( term_area*
|
static bool updateVTermCharacter ( FTermArea*
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
, const FPoint& );
|
, const FPoint& );
|
||||||
void updateVTerm();
|
void updateVTerm();
|
||||||
static void callPreprocessingHandler (term_area*);
|
static void callPreprocessingHandler (FTermArea*);
|
||||||
bool hasChildAreaChanges (term_area*);
|
bool hasChildAreaChanges (FTermArea*);
|
||||||
void clearChildAreaChanges (term_area*);
|
void clearChildAreaChanges (FTermArea*);
|
||||||
static bool isInsideArea (const FPoint&, term_area*);
|
static bool isInsideArea (const FPoint&, FTermArea*);
|
||||||
static charData generateCharacter (const FPoint&);
|
static FChar generateCharacter (const FPoint&);
|
||||||
static charData getCharacter ( character_type
|
static FChar getCharacter ( character_type
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
, FVTerm* );
|
, FVTerm* );
|
||||||
static charData getCoveredCharacter (const FPoint&, FVTerm*);
|
static FChar getCoveredCharacter (const FPoint&, FVTerm*);
|
||||||
static charData getOverlappedCharacter (const FPoint&, FVTerm*);
|
static FChar getOverlappedCharacter (const FPoint&, FVTerm*);
|
||||||
void init (bool);
|
void init (bool);
|
||||||
static void init_characterLengths (FOptiMove*);
|
static void init_characterLengths (FOptiMove*);
|
||||||
void finish();
|
void finish();
|
||||||
static void putAreaLine (charData*, charData*, int);
|
static void putAreaLine (FChar*, FChar*, int);
|
||||||
static void putAreaCharacter ( const FPoint&, FVTerm*
|
static void putAreaCharacter ( const FPoint&, FVTerm*
|
||||||
, charData*, charData* );
|
, FChar*, FChar* );
|
||||||
static void getAreaCharacter ( const FPoint&, term_area*
|
static void getAreaCharacter ( const FPoint&, FTermArea*
|
||||||
, charData*& );
|
, FChar*& );
|
||||||
bool clearTerm (int = ' ');
|
bool clearTerm (int = ' ');
|
||||||
bool clearFullArea (term_area*, charData&);
|
bool clearFullArea (FTermArea*, FChar&);
|
||||||
static void clearAreaWithShadow (term_area*, charData&);
|
static void clearAreaWithShadow (FTermArea*, FChar&);
|
||||||
static bool canClearToEOL (uInt, uInt);
|
static bool canClearToEOL (uInt, uInt);
|
||||||
static bool canClearLeadingWS (uInt&, uInt);
|
static bool canClearLeadingWS (uInt&, uInt);
|
||||||
static bool canClearTrailingWS (uInt&, uInt);
|
static bool canClearTrailingWS (uInt&, uInt);
|
||||||
bool skipUnchangedCharacters (uInt&, uInt, uInt);
|
bool skipUnchangedCharacters (uInt&, uInt, uInt);
|
||||||
void printRange (uInt, uInt, uInt, bool);
|
void printRange (uInt, uInt, uInt, bool);
|
||||||
void replaceNonPrintableFullwidth (uInt, charData*&);
|
void replaceNonPrintableFullwidth (uInt, FChar*&);
|
||||||
void printCharacter (uInt&, uInt, bool, charData*&);
|
void printCharacter (uInt&, uInt, bool, FChar*&);
|
||||||
void printFullWidthCharacter (uInt&, uInt, charData*&);
|
void printFullWidthCharacter (uInt&, uInt, FChar*&);
|
||||||
void printFullWidthPaddingCharacter (uInt&, uInt, charData*&);
|
void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&);
|
||||||
void printHalfCovertFullWidthCharacter (uInt&, uInt, charData*&);
|
void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&);
|
||||||
void skipPaddingCharacter (uInt&, uInt, charData*&);
|
void skipPaddingCharacter (uInt&, uInt, FChar*&);
|
||||||
exit_state eraseCharacters (uInt&, uInt, uInt, bool);
|
exit_state eraseCharacters (uInt&, uInt, uInt, bool);
|
||||||
exit_state repeatCharacter (uInt&, uInt, uInt);
|
exit_state repeatCharacter (uInt&, uInt, uInt);
|
||||||
bool isFullWidthChar (charData*&);
|
bool isFullWidthChar (FChar*&);
|
||||||
bool isFullWidthPaddingChar (charData*&);
|
bool isFullWidthPaddingChar (FChar*&);
|
||||||
static void cursorWrap();
|
static void cursorWrap();
|
||||||
bool printWrap (term_area*);
|
bool printWrap (FTermArea*);
|
||||||
void printPaddingCharacter (term_area*, charData&);
|
void printPaddingCharacter (FTermArea*, FChar&);
|
||||||
void updateTerminalLine (uInt);
|
void updateTerminalLine (uInt);
|
||||||
bool updateTerminalCursor();
|
bool updateTerminalCursor();
|
||||||
bool isInsideTerminal (const FPoint&);
|
bool isInsideTerminal (const FPoint&);
|
||||||
bool isTermSizeChanged();
|
bool isTermSizeChanged();
|
||||||
static void markAsPrinted (uInt, uInt);
|
static void markAsPrinted (uInt, uInt);
|
||||||
static void markAsPrinted (uInt, uInt, uInt);
|
static void markAsPrinted (uInt, uInt, uInt);
|
||||||
static void newFontChanges (charData*&);
|
static void newFontChanges (FChar*&);
|
||||||
static void charsetChanges (charData*&);
|
static void charsetChanges (FChar*&);
|
||||||
void appendCharacter (charData*&);
|
void appendCharacter (FChar*&);
|
||||||
void appendChar (charData*&);
|
void appendChar (FChar*&);
|
||||||
void appendAttributes (charData*&);
|
void appendAttributes (FChar*&);
|
||||||
int appendLowerRight (charData*&);
|
int appendLowerRight (FChar*&);
|
||||||
static void characterFilter (charData*&);
|
static void characterFilter (FChar*&);
|
||||||
static void appendOutputBuffer (const std::string&);
|
static void appendOutputBuffer (const std::string&);
|
||||||
static void appendOutputBuffer (const char[]);
|
static void appendOutputBuffer (const char[]);
|
||||||
static int appendOutputBuffer (int);
|
static int appendOutputBuffer (int);
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
term_area* print_area{nullptr}; // print area for this object
|
FTermArea* print_area{nullptr}; // print area for this object
|
||||||
term_area* child_print_area{nullptr}; // print area for children
|
FTermArea* child_print_area{nullptr}; // print area for children
|
||||||
term_area* vwin{nullptr}; // virtual window
|
FTermArea* vwin{nullptr}; // virtual window
|
||||||
static FSystem* fsystem;
|
static FSystem* fsystem;
|
||||||
static FTerm* fterm;
|
static FTerm* fterm;
|
||||||
static term_area* vterm; // virtual terminal
|
static FTermArea* vterm; // virtual terminal
|
||||||
static term_area* vdesktop; // virtual desktop
|
static FTermArea* vdesktop; // virtual desktop
|
||||||
static term_area* active_area; // active area
|
static FTermArea* active_area; // active area
|
||||||
static std::queue<int>* output_buffer;
|
static std::queue<int>* output_buffer;
|
||||||
static charData term_attribute;
|
static FChar term_attribute;
|
||||||
static charData next_attribute;
|
static FChar next_attribute;
|
||||||
static charData s_ch; // shadow character
|
static FChar s_ch; // shadow character
|
||||||
static charData i_ch; // inherit background character
|
static FChar i_ch; // inherit background character
|
||||||
static FPoint* term_pos; // terminal cursor position
|
static FPoint* term_pos; // terminal cursor position
|
||||||
static FKeyboard* keyboard;
|
static FKeyboard* keyboard;
|
||||||
static bool terminal_update_complete;
|
static bool terminal_update_complete;
|
||||||
|
@ -499,21 +499,21 @@ class FVTerm
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// struct FVTerm::term_area
|
// struct FVTerm::FTermArea
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
struct FVTerm::term_area // define virtual terminal character properties
|
struct FVTerm::FTermArea // define virtual terminal character properties
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
term_area() = default;
|
FTermArea() = default;
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
term_area (const term_area&) = delete;
|
FTermArea (const FTermArea&) = delete;
|
||||||
// Destructor
|
// Destructor
|
||||||
~term_area() = default;
|
~FTermArea() = default;
|
||||||
|
|
||||||
// Disable assignment operator (=)
|
// Disable assignment operator (=)
|
||||||
term_area& operator = (const term_area&) = delete;
|
FTermArea& operator = (const FTermArea&) = delete;
|
||||||
|
|
||||||
int offset_left{0}; // Distance from left terminal side
|
int offset_left{0}; // Distance from left terminal side
|
||||||
int offset_top{0}; // Distance from top of the terminal
|
int offset_top{0}; // Distance from top of the terminal
|
||||||
|
@ -525,10 +525,10 @@ struct FVTerm::term_area // define virtual terminal character properties
|
||||||
int cursor_y{0}; // Y-position for the next write operation
|
int cursor_y{0}; // Y-position for the next write operation
|
||||||
int input_cursor_x{-1}; // X-position input cursor
|
int input_cursor_x{-1}; // X-position input cursor
|
||||||
int input_cursor_y{-1}; // Y-position input cursor
|
int input_cursor_y{-1}; // Y-position input cursor
|
||||||
FWidget* widget{nullptr}; // Widget that owns this term_area
|
FWidget* widget{nullptr}; // Widget that owns this FTermArea
|
||||||
FPreprocessing preproc_list{};
|
FPreprocessing preproc_list{};
|
||||||
line_changes* changes{nullptr};
|
FLineChanges* changes{nullptr};
|
||||||
charData* text{nullptr}; // Text data for the output
|
FChar* data{nullptr}; // FChar data of the drawing area
|
||||||
bool input_cursor_visible{false};
|
bool input_cursor_visible{false};
|
||||||
bool has_changes{false};
|
bool has_changes{false};
|
||||||
bool visible{false};
|
bool visible{false};
|
||||||
|
@ -565,7 +565,7 @@ inline FVTerm& FVTerm::operator << (const std::string& string)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FVTerm& FVTerm::operator << \
|
inline FVTerm& FVTerm::operator << \
|
||||||
(const std::vector<charData>& termString)
|
(const std::vector<FChar>& termString)
|
||||||
{
|
{
|
||||||
print (termString);
|
print (termString);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -598,15 +598,15 @@ inline FColor FVTerm::getTermBackgroundColor()
|
||||||
{ return next_attribute.bg_color; }
|
{ return next_attribute.bg_color; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FVTerm::term_area*& FVTerm::getVWin()
|
inline FVTerm::FTermArea*& FVTerm::getVWin()
|
||||||
{ return vwin; }
|
{ return vwin; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline const FVTerm::term_area* FVTerm::getVWin() const
|
inline const FVTerm::FTermArea* FVTerm::getVWin() const
|
||||||
{ return vwin; }
|
{ return vwin; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline charData FVTerm::getAttribute()
|
inline FChar FVTerm::getAttribute()
|
||||||
{ return next_attribute; }
|
{ return next_attribute; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1062,15 +1062,15 @@ inline void FVTerm::redefineDefaultColors (bool enable)
|
||||||
{ FTerm::redefineDefaultColors(enable); }
|
{ FTerm::redefineDefaultColors(enable); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FVTerm::term_area* FVTerm::getChildPrintArea() const
|
inline FVTerm::FTermArea* FVTerm::getChildPrintArea() const
|
||||||
{ return child_print_area; }
|
{ return child_print_area; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FVTerm::term_area* FVTerm::getCurrentPrintArea() const
|
inline FVTerm::FTermArea* FVTerm::getCurrentPrintArea() const
|
||||||
{ return print_area; }
|
{ return print_area; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FVTerm::term_area* FVTerm::getVirtualDesktop() const
|
inline FVTerm::FTermArea* FVTerm::getVirtualDesktop() const
|
||||||
{ return vdesktop; }
|
{ return vdesktop; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1094,15 +1094,15 @@ inline FMouseControl* FVTerm::getFMouseControl()
|
||||||
{ return FTerm::getFMouseControl(); }
|
{ return FTerm::getFMouseControl(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FVTerm::setPrintArea (term_area* area)
|
inline void FVTerm::setPrintArea (FTermArea* area)
|
||||||
{ print_area = area; }
|
{ print_area = area; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FVTerm::setChildPrintArea (term_area* area)
|
inline void FVTerm::setChildPrintArea (FTermArea* area)
|
||||||
{ child_print_area = area; }
|
{ child_print_area = area; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FVTerm::setActiveArea (term_area* area)
|
inline void FVTerm::setActiveArea (FTermArea* area)
|
||||||
{ active_area = area; }
|
{ active_area = area; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -139,7 +139,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
using FVTerm::setColor;
|
using FVTerm::setColor;
|
||||||
using FVTerm::print;
|
using FVTerm::print;
|
||||||
|
|
||||||
struct accelerator
|
struct FAccelerator
|
||||||
{
|
{
|
||||||
alignas(8) FKey key;
|
alignas(8) FKey key;
|
||||||
FWidget* object;
|
FWidget* object;
|
||||||
|
@ -147,12 +147,12 @@ class FWidget : public FVTerm, public FObject
|
||||||
|
|
||||||
// Typedefs
|
// Typedefs
|
||||||
typedef std::vector<FWidget*> FWidgetList;
|
typedef std::vector<FWidget*> FWidgetList;
|
||||||
typedef std::vector<accelerator> Accelerators;
|
typedef std::vector<FAccelerator> FAcceleratorList;
|
||||||
typedef void (*FCallbackPtr)(FWidget*, FDataPtr);
|
typedef void (*FCallbackPtr)(FWidget*, FDataPtr);
|
||||||
typedef void (FWidget::*FMemberCallback)(FWidget*, FDataPtr);
|
typedef void (FWidget::*FMemberCallback)(FWidget*, FDataPtr);
|
||||||
typedef std::function<void(FWidget*, FDataPtr)> FCallback;
|
typedef std::function<void(FWidget*, FDataPtr)> FCallback;
|
||||||
|
|
||||||
struct widget_flags // Properties of a widget ⚑
|
struct FWidgetFlags // Properties of a widget ⚑
|
||||||
{
|
{
|
||||||
uInt32 shadow : 1;
|
uInt32 shadow : 1;
|
||||||
uInt32 trans_shadow : 1;
|
uInt32 trans_shadow : 1;
|
||||||
|
@ -202,7 +202,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
static FStatusBar* getStatusBar();
|
static FStatusBar* getStatusBar();
|
||||||
virtual FWidget* getFirstFocusableWidget (FObjectList);
|
virtual FWidget* getFirstFocusableWidget (FObjectList);
|
||||||
virtual FWidget* getLastFocusableWidget (FObjectList);
|
virtual FWidget* getLastFocusableWidget (FObjectList);
|
||||||
Accelerators* getAcceleratorList() const;
|
FAcceleratorList* getAcceleratorList() const;
|
||||||
FString getStatusbarMessage() const;
|
FString getStatusbarMessage() const;
|
||||||
FColor getForegroundColor() const; // get the primary
|
FColor getForegroundColor() const; // get the primary
|
||||||
FColor getBackgroundColor() const; // widget colors
|
FColor getBackgroundColor() const; // widget colors
|
||||||
|
@ -232,7 +232,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
const FRect& getTermGeometryWithShadow();
|
const FRect& getTermGeometryWithShadow();
|
||||||
std::size_t getDesktopWidth();
|
std::size_t getDesktopWidth();
|
||||||
std::size_t getDesktopHeight();
|
std::size_t getDesktopHeight();
|
||||||
const widget_flags& getFlags() const;
|
const FWidgetFlags& getFlags() const;
|
||||||
FPoint getCursorPos();
|
FPoint getCursorPos();
|
||||||
FPoint getPrintPos();
|
FPoint getPrintPos();
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
void setForegroundColor (FColor);
|
void setForegroundColor (FColor);
|
||||||
void setBackgroundColor (FColor);
|
void setBackgroundColor (FColor);
|
||||||
void setColor();
|
void setColor();
|
||||||
widget_flags& setFlags();
|
FWidgetFlags& setFlags();
|
||||||
// Positioning and sizes mutators...
|
// Positioning and sizes mutators...
|
||||||
virtual void setX (int, bool = true);
|
virtual void setX (int, bool = true);
|
||||||
virtual void setY (int, bool = true);
|
virtual void setY (int, bool = true);
|
||||||
|
@ -345,7 +345,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
static void quit();
|
static void quit();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct callback_data
|
struct FCallbackData
|
||||||
{
|
{
|
||||||
FString cb_signal;
|
FString cb_signal;
|
||||||
FWidget* cb_instance;
|
FWidget* cb_instance;
|
||||||
|
@ -354,16 +354,16 @@ class FWidget : public FVTerm, public FObject
|
||||||
};
|
};
|
||||||
|
|
||||||
// Typedefs
|
// Typedefs
|
||||||
typedef std::vector<callback_data> CallbackObjects;
|
typedef std::vector<FCallbackData> FCallbackObjects;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
term_area* getPrintArea() override;
|
FTermArea* getPrintArea() override;
|
||||||
const FWidgetColors& getFWidgetColors() const;
|
const FWidgetColors& getFWidgetColors() const;
|
||||||
static uInt getModalDialogCounter();
|
static uInt getModalDialogCounter();
|
||||||
static FWidgetList*& getDialogList();
|
static FWidgetList*& getDialogList();
|
||||||
static FWidgetList*& getAlwaysOnTopList();
|
static FWidgetList*& getAlwaysOnTopList();
|
||||||
static FWidgetList*& getWidgetCloseList();
|
static FWidgetList*& getWidgetCloseList();
|
||||||
void addPreprocessingHandler (FVTerm*, FVTermPreprocessing) override;
|
void addPreprocessingHandler (FVTerm*, FPreprocessingFunction) override;
|
||||||
void delPreprocessingHandler (FVTerm*) override;
|
void delPreprocessingHandler (FVTerm*) override;
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
|
@ -466,7 +466,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
int right{0};
|
int right{0};
|
||||||
} padding{};
|
} padding{};
|
||||||
|
|
||||||
struct widget_flags flags{};
|
struct FWidgetFlags flags{};
|
||||||
bool ignore_padding{false};
|
bool ignore_padding{false};
|
||||||
|
|
||||||
// widget size
|
// widget size
|
||||||
|
@ -486,8 +486,8 @@ class FWidget : public FVTerm, public FObject
|
||||||
FColor foreground_color{fc::Default};
|
FColor foreground_color{fc::Default};
|
||||||
FColor background_color{fc::Default};
|
FColor background_color{fc::Default};
|
||||||
FString statusbar_message{};
|
FString statusbar_message{};
|
||||||
Accelerators* accelerator_list{nullptr};
|
FAcceleratorList* accelerator_list{nullptr};
|
||||||
CallbackObjects callback_objects{};
|
FCallbackObjects callback_objects{};
|
||||||
|
|
||||||
static FStatusBar* statusbar;
|
static FStatusBar* statusbar;
|
||||||
static FMenuBar* menubar;
|
static FMenuBar* menubar;
|
||||||
|
@ -515,8 +515,8 @@ class FWidget : public FVTerm, public FObject
|
||||||
// Friend functions
|
// Friend functions
|
||||||
friend void detectTermSize();
|
friend void detectTermSize();
|
||||||
friend void drawShadow (FWidget*);
|
friend void drawShadow (FWidget*);
|
||||||
friend void drawTransparentShadow (FWidget*, int, int, int, int);
|
friend void drawTransparentShadow (FWidget*);
|
||||||
friend void drawBlockShadow (FWidget*, int, int, int, int);
|
friend void drawBlockShadow (FWidget*);
|
||||||
friend void clearShadow (FWidget*);
|
friend void clearShadow (FWidget*);
|
||||||
friend void drawFlatBorder (FWidget*);
|
friend void drawFlatBorder (FWidget*);
|
||||||
friend void clearFlatBorder (FWidget*);
|
friend void clearFlatBorder (FWidget*);
|
||||||
|
@ -524,18 +524,21 @@ class FWidget : public FVTerm, public FObject
|
||||||
|
|
||||||
|
|
||||||
// non-member function forward declarations
|
// non-member function forward declarations
|
||||||
|
// implemented in fwidget_functions.cpp
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void detectTermSize();
|
void detectTermSize();
|
||||||
FKey getHotkey (const FString&);
|
FKey getHotkey (const FString&);
|
||||||
std::size_t getHotkeyPos (const FString& src, FString& dest);
|
std::size_t getHotkeyPos (const FString& src, FString& dest);
|
||||||
void setHotkeyViaString (FWidget*, const FString&);
|
void setHotkeyViaString (FWidget*, const FString&);
|
||||||
void drawBorder (FWidget*, FRect);
|
|
||||||
void drawShadow (FWidget*);
|
void drawShadow (FWidget*);
|
||||||
void drawTransparentShadow (FWidget*, int, int, int, int);
|
void drawTransparentShadow (FWidget*);
|
||||||
void drawBlockShadow (FWidget*, int, int, int, int);
|
void drawBlockShadow (FWidget*);
|
||||||
void clearShadow (FWidget*);
|
void clearShadow (FWidget*);
|
||||||
void drawFlatBorder (FWidget*);
|
void drawFlatBorder (FWidget*);
|
||||||
void clearFlatBorder (FWidget*);
|
void clearFlatBorder (FWidget*);
|
||||||
|
void drawBorder (FWidget*, FRect);
|
||||||
|
void drawBox (FWidget*, const FRect&);
|
||||||
|
void drawNewFontBox (FWidget*, const FRect&);
|
||||||
|
|
||||||
|
|
||||||
// FWidget inline functions
|
// FWidget inline functions
|
||||||
|
@ -580,7 +583,7 @@ inline FStatusBar* FWidget::getStatusBar()
|
||||||
{ return statusbar; }
|
{ return statusbar; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FWidget::Accelerators* FWidget::getAcceleratorList() const
|
inline FWidget::FAcceleratorList* FWidget::getAcceleratorList() const
|
||||||
{ return accelerator_list; }
|
{ return accelerator_list; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -722,7 +725,7 @@ inline std::size_t FWidget::getDesktopHeight()
|
||||||
{ return getLineNumber(); }
|
{ return getLineNumber(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline const FWidget::widget_flags& FWidget::getFlags() const
|
inline const FWidget::FWidgetFlags& FWidget::getFlags() const
|
||||||
{ return flags; }
|
{ return flags; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -833,7 +836,7 @@ inline void FWidget::setBackgroundColor (FColor color)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FWidget::widget_flags& FWidget::setFlags()
|
inline FWidget::FWidgetFlags& FWidget::setFlags()
|
||||||
{ return flags; }
|
{ return flags; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -40,9 +40,9 @@ typedef struct
|
||||||
char* string;
|
char* string;
|
||||||
char tname[4];
|
char tname[4];
|
||||||
}
|
}
|
||||||
fkeymap;
|
FKeyMap;
|
||||||
|
|
||||||
fkeymap Fkey[] =
|
FKeyMap fkey[] =
|
||||||
{
|
{
|
||||||
{ finalcut::fc::Fkey_backspace , C_STR("\177") , "kb" }, // backspace key
|
{ finalcut::fc::Fkey_backspace , C_STR("\177") , "kb" }, // backspace key
|
||||||
{ finalcut::fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key
|
{ finalcut::fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key
|
||||||
|
@ -2793,7 +2793,7 @@ void FKeyboardTest::init()
|
||||||
CPPUNIT_ASSERT ( key_pressed == 0 );
|
CPPUNIT_ASSERT ( key_pressed == 0 );
|
||||||
keyboard->enableUTF8();
|
keyboard->enableUTF8();
|
||||||
keyboard->enableMouseSequences();
|
keyboard->enableMouseSequences();
|
||||||
keyboard->setTermcapMap (reinterpret_cast<finalcut::fc::fkeymap*>(test::Fkey));
|
keyboard->setTermcapMap (reinterpret_cast<finalcut::fc::FKeyMap*>(test::fkey));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -49,7 +49,7 @@ class FObject_protected : public finalcut::FObject
|
||||||
return finalcut::FObject::event(ev);
|
return finalcut::FObject::event(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimerList* getTimerList() const
|
FTimerList* getTimerList() const
|
||||||
{
|
{
|
||||||
return finalcut::FObject::getTimerList();
|
return finalcut::FObject::getTimerList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ void FOptiAttrTest::classNameTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FOptiAttrTest::noArgumentTest()
|
void FOptiAttrTest::noArgumentTest()
|
||||||
{
|
{
|
||||||
finalcut::charData* ch = new finalcut::charData();
|
finalcut::FChar* ch = new finalcut::FChar();
|
||||||
finalcut::FOptiAttr oa;
|
finalcut::FOptiAttr oa;
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ void FOptiAttrTest::noArgumentTest()
|
||||||
CPPUNIT_ASSERT ( oa.isNormal(ch) );
|
CPPUNIT_ASSERT ( oa.isNormal(ch) );
|
||||||
|
|
||||||
// Null test
|
// Null test
|
||||||
finalcut::charData* ch_null = nullptr;
|
finalcut::FChar* ch_null = nullptr;
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(ch, ch) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(ch, ch) == 0 );
|
||||||
CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch, ch_null), C_STR("") );
|
CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch, ch_null), C_STR("") );
|
||||||
CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch), C_STR("") );
|
CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch), C_STR("") );
|
||||||
|
@ -204,8 +204,8 @@ void FOptiAttrTest::fakeReverseTest()
|
||||||
oa.set_orig_orig_colors (0);
|
oa.set_orig_orig_colors (0);
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Gray text on blue background
|
// Gray text on blue background
|
||||||
|
@ -299,8 +299,8 @@ void FOptiAttrTest::ansiTest()
|
||||||
oa.set_orig_orig_colors (0);
|
oa.set_orig_orig_colors (0);
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -764,8 +764,8 @@ void FOptiAttrTest::vt100Test()
|
||||||
oa.set_orig_orig_colors (0);
|
oa.set_orig_orig_colors (0);
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -1235,8 +1235,8 @@ void FOptiAttrTest::xtermTest()
|
||||||
oa.set_orig_orig_colors (0);
|
oa.set_orig_orig_colors (0);
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -1706,8 +1706,8 @@ void FOptiAttrTest::rxvtTest()
|
||||||
oa.set_orig_orig_colors (0);
|
oa.set_orig_orig_colors (0);
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -2178,8 +2178,8 @@ void FOptiAttrTest::linuxTest()
|
||||||
oa.set_orig_orig_colors (C_STR(OSC "R"));
|
oa.set_orig_orig_colors (C_STR(OSC "R"));
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -2661,8 +2661,8 @@ void FOptiAttrTest::puttyTest()
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -3134,8 +3134,8 @@ void FOptiAttrTest::teratermTest()
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -3609,8 +3609,8 @@ void FOptiAttrTest::ibmColorTest()
|
||||||
oa.initialize();
|
oa.initialize();
|
||||||
|
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
@ -4050,8 +4050,8 @@ void FOptiAttrTest::wyse50Test()
|
||||||
|
|
||||||
oa.setTermEnvironment(optiattr_env);
|
oa.setTermEnvironment(optiattr_env);
|
||||||
|
|
||||||
finalcut::charData* from = new finalcut::charData();
|
finalcut::FChar* from = new finalcut::FChar();
|
||||||
finalcut::charData* to = new finalcut::charData();
|
finalcut::FChar* to = new finalcut::FChar();
|
||||||
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
|
||||||
|
|
||||||
// Default color + bold
|
// Default color + bold
|
||||||
|
|
|
@ -660,91 +660,91 @@ void FTermcapQuirksTest::sunTest()
|
||||||
CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_parm_left_cursor].string
|
CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_parm_left_cursor].string
|
||||||
, C_STR(CSI "%p1%dD") );
|
, C_STR(CSI "%p1%dD") );
|
||||||
|
|
||||||
for (std::size_t i = 0; finalcut::fc::Fkey[i].tname[0] != 0; i++)
|
for (std::size_t i = 0; finalcut::fc::fkey[i].tname[0] != 0; i++)
|
||||||
{
|
{
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "K2", 2) == 0 ) // center of keypad
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "K2", 2) == 0 ) // center of keypad
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "218z") );
|
, C_STR(CSI "218z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kb", 2) == 0 ) // backspace key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kb", 2) == 0 ) // backspace key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR("\b") );
|
, C_STR("\b") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kD", 2) == 0
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kD", 2) == 0
|
||||||
&& std::strlen(finalcut::fc::Fkey[i].tname) == 2 ) // delete-character key
|
&& std::strlen(finalcut::fc::fkey[i].tname) == 2 ) // delete-character key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR("\177") );
|
, C_STR("\177") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "@7", 2) == 0 ) // end key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "@7", 2) == 0 ) // end key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "220z") );
|
, C_STR(CSI "220z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "k;", 2) == 0 ) // F10 function key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "k;", 2) == 0 ) // F10 function key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "233z") );
|
, C_STR(CSI "233z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "F1", 2) == 0 ) // F11 function key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "F1", 2) == 0 ) // F11 function key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "234z") );
|
, C_STR(CSI "234z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "F2", 2) == 0 ) // F12 function key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "F2", 2) == 0 ) // F12 function key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "235z") );
|
, C_STR(CSI "235z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kh", 2) == 0 ) // home key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kh", 2) == 0 ) // home key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "214z") );
|
, C_STR(CSI "214z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kI", 2) == 0 ) // insert-character key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kI", 2) == 0 ) // insert-character key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "247z") );
|
, C_STR(CSI "247z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kN", 2) == 0 ) // next-page key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kN", 2) == 0 ) // next-page key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "222z") );
|
, C_STR(CSI "222z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "%7", 2) == 0 ) // options key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "%7", 2) == 0 ) // options key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "194z") );
|
, C_STR(CSI "194z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kP", 2) == 0 ) // prev-page key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kP", 2) == 0 ) // prev-page key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "216z") );
|
, C_STR(CSI "216z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "&5", 2) == 0 ) // resume key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "&5", 2) == 0 ) // resume key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "193z") );
|
, C_STR(CSI "193z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "&8", 2) == 0 ) // undo key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "&8", 2) == 0 ) // undo key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "195z") );
|
, C_STR(CSI "195z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "K2", 2) == 0 ) // center of keypad
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "K2", 2) == 0 ) // center of keypad
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "218z") );
|
, C_STR(CSI "218z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "kDx", 3) == 0 ) // keypad delete
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "kDx", 3) == 0 ) // keypad delete
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "249z") );
|
, C_STR(CSI "249z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "@8x", 3) == 0 ) // enter/send key
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "@8x", 3) == 0 ) // enter/send key
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "250z") );
|
, C_STR(CSI "250z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "KP1", 3) == 0 ) // keypad slash
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP1", 3) == 0 ) // keypad slash
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "212z") );
|
, C_STR(CSI "212z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "KP2", 3) == 0 ) // keypad asterisk
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP2", 3) == 0 ) // keypad asterisk
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "213z") );
|
, C_STR(CSI "213z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "KP3", 3) == 0 ) // keypad minus sign
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP3", 3) == 0 ) // keypad minus sign
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "254z") );
|
, C_STR(CSI "254z") );
|
||||||
|
|
||||||
if ( std::strncmp(finalcut::fc::Fkey[i].tname, "KP4", 3) == 0 ) // keypad plus sign
|
if ( std::strncmp(finalcut::fc::fkey[i].tname, "KP4", 3) == 0 ) // keypad plus sign
|
||||||
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::Fkey[i].string
|
CPPUNIT_ASSERT_CSTRING ( finalcut::fc::fkey[i].string
|
||||||
, C_STR(CSI "253z") );
|
, C_STR(CSI "253z") );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue