Reduce include entries in the header files

This commit is contained in:
Markus Gans 2019-07-21 23:31:21 +02:00
parent 3c52e77448
commit 2b9c64a445
91 changed files with 1094 additions and 763 deletions

View File

@ -1,3 +1,6 @@
2019-07-21 Markus Gans <guru.mail@muenster.de>
* Reduce include entries in the header files
2019-07-14 Markus Gans <guru.mail@muenster.de> 2019-07-14 Markus Gans <guru.mail@muenster.de>
* Reduces the use of raw loops * Reduces the use of raw loops
* Add a unit test for FTermOpenBSD to test the OpenBSD * Add a unit test for FTermOpenBSD to test the OpenBSD

View File

@ -491,11 +491,13 @@ void MouseDraw::drawCanvas()
for (int y = 0; y < y_end; y++) // line loop for (int y = 0; y < y_end; y++) // line loop
{ {
charData* canvaschar; // canvas character finalcut::charData* canvaschar; // canvas character
charData* winchar; // window character finalcut::charData* winchar; // window character
canvaschar = &canvas->text[y * x_end]; canvaschar = &canvas->text[y * x_end];
winchar = &print_area->text[(ay + y) * w_line_len + ax]; winchar = &print_area->text[(ay + y) * w_line_len + ax];
std::memcpy (winchar, canvaschar, sizeof(charData) * unsigned(x_end)); std::memcpy ( winchar
, canvaschar
, sizeof(finalcut::charData) * unsigned(x_end) );
if ( int(print_area->changes[ay + y].xmin) > ax ) if ( int(print_area->changes[ay + y].xmin) > ax )
print_area->changes[ay + y].xmin = uInt(ax); print_area->changes[ay + y].xmin = uInt(ax);

View File

@ -24,9 +24,14 @@
#include <string> #include <string>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fevent.h"
#include "final/fmenu.h" #include "final/fmenu.h"
#include "final/fmenubar.h"
#include "final/fmessagebox.h" #include "final/fmessagebox.h"
#include "final/fmouse.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/ftermios.h"
#include "final/fwidgetcolors.h"
#include "final/fwindow.h" #include "final/fwindow.h"
namespace finalcut namespace finalcut

View File

@ -21,6 +21,8 @@
***********************************************************************/ ***********************************************************************/
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fcolorpair.h"
#include "final/fevent.h"
#include "final/fbutton.h" #include "final/fbutton.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"

View File

@ -23,6 +23,8 @@
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fbuttongroup.h" #include "final/fbuttongroup.h"
#include "final/fevent.h"
#include "final/fsize.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/ftogglebutton.h" #include "final/ftogglebutton.h"

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fcheckbox.h" #include "final/fcheckbox.h"
namespace finalcut namespace finalcut

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fcheckmenuitem.h" #include "final/fcheckmenuitem.h"
#include "final/fmenu.h" #include "final/fmenu.h"

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018 Markus Gans * * Copyright 2018-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fcolorpalette.h" #include "final/fcolorpalette.h"
namespace finalcut namespace finalcut

View File

@ -24,7 +24,11 @@
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fdialog.h" #include "final/fdialog.h"
#include "final/fevent.h"
#include "final/fmenuitem.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/ftooltip.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2016-2018 Markus Gans * * Copyright 2016-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fdialoglistmenu.h" #include "final/fdialoglistmenu.h"
namespace finalcut namespace finalcut

View File

@ -27,6 +27,7 @@
#include <vector> #include <vector>
#include "final/fevent.h"
#include "final/ffiledialog.h" #include "final/ffiledialog.h"
namespace finalcut namespace finalcut

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018 Markus Gans * * Copyright 2018-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,8 +20,8 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <final/fc.h> #include "final/fc.h"
#include <final/fkey_map.h> #include "final/fkey_map.h"
namespace finalcut namespace finalcut
{ {

View File

@ -30,9 +30,14 @@
#include "final/fkeyboard.h" #include "final/fkeyboard.h"
#include "final/fkey_map.h" #include "final/fkey_map.h"
#include "final/fobject.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermios.h" #include "final/ftermios.h"
#if defined(__linux__)
#include "final/ftermlinux.h"
#endif
namespace finalcut namespace finalcut
{ {

View File

@ -23,6 +23,8 @@
#include <memory> #include <memory>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fcolorpair.h"
#include "final/fevent.h"
#include "final/flabel.h" #include "final/flabel.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"

View File

@ -23,8 +23,13 @@
#include <regex> #include <regex>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fevent.h"
#include "final/flabel.h"
#include "final/flineedit.h" #include "final/flineedit.h"
#include "final/fpoint.h"
#include "final/fsize.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -24,9 +24,13 @@
#include <memory> #include <memory>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fcolorpair.h"
#include "final/fevent.h"
#include "final/flistbox.h" #include "final/flistbox.h"
#include "final/fscrollbar.h" #include "final/fscrollbar.h"
#include "final/fstring.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -27,11 +27,16 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "final/emptyfstring.h"
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fcolorpair.h"
#include "final/fevent.h"
#include "final/flistview.h" #include "final/flistview.h"
#include "final/fscrollbar.h" #include "final/fscrollbar.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fstring.h"
#include "final/ftermbuffer.h" #include "final/ftermbuffer.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -24,9 +24,14 @@
#include <vector> #include <vector>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fcolorpair.h"
#include "final/fdialog.h" #include "final/fdialog.h"
#include "final/fevent.h"
#include "final/fmenu.h" #include "final/fmenu.h"
#include "final/fmenubar.h"
#include "final/fmenuitem.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -24,8 +24,12 @@
#include <vector> #include <vector>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fevent.h"
#include "final/fmenu.h"
#include "final/fmenubar.h" #include "final/fmenubar.h"
#include "final/fmenuitem.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -24,6 +24,7 @@
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fdialog.h" #include "final/fdialog.h"
#include "final/fevent.h"
#include "final/fmenu.h" #include "final/fmenu.h"
#include "final/fmenubar.h" #include "final/fmenubar.h"
#include "final/fmenulist.h" #include "final/fmenulist.h"

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -22,7 +22,9 @@
#include <vector> #include <vector>
#include "final/fc.h"
#include "final/fmenulist.h" #include "final/fmenulist.h"
#include "final/fmenuitem.h"
namespace finalcut namespace finalcut
{ {

View File

@ -23,6 +23,7 @@
#include <algorithm> #include <algorithm>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fbutton.h"
#include "final/fmessagebox.h" #include "final/fmessagebox.h"
namespace finalcut namespace finalcut

View File

@ -27,9 +27,13 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include "final/fconfig.h"
#include "final/fkeyboard.h"
#include "final/fmouse.h" #include "final/fmouse.h"
#include "final/fobject.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermxterminal.h" #include "final/ftermxterminal.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -22,6 +22,9 @@
#include <memory> #include <memory>
#include "final/emptyfstring.h"
#include "final/fevent.h"
#include "final/fc.h"
#include "final/fobject.h" #include "final/fobject.h"
namespace finalcut namespace finalcut

View File

@ -22,6 +22,7 @@
#include <cstring> #include <cstring>
#include "final/fc.h"
#include "final/foptiattr.h" #include "final/foptiattr.h"
namespace finalcut namespace finalcut

View File

@ -20,7 +20,11 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fevent.h"
#include "final/fcolorpair.h"
#include "final/fprogressbar.h" #include "final/fprogressbar.h"
#include "final/fstring.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fradiomenuitem.h" #include "final/fradiomenuitem.h"
#include "final/fmenu.h" #include "final/fmenu.h"

View File

@ -22,7 +22,9 @@
#include <algorithm> #include <algorithm>
#include "final/fpoint.h"
#include "final/frect.h" #include "final/frect.h"
#include "final/fsize.h"
namespace finalcut namespace finalcut
{ {
@ -60,6 +62,40 @@ bool FRect::isEmpty() const
return X2 == X1 - 1 && Y2 == Y1 - 1; return X2 == X1 - 1 && Y2 == Y1 - 1;
} }
//----------------------------------------------------------------------
FPoint FRect::getPos() const
{
return FPoint(X1, Y1);
}
//----------------------------------------------------------------------
FPoint FRect::getUpperLeftPos() const
{
return FPoint(X1, Y1);
}
//----------------------------------------------------------------------
FPoint FRect::getUpperRightPos() const
{
return FPoint(X2, Y1);
}
//----------------------------------------------------------------------
FPoint FRect::getLowerLeftPos() const
{ return FPoint(X1, Y2); }
//----------------------------------------------------------------------
FPoint FRect::getLowerRightPos() const
{
return FPoint(X2, Y2);
}
//----------------------------------------------------------------------
FSize FRect::getSize() const
{
return FSize(getWidth(), getHeight());
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FRect::setX1 (int n) void FRect::setX1 (int n)
{ {

View File

@ -22,7 +22,10 @@
#include <algorithm> #include <algorithm>
#include "final/fevent.h"
#include "final/fscrollbar.h" #include "final/fscrollbar.h"
#include "final/fsize.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -23,8 +23,10 @@
#include <memory> #include <memory>
#include "final/fevent.h"
#include "final/fscrollview.h" #include "final/fscrollview.h"
#include "final/fwindow.h" #include "final/fwindow.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -22,7 +22,9 @@
#include <vector> #include <vector>
#include "final/fevent.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -20,7 +20,10 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fcolorpair.h"
#include "final/fevent.h"
#include "final/fswitch.h" #include "final/fswitch.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -25,8 +25,37 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "final/fterm.h" #include "final/fc.h"
#include "final/fcharmap.h" #include "final/fcharmap.h"
#include "final/fcolorpalette.h"
#include "final/fkey_map.h"
#include "final/fkeyboard.h"
#include "final/fmouse.h"
#include "final/foptiattr.h"
#include "final/foptimove.h"
#include "final/fstring.h"
#include "final/fsystem.h"
#include "final/fsystemimpl.h"
#include "final/fterm.h"
#include "final/ftermcap.h"
#include "final/ftermcapquirks.h"
#include "final/ftermdata.h"
#include "final/ftermdebugdata.h"
#include "final/ftermdetection.h"
#include "final/ftermios.h"
#include "final/ftermxterminal.h"
#if defined(UNIT_TEST)
#include "final/ftermlinux.h"
#include "final/ftermfreebsd.h"
#include "final/ftermopenbsd.h"
#elif defined(__linux__)
#include "final/ftermlinux.h"
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#include "final/ftermfreebsd.h"
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include "final/ftermopenbsd.h"
#endif
namespace finalcut namespace finalcut
{ {
@ -42,35 +71,34 @@ int (*FTerm::Fputchar)(int);
// static class attributes // static class attributes
FTerm::initializationValues FTerm::init_values; FTerm::initializationValues FTerm::init_values;
FTermData* FTerm::data = nullptr; FTermData* FTerm::data = nullptr;
FSystem* FTerm::fsys = nullptr; FSystem* FTerm::fsys = nullptr;
FOptiMove* FTerm::opti_move = nullptr; FOptiMove* FTerm::opti_move = nullptr;
FOptiAttr* FTerm::opti_attr = nullptr; FOptiAttr* FTerm::opti_attr = nullptr;
FTermDetection* FTerm::term_detection = nullptr; FTermDetection* FTerm::term_detection = nullptr;
FTermXTerminal* FTerm::xterm = nullptr; FTermXTerminal* FTerm::xterm = nullptr;
FKeyboard* FTerm::keyboard = nullptr; FKeyboard* FTerm::keyboard = nullptr;
FMouseControl* FTerm::mouse = nullptr; FMouseControl* FTerm::mouse = nullptr;
#if defined(UNIT_TEST) #if defined(UNIT_TEST)
FTermLinux* FTerm::linux = nullptr; FTermLinux* FTerm::linux = nullptr;
FTermFreeBSD* FTerm::freebsd = nullptr; FTermFreeBSD* FTerm::freebsd = nullptr;
FTermOpenBSD* FTerm::openbsd = nullptr; FTermOpenBSD* FTerm::openbsd = nullptr;
#elif defined(__linux__) #elif defined(__linux__)
FTermLinux* FTerm::linux = nullptr; FTermLinux* FTerm::linux = nullptr;
#elif defined(__FreeBSD__) || defined(__DragonFly__) #elif defined(__FreeBSD__) || defined(__DragonFly__)
FTermFreeBSD* FTerm::freebsd = nullptr; FTermFreeBSD* FTerm::freebsd = nullptr;
#elif defined(__NetBSD__) || defined(__OpenBSD__) #elif defined(__NetBSD__) || defined(__OpenBSD__)
FTermOpenBSD* FTerm::openbsd = nullptr; FTermOpenBSD* FTerm::openbsd = nullptr;
#endif #endif
#if DEBUG #if DEBUG
FTermDebugData* FTerm::debug_data = nullptr; FTermDebugData* FTerm::debug_data = nullptr;
#endif #endif
// function prototypes // function prototypes
uInt env2uint (const char*); uInt env2uint (const char*);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTerm // class FTerm
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -120,12 +148,414 @@ const FString FTerm::getKeyName (FKey keynum)
return keyboard->getKeyName (keynum); return keyboard->getKeyName (keynum);
} }
//----------------------------------------------------------------------
charSubstitution& FTerm::getCharSubstitutionMap()
{
return data->getCharSubstitutionMap();
}
//----------------------------------------------------------------------
int FTerm::getTTYFileDescriptor()
{
return ( data ) ? data->getTTYFileDescriptor() : 0;
}
//----------------------------------------------------------------------
char* FTerm::getTermType()
{
return data->getTermType();
}
//----------------------------------------------------------------------
char* FTerm::getTermFileName()
{
return data->getTermFileName();
}
//----------------------------------------------------------------------
int FTerm::getTabstop()
{
return FTermcap::tabstop;
}
//----------------------------------------------------------------------
int FTerm::getMaxColor()
{
return FTermcap::max_color;
}
//----------------------------------------------------------------------
FTermData* FTerm::getFTermData()
{
if ( data == 0 )
{
try
{
data = new FTermData;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return data;
}
//----------------------------------------------------------------------
FSystem* FTerm::getFSystem()
{
if ( fsys == 0 )
{
try
{
fsys = new FSystemImpl;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return fsys;
}
//----------------------------------------------------------------------
FOptiMove* FTerm::getFOptiMove()
{
if ( opti_move == 0 )
{
try
{
opti_move = new FOptiMove;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return opti_move;
}
//----------------------------------------------------------------------
FOptiAttr* FTerm::getFOptiAttr()
{
if ( opti_attr == 0 )
{
try
{
opti_attr = new FOptiAttr;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return opti_attr;
}
//----------------------------------------------------------------------
FTermDetection* FTerm::getFTermDetection()
{
if ( term_detection == 0 )
{
try
{
term_detection = new FTermDetection;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return term_detection;
}
//----------------------------------------------------------------------
FTermXTerminal* FTerm::getFTermXTerminal()
{
if ( xterm == 0 )
{
try
{
xterm = new FTermXTerminal;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return xterm;
}
//----------------------------------------------------------------------
FKeyboard* FTerm::getFKeyboard()
{
if ( keyboard == 0 )
{
try
{
keyboard = new FKeyboard;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return keyboard;
}
//----------------------------------------------------------------------
FMouseControl* FTerm::getFMouseControl()
{
if ( mouse == 0 )
{
try
{
mouse = new FMouseControl;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return mouse;
}
#if defined(__linux__)
//----------------------------------------------------------------------
FTermLinux* FTerm::getFTermLinux()
{
if ( linux == 0 )
{
try
{
linux = new FTermLinux;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return linux;
}
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
//----------------------------------------------------------------------
FTermFreeBSD* FTerm::getFTermFreeBSD()
{
if ( freebsd == 0 )
{
try
{
freebsd = new FTermFreeBSD;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return freebsd;
}
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
//----------------------------------------------------------------------
FTermOpenBSD* FTerm::getFTermOpenBSD()
{
if ( openbsd == 0 )
{
try
{
openbsd = new FTermOpenBSD;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return openbsd;
}
#endif
#if DEBUG
//----------------------------------------------------------------------
FTermDebugData& FTerm::getFTermDebugData()
{
if ( debug_data == 0 )
{
try
{
debug_data = new FTermDebugData;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return *debug_data;
}
#endif // DEBUG
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTerm::isNormal (charData*& ch) bool FTerm::isNormal (charData*& ch)
{ {
return opti_attr->isNormal(ch); return opti_attr->isNormal(ch);
} }
//----------------------------------------------------------------------
bool FTerm::hasUTF8()
{
return data->hasUTF8Console();
}
//----------------------------------------------------------------------
bool FTerm::isMonochron()
{
return data->isMonochron();
}
//----------------------------------------------------------------------
bool FTerm::isXTerminal()
{
return term_detection->isXTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isAnsiTerminal()
{
return term_detection->isAnsiTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isRxvtTerminal()
{
return term_detection->isRxvtTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isUrxvtTerminal()
{
return term_detection->isUrxvtTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isMltermTerminal()
{
return term_detection->isMltermTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isPuttyTerminal()
{
return term_detection->isPuttyTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isKdeTerminal()
{
return term_detection->isKdeTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isGnomeTerminal()
{
return term_detection->isGnomeTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isKtermTerminal()
{
return term_detection->isKtermTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isTeraTerm()
{
return term_detection->isTeraTerm();
}
//----------------------------------------------------------------------
bool FTerm::isSunTerminal()
{
return term_detection->isSunTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isCygwinTerminal()
{
return term_detection->isCygwinTerminal();
}
//----------------------------------------------------------------------
bool FTerm::isMinttyTerm()
{
return term_detection->isMinttyTerm();
}
//----------------------------------------------------------------------
bool FTerm::isLinuxTerm()
{
return term_detection->isLinuxTerm();
}
//----------------------------------------------------------------------
bool FTerm::isFreeBSDTerm()
{
return term_detection->isFreeBSDTerm();
}
//----------------------------------------------------------------------
bool FTerm::isNetBSDTerm()
{
return term_detection->isNetBSDTerm();
}
//----------------------------------------------------------------------
bool FTerm::isOpenBSDTerm()
{
return term_detection->isOpenBSDTerm();
}
//----------------------------------------------------------------------
bool FTerm::isScreenTerm()
{
return term_detection->isScreenTerm();
}
//----------------------------------------------------------------------
bool FTerm::isTmuxTerm()
{
return term_detection->isTmuxTerm();
}
//----------------------------------------------------------------------
bool FTerm::isNewFont()
{
return data->isNewFont();
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTerm::isCursorHideable() bool FTerm::isCursorHideable()
{ {
@ -137,6 +567,30 @@ bool FTerm::isCursorHideable()
return false; return false;
} }
//----------------------------------------------------------------------
bool FTerm::hasChangedTermSize()
{
return data->hasTermResized();
}
//----------------------------------------------------------------------
bool FTerm::hasShadowCharacter()
{
return data->hasShadowCharacter();
}
//----------------------------------------------------------------------
bool FTerm::hasHalfBlockCharacter()
{
return data->hasHalfBlockCharacter();
}
//----------------------------------------------------------------------
bool FTerm::hasAlternateScreen()
{
return data->hasAlternateScreen();
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTerm::canChangeColorPalette() bool FTerm::canChangeColorPalette()
{ {
@ -917,6 +1371,12 @@ char* FTerm::changeAttribute ( charData*& term_attr
return opti_attr->changeAttribute (term_attr, next_attr); return opti_attr->changeAttribute (term_attr, next_attr);
} }
//----------------------------------------------------------------------
void FTerm::changeTermSizeFinished()
{
data->setTermResized(false);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTerm::exitWithMessage (const FString& message) void FTerm::exitWithMessage (const FString& message)
{ {
@ -1129,7 +1589,7 @@ void FTerm::init_cygwin_charmap()
} }
// General encoding changes // General encoding changes
characterSub& sub_map = data->getCharSubstitutionMap(); charSubstitution& sub_map = data->getCharSubstitutionMap();
sub_map[L''] = L'*'; sub_map[L''] = L'*';
sub_map[L''] = L'*'; sub_map[L''] = L'*';
sub_map[L''] = L'*'; sub_map[L''] = L'*';

View File

@ -23,7 +23,12 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "final/fc.h"
#include "final/fcolorpair.h"
#include "final/fstring.h"
#include "final/ftermbuffer.h" #include "final/ftermbuffer.h"
#include "final/fvterm.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {

View File

@ -24,26 +24,31 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "final/emptyfstring.h"
#include "final/fc.h"
#include "final/fkey_map.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermdata.h"
#include "final/ftermcap.h" #include "final/ftermcap.h"
#include "final/ftermdetection.h"
namespace finalcut namespace finalcut
{ {
// static class attributes // static class attributes
bool FTermcap::background_color_erase = false; bool FTermcap::background_color_erase = false;
bool FTermcap::can_change_color_palette = false; bool FTermcap::can_change_color_palette = false;
bool FTermcap::automatic_left_margin = false; bool FTermcap::automatic_left_margin = false;
bool FTermcap::automatic_right_margin = false; bool FTermcap::automatic_right_margin = false;
bool FTermcap::eat_nl_glitch = false; bool FTermcap::eat_nl_glitch = false;
bool FTermcap::ansi_default_color = false; bool FTermcap::ansi_default_color = false;
bool FTermcap::osc_support = false; bool FTermcap::osc_support = false;
bool FTermcap::no_utf8_acs_chars = false; bool FTermcap::no_utf8_acs_chars = false;
int FTermcap::max_color = 1; int FTermcap::max_color = 1;
int FTermcap::tabstop = 8; int FTermcap::tabstop = 8;
int FTermcap::attr_without_color = 0; int FTermcap::attr_without_color = 0;
FTermData* FTermcap::fterm_data = nullptr; FTermData* FTermcap::fterm_data = nullptr;
FTermDetection* FTermcap::term_detection = nullptr; FTermDetection* FTermcap::term_detection = nullptr;
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -22,14 +22,20 @@
#include <string> #include <string>
#include "final/fc.h"
#include "final/fkey_map.h"
#include "final/fterm.h"
#include "final/ftermcap.h"
#include "final/ftermcapquirks.h" #include "final/ftermcapquirks.h"
#include "final/ftermdata.h"
#include "final/ftermdetection.h"
namespace finalcut namespace finalcut
{ {
// static class attributes // static class attributes
FTermData* FTermcapQuirks::fterm_data = nullptr; FTermData* FTermcapQuirks::fterm_data = nullptr;
FTermDetection* FTermcapQuirks::term_detection = nullptr; FTermDetection* FTermcapQuirks::term_detection = nullptr;
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermdata.h" #include "final/ftermdata.h"
#include "final/ftermdetection.h" #include "final/ftermdetection.h"
@ -44,6 +45,45 @@ void FTermDebugData::init()
data = FTerm::getFTermData(); data = FTerm::getFTermData();
term_detection = FTerm::getFTermDetection(); term_detection = FTerm::getFTermDetection();
} }
//----------------------------------------------------------------------
const FString& FTermDebugData::getAnswerbackString()
{
return term_detection->getAnswerbackString();
}
//----------------------------------------------------------------------
const FString& FTermDebugData::getSecDAString()
{
return term_detection->getSecDAString();
}
//----------------------------------------------------------------------
const char* FTermDebugData::getTermType_256color()
{
return term_detection->getTermType_256color();
}
//----------------------------------------------------------------------
const char* FTermDebugData::getTermType_Answerback()
{
return term_detection->getTermType_Answerback();
}
//----------------------------------------------------------------------
const char* FTermDebugData::getTermType_SecDA()
{
return term_detection->getTermType_SecDA();
}
//----------------------------------------------------------------------
#if defined(__linux__)
int FTermDebugData::getFramebufferBpp()
{
return data->getFramebufferBpp();
}
#endif // defined(__linux__)
#endif // DEBUG #endif // DEBUG
} // namespace finalcut } // namespace finalcut

View File

@ -20,8 +20,19 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/emptyfstring.h"
#include "final/fc.h"
#include "final/fconfig.h"
#include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermdata.h"
#include "final/ftermdetection.h" #include "final/ftermdetection.h"
#include "final/ftermios.h"
#include "final/ftypes.h"
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
#include "final/ftermopenbsd.h"
#endif
namespace finalcut namespace finalcut
{ {
@ -85,6 +96,20 @@ FTermDetection::~FTermDetection() // destructor
// public methods of FTermDetection // public methods of FTermDetection
//----------------------------------------------------------------------
#if DEBUG
const FString& FTermDetection::getAnswerbackString()
{
return ( answer_back ) ? *answer_back : fc::emptyFString::get();
}
//----------------------------------------------------------------------
const FString& FTermDetection::getSecDAString()
{
return ( sec_da ) ? *sec_da : fc::emptyFString::get();
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermDetection::setTtyTypeFileName (char ttytype_filename[]) void FTermDetection::setTtyTypeFileName (char ttytype_filename[])
{ {

View File

@ -21,8 +21,10 @@
***********************************************************************/ ***********************************************************************/
#include "final/fcharmap.h" #include "final/fcharmap.h"
#include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermfreebsd.h" #include "final/ftermfreebsd.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {

View File

@ -20,10 +20,17 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fcharmap.h"
#include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermcap.h"
#include "final/ftermdetection.h"
#include "final/ftermlinux.h" #include "final/ftermlinux.h"
#include "final/ftypes.h"
#if defined(__linux__) #if defined(__linux__)
#include <linux/keyboard.h> // need keyboard modifiers
#include "../fonts/newfont.h" #include "../fonts/newfont.h"
#include "../fonts/unicodemap.h" #include "../fonts/unicodemap.h"
#include "../fonts/vgafont.h" #include "../fonts/vgafont.h"
@ -1276,7 +1283,7 @@ void FTermLinux::characterFallback ( wchar_t ucs
, std::vector<wchar_t> fallback ) , std::vector<wchar_t> fallback )
{ {
constexpr sInt16 NOT_FOUND = -1; constexpr sInt16 NOT_FOUND = -1;
characterSub& sub_map = fterm_data->getCharSubstitutionMap(); charSubstitution& sub_map = fterm_data->getCharSubstitutionMap();
if ( fallback.size() < 2 || ucs != fallback[0] ) if ( fallback.size() < 2 || ucs != fallback[0] )
return; return;

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermopenbsd.h" #include "final/ftermopenbsd.h"

View File

@ -20,9 +20,15 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fstring.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermcap.h"
#include "final/ftermdetection.h"
#include "final/ftermfreebsd.h" #include "final/ftermfreebsd.h"
#include "final/ftermios.h"
#include "final/ftermxterminal.h" #include "final/ftermxterminal.h"
#include "final/fsize.h"
namespace finalcut namespace finalcut
{ {

View File

@ -22,9 +22,15 @@
#include <memory> #include <memory>
#include "final/fapplication.h"
#include "final/fc.h"
#include "final/fdialog.h" #include "final/fdialog.h"
#include "final/fevent.h"
#include "final/fstring.h"
#include "final/fscrollbar.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/ftextview.h" #include "final/ftextview.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -22,8 +22,11 @@
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fbuttongroup.h" #include "final/fbuttongroup.h"
#include "final/fevent.h"
#include "final/fpoint.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/ftogglebutton.h" #include "final/ftogglebutton.h"
#include "final/fwidget.h"
namespace finalcut namespace finalcut
{ {

View File

@ -22,6 +22,7 @@
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/ftooltip.h" #include "final/ftooltip.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -25,8 +25,16 @@
#include <vector> #include <vector>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fcolorpair.h"
#include "final/fkeyboard.h"
#include "final/foptiattr.h"
#include "final/foptimove.h"
#include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermdata.h"
#include "final/ftermbuffer.h" #include "final/ftermbuffer.h"
#include "final/ftermcap.h"
#include "final/ftypes.h"
#include "final/fvterm.h" #include "final/fvterm.h"
#include "final/fwidget.h" #include "final/fwidget.h"
#include "final/fwindow.h" #include "final/fwindow.h"
@ -56,10 +64,10 @@ FVTerm::term_area* FVTerm::vterm = nullptr;
FVTerm::term_area* FVTerm::vdesktop = nullptr; FVTerm::term_area* FVTerm::vdesktop = nullptr;
FVTerm::term_area* FVTerm::active_area = nullptr; FVTerm::term_area* FVTerm::active_area = nullptr;
FKeyboard* FVTerm::keyboard = nullptr; FKeyboard* FVTerm::keyboard = nullptr;
FVTerm::charData FVTerm::term_attribute; charData FVTerm::term_attribute;
FVTerm::charData FVTerm::next_attribute; charData FVTerm::next_attribute;
FVTerm::charData FVTerm::s_ch; charData FVTerm::s_ch;
FVTerm::charData FVTerm::i_ch; charData FVTerm::i_ch;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1632,7 +1640,7 @@ void FVTerm::clearArea (term_area* area, int fillchar)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FVTerm::charData FVTerm::generateCharacter (const FPoint& pos) charData FVTerm::generateCharacter (const FPoint& pos)
{ {
// Generates characters for a given position considering all areas // Generates characters for a given position considering all areas
@ -1701,9 +1709,9 @@ FVTerm::charData FVTerm::generateCharacter (const FPoint& pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FVTerm::charData FVTerm::getCharacter ( character_type char_type charData FVTerm::getCharacter ( character_type char_type
, const FPoint& pos , const FPoint& pos
, FVTerm* obj ) , FVTerm* obj )
{ {
// Gets the overlapped or the covered character for a given position // Gets the overlapped or the covered character for a given position
@ -1768,16 +1776,14 @@ FVTerm::charData FVTerm::getCharacter ( character_type char_type
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FVTerm::charData FVTerm::getCoveredCharacter ( const FPoint& pos charData FVTerm::getCoveredCharacter (const FPoint& pos, FVTerm* obj)
, FVTerm* obj )
{ {
// Gets the covered character for a given position // Gets the covered character for a given position
return getCharacter (covered_character, pos, obj); return getCharacter (covered_character, pos, obj);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FVTerm::charData FVTerm::getOverlappedCharacter ( const FPoint& pos charData FVTerm::getOverlappedCharacter (const FPoint& pos, FVTerm* obj)
, FVTerm* obj )
{ {
// Gets the overlapped character for a given position // Gets the overlapped character for a given position
return getCharacter (overlapped_character, pos, obj); return getCharacter (overlapped_character, pos, obj);
@ -2797,7 +2803,7 @@ int FVTerm::appendLowerRight (charData*& screen_char)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::characterFilter (charData*& next_char) inline void FVTerm::characterFilter (charData*& next_char)
{ {
FTerm::characterSub& sub_map = fterm->getCharSubstitutionMap(); charSubstitution& sub_map = fterm->getCharSubstitutionMap();
if ( sub_map.find(next_char->encoded_code) != sub_map.end() ) if ( sub_map.find(next_char->encoded_code) != sub_map.end() )
next_char->encoded_code = sub_map[next_char->encoded_code]; next_char->encoded_code = sub_map[next_char->encoded_code];

View File

@ -23,9 +23,12 @@
#include <vector> #include <vector>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fevent.h"
#include "final/fmenubar.h" #include "final/fmenubar.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fstring.h"
#include "final/fwidget.h" #include "final/fwidget.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {
@ -47,7 +50,6 @@ bool FWidget::init_desktop;
bool FWidget::hideable; bool FWidget::hideable;
uInt FWidget::modal_dialogs; uInt FWidget::modal_dialogs;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FWidget // class FWidget
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -2171,7 +2173,7 @@ void FWidget::draw()
void FWidget::drawWindows() void FWidget::drawWindows()
{ {
// redraw windows // redraw windows
FOptiAttr::charData default_char; charData default_char;
default_char.code = ' '; default_char.code = ' ';
default_char.fg_color = fc::Black; default_char.fg_color = fc::Black;
default_char.bg_color = fc::Black; default_char.bg_color = fc::Black;

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fc.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/fwidgetcolors.h" #include "final/fwidgetcolors.h"

View File

@ -21,6 +21,7 @@
***********************************************************************/ ***********************************************************************/
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fevent.h"
#include "final/fmenubar.h" #include "final/fmenubar.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/fwindow.h" #include "final/fwindow.h"

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2013-2018 Markus Gans * * Copyright 2013-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -66,13 +66,26 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "final/fevent.h" #include "final/ftypes.h"
#include "final/fwidget.h" #include "final/fwidget.h"
#include "final/fwindow.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FEvent;
class FAccelEvent;
class FCloseEvent;
class FFocusEvent;
class FKeyEvent;
class FMouseEvent;
class FTimerEvent;
class FWheelEvent;
class FMouseControl;
class FKeyboard;
class FPoint;
class FObject;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FApplication // class FApplication
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -53,6 +53,7 @@
#endif #endif
#include "final/fwidget.h" #include "final/fwidget.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -54,6 +54,7 @@
#endif #endif
#include "final/fscrollview.h" #include "final/fscrollview.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -35,7 +35,8 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
//#include ... #include "final/fc.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {

View File

@ -35,8 +35,6 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include "final/fc.h"
namespace finalcut namespace finalcut
{ {

View File

@ -50,9 +50,7 @@
#endif #endif
/* Define to 1 if GPM mouse is enabled */ /* Define to 1 if GPM mouse is enabled */
#ifndef F_HAVE_LIBGPM /* #undef HAVE_LIBGPM */
#define F_HAVE_LIBGPM 1
#endif
/* Define to 1 if you have the <linux/fb.h> header file. */ /* Define to 1 if you have the <linux/fb.h> header file. */
#ifndef F_HAVE_LINUX_FB_H #ifndef F_HAVE_LINUX_FB_H

View File

@ -57,13 +57,14 @@
#endif #endif
#include "final/fmenu.h" #include "final/fmenu.h"
#include "final/fmenuitem.h"
#include "final/ftooltip.h"
#include "final/fwindow.h" #include "final/fwindow.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FToolTip;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FDialog // class FDialog
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -65,7 +65,11 @@
* *
* *
* *
* FTimerEvent * FTimerEvent
*
*
*
* FUserEvent
* *
*/ */
@ -83,6 +87,9 @@
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FPoint;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FEvent // class FEvent
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -63,11 +63,13 @@
#endif #endif
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#include <fnmatch.h> #include <fnmatch.h>
#include <libgen.h> #include <libgen.h>
#include <pwd.h> #include <pwd.h>
#include <unistd.h>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -4,7 +4,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2014-2018 Markus Gans * * Copyright 2014-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -26,15 +26,21 @@
#define USE_FINAL_H #define USE_FINAL_H
#include <final/emptyfstring.h>
#include <final/fkey_map.h> #include <final/fkey_map.h>
#include <final/fapplication.h> #include <final/fapplication.h>
#include <final/fbuttongroup.h> #include <final/fbuttongroup.h>
#include <final/fbutton.h> #include <final/fbutton.h>
#include "final/fc.h"
#include "final/fcolorpair.h"
#include "final/fcharmap.h"
#include <final/fcheckbox.h> #include <final/fcheckbox.h>
#include <final/fcheckmenuitem.h> #include <final/fcheckmenuitem.h>
#include <final/fdialog.h> #include <final/fdialog.h>
#include <final/fdialoglistmenu.h> #include <final/fdialoglistmenu.h>
#include <final/fevent.h>
#include <final/ffiledialog.h> #include <final/ffiledialog.h>
#include <final/fkeyboard.h>
#include <final/flabel.h> #include <final/flabel.h>
#include <final/flineedit.h> #include <final/flineedit.h>
#include <final/flistbox.h> #include <final/flistbox.h>
@ -43,6 +49,9 @@
#include <final/fmenu.h> #include <final/fmenu.h>
#include <final/fmenuitem.h> #include <final/fmenuitem.h>
#include <final/fmessagebox.h> #include <final/fmessagebox.h>
#include <final/fmouse.h>
#include <final/foptiattr.h>
#include <final/foptimove.h>
#include <final/fpoint.h> #include <final/fpoint.h>
#include <final/fprogressbar.h> #include <final/fprogressbar.h>
#include <final/fradiobutton.h> #include <final/fradiobutton.h>
@ -52,11 +61,31 @@
#include <final/fstatusbar.h> #include <final/fstatusbar.h>
#include <final/fstring.h> #include <final/fstring.h>
#include <final/fswitch.h> #include <final/fswitch.h>
#include <final/fsystem.h>
#include <final/fterm.h> #include <final/fterm.h>
#include <final/ftermios.h>
#include <final/ftermcap.h>
#include <final/ftermcapquirks.h>
#include <final/ftermdata.h>
#include <final/ftermdebugdata.h>
#include <final/ftermdetection.h>
#include <final/ftextview.h> #include <final/ftextview.h>
#include <final/ftooltip.h> #include <final/ftooltip.h>
#include <final/ftypes.h>
#include <final/fwidget.h> #include <final/fwidget.h>
#if defined(UNIT_TEST)
#include "final/ftermlinux.h"
#include "final/ftermfreebsd.h"
#include "final/ftermopenbsd.h"
#elif defined(__linux__)
#include "final/ftermlinux.h"
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#include "final/ftermfreebsd.h"
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include "final/ftermopenbsd.h"
#endif
#undef USE_FINAL_H #undef USE_FINAL_H
#endif // FINAL_H #endif // FINAL_H

View File

@ -35,19 +35,15 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include "final/fobject.h"
#include "final/ftypes.h" #include "final/ftypes.h"
#if defined(__linux__)
#include "final/ftermlinux.h"
#endif
namespace finalcut namespace finalcut
{ {
// class forward declaration // class forward declaration
class FApplication; class FApplication;
class FString;
class FTermLinux;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FKeyboardCommand // class FKeyboardCommand

View File

@ -55,6 +55,7 @@
#include <vector> #include <vector>
#include "final/fwidget.h" #include "final/fwidget.h"
#include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {

View File

@ -53,11 +53,13 @@
#endif #endif
#include "final/fwidget.h" #include "final/fwidget.h"
#include "final/flabel.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FLabel;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FLineEdit // class FLineEdit
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -56,13 +56,15 @@ e Copyright 2014-2019 Markus Gans *
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "final/fscrollbar.h"
#include "final/fstring.h"
#include "final/fwidget.h" #include "final/fwidget.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FScrollbar;
class FString;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FListBoxItem // class FListBoxItem
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -57,8 +57,6 @@
#include <stack> #include <stack>
#include <vector> #include <vector>
#include "final/fscrollbar.h"
#include "final/fstring.h"
#include "final/ftermbuffer.h" #include "final/ftermbuffer.h"
#include "final/fwidget.h" #include "final/fwidget.h"
@ -67,6 +65,8 @@ namespace finalcut
// class forward declaration // class forward declaration
class FListView; class FListView;
class FScrollbar;
class FString;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FListViewItem // class FListViewItem

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -60,13 +60,15 @@
#endif #endif
#include "final/fwindow.h" #include "final/fwindow.h"
#include "final/fmenubar.h"
#include "final/fmenulist.h" #include "final/fmenulist.h"
#include "final/fmenuitem.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FMenuBar;
class FMenuItem;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FMenu // class FMenu
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -59,13 +59,15 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include "final/fmenu.h"
#include "final/fmenulist.h" #include "final/fmenulist.h"
#include "final/fwindow.h" #include "final/fwindow.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FMenu;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FMenuBar // class FMenuBar
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2014-2018 Markus Gans * * Copyright 2014-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -64,13 +64,15 @@
#include <cstring> #include <cstring>
#include "final/fbutton.h"
#include "final/fdialog.h" #include "final/fdialog.h"
#include "final/fterm.h" #include "final/fwidgetcolors.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FButton;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FMessageBox // class FMessageBox
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -63,10 +63,8 @@
#include <cstddef> #include <cstddef>
#include <map> #include <map>
#include "final/fconfig.h"
#include "final/fkeyboard.h" #include "final/fkeyboard.h"
#include "final/fpoint.h" #include "final/fpoint.h"
#include "final/ftypes.h"
#if defined(__linux__) #if defined(__linux__)
#include <linux/keyboard.h> // need for gpm keyboard modifiers #include <linux/keyboard.h> // need for gpm keyboard modifiers

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2015-2018 Markus Gans * * Copyright 2015-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -48,14 +48,22 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "final/emptyfstring.h"
#include "final/fc.h"
#include "final/fevent.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FEvent;
class FKeyEvent;
class FMouseEvent;
class FWheelEvent;
class FFocusEvent;
class FAccelEvent;
class FShowEvent;
class FHideEvent;
class FCloseEvent;
class FTimerEvent;
class FUserEvent;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FObject // class FObject
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -58,9 +58,6 @@
#include <algorithm> // need for std::swap #include <algorithm> // need for std::swap
#include "final/fc.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {
@ -74,46 +71,7 @@ namespace finalcut
class FOptiAttr final class FOptiAttr final
{ {
public: public:
// Typedefs // Typedef
typedef struct
{
wchar_t code; // character code
wchar_t encoded_code; // encoded output character
FColor fg_color; // foreground color
FColor bg_color; // background color
union attribute
{
struct
{
// Attribute byte #0
uInt8 bold : 1; // bold
uInt8 dim : 1; // dim
uInt8 italic : 1; // italic
uInt8 underline : 1; // underline
uInt8 blink : 1; // blink
uInt8 reverse : 1; // reverse
uInt8 standout : 1; // standout
uInt8 invisible : 1; // invisible
// Attribute byte #1
uInt8 protect : 1; // protect mode
uInt8 crossed_out : 1; // crossed out
uInt8 dbl_underline : 1; // double underline
uInt8 alt_charset : 1; // alternate character set (vt100)
uInt8 pc_charset : 1; // pc character set (CP437)
uInt8 transparent : 1; // transparent
uInt8 trans_shadow : 1; // transparent shadow
uInt8 inherit_bg : 1; // inherit background
// Attribute byte #2
uInt8 no_changes : 1; // no changes required
uInt8 printed : 1; // is printed to VTerm
uInt8 : 6; // padding bits
} bit;
uInt8 byte[3];
} attr;
} charData;
typedef struct typedef struct
{ {
bool ansi_default_color; bool ansi_default_color;
@ -381,8 +339,8 @@ class FOptiAttr final
// FOptiAttr inline functions // FOptiAttr inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool operator == ( const FOptiAttr::charData& lhs, inline bool operator == ( const charData& lhs,
const FOptiAttr::charData& rhs ) const charData& rhs )
{ {
return lhs.code == rhs.code return lhs.code == rhs.code
&& lhs.fg_color == rhs.fg_color && lhs.fg_color == rhs.fg_color
@ -392,8 +350,8 @@ inline bool operator == ( const FOptiAttr::charData& lhs,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool operator != ( const FOptiAttr::charData& lhs, inline bool operator != ( const charData& lhs,
const FOptiAttr::charData& rhs ) const charData& rhs )
{ return ! ( lhs == rhs ); } { return ! ( lhs == rhs ); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -63,8 +63,6 @@
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {

View File

@ -36,7 +36,6 @@
#endif #endif
#include <iostream> #include <iostream>
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {

View File

@ -40,12 +40,14 @@
#endif #endif
#include <algorithm> #include <algorithm>
#include "final/fpoint.h"
#include "final/fsize.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FPoint;
class FSize;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FRect // class FRect
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -186,26 +188,6 @@ inline int FRect::getX() const
inline int FRect::getY() const inline int FRect::getY() const
{ return Y1; } { return Y1; }
//----------------------------------------------------------------------
inline FPoint FRect::getPos() const
{ return FPoint(X1, Y1); }
//----------------------------------------------------------------------
inline FPoint FRect::getUpperLeftPos() const
{ return FPoint(X1, Y1); }
//----------------------------------------------------------------------
inline FPoint FRect::getUpperRightPos() const
{ return FPoint(X2, Y1); }
//----------------------------------------------------------------------
inline FPoint FRect::getLowerLeftPos() const
{ return FPoint(X1, Y2); }
//----------------------------------------------------------------------
inline FPoint FRect::getLowerRightPos() const
{ return FPoint(X2, Y2); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FRect::getWidth() const inline std::size_t FRect::getWidth() const
{ {
@ -220,10 +202,6 @@ inline std::size_t FRect::getHeight() const
return ( h < 0 ) ? 0 : std::size_t(h); return ( h < 0 ) ? 0 : std::size_t(h);
} }
//----------------------------------------------------------------------
inline FSize FRect::getSize() const
{ return FSize(getWidth(), getHeight()); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline int& FRect::x1_ref() inline int& FRect::x1_ref()
{ return X1; } { return X1; }

View File

@ -36,6 +36,7 @@
#endif #endif
#include <iostream> #include <iostream>
#include "final/ftypes.h" #include "final/ftypes.h"
namespace finalcut namespace finalcut

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2014-2018 Markus Gans * * Copyright 2014-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -61,6 +61,7 @@
#include <vector> #include <vector>
#include "final/fwidget.h"
#include "final/fwindow.h" #include "final/fwindow.h"
namespace finalcut namespace finalcut

View File

@ -115,41 +115,36 @@
#include <string> #include <string>
#include "final/fc.h" #include "final/fc.h"
#include "final/fcolorpalette.h"
#include "final/fkey_map.h"
#include "final/fkeyboard.h"
#include "final/fmouse.h"
#include "final/foptiattr.h"
#include "final/foptimove.h"
#include "final/fpoint.h"
#include "final/frect.h"
#include "final/fstring.h" #include "final/fstring.h"
#include "final/fsystem.h"
#include "final/fsystemimpl.h"
#include "final/ftermcap.h"
#include "final/ftermcapquirks.h"
#include "final/ftermdata.h"
#include "final/ftermdebugdata.h"
#include "final/ftermdetection.h"
#if defined(UNIT_TEST)
#include "final/ftermlinux.h"
#include "final/ftermfreebsd.h"
#include "final/ftermopenbsd.h"
#elif defined(__linux__)
#include "final/ftermlinux.h"
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#include "final/ftermfreebsd.h"
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#include "final/ftermopenbsd.h"
#endif
#include "final/ftermios.h"
#include "final/ftermxterminal.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FKeyboard;
class FMouseControl;
class FOptiAttr;
class FOptiMove;
class FSize;
class FString;
class FSystem;
class FTermData;
class FTermDebugData;
class FTermDetection;
class FTermXTerminal;
#if defined(UNIT_TEST)
class FTermLinux;
class FTermFreeBSD;
class FTermOpenBSD;
#elif defined(__linux__)
class FTermLinux;
#elif defined(__FreeBSD__) || defined(__DragonFly__)
class FTermFreeBSD;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
class FTermOpenBSD;
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTerm // class FTerm
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -160,10 +155,6 @@ namespace finalcut
class FTerm final class FTerm final
{ {
public: public:
// Typedefs
typedef FOptiAttr::charData charData;
typedef FTermData::characterSub characterSub;
struct initializationValues; // forward declaration struct initializationValues; // forward declaration
// Constructor // Constructor
@ -189,7 +180,7 @@ class FTerm final
static int getTabstop(); static int getTabstop();
static int getMaxColor(); static int getMaxColor();
initializationValues& getInitValues(); initializationValues& getInitValues();
characterSub& getCharSubstitutionMap(); charSubstitution& getCharSubstitutionMap();
static FTermData* getFTermData(); static FTermData* getFTermData();
static FSystem* getFSystem(); static FSystem* getFSystem();
@ -447,369 +438,10 @@ class FTerm final
inline const char* FTerm::getClassName() const inline const char* FTerm::getClassName() const
{ return "FTerm"; } { return "FTerm"; }
//----------------------------------------------------------------------
inline int FTerm::getTTYFileDescriptor()
{ return ( data ) ? data->getTTYFileDescriptor() : 0; }
//----------------------------------------------------------------------
inline char* FTerm::getTermType()
{ return data->getTermType(); }
//----------------------------------------------------------------------
inline char* FTerm::getTermFileName()
{ return data->getTermFileName(); }
//----------------------------------------------------------------------
inline int FTerm::getTabstop()
{ return FTermcap::tabstop; }
//----------------------------------------------------------------------
inline int FTerm::getMaxColor()
{ return FTermcap::max_color; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FTerm::initializationValues& FTerm::getInitValues() inline FTerm::initializationValues& FTerm::getInitValues()
{ return init_values; } { return init_values; }
//----------------------------------------------------------------------
inline FTerm::characterSub& FTerm::getCharSubstitutionMap()
{ return data->getCharSubstitutionMap(); }
//----------------------------------------------------------------------
inline FTermData* FTerm::getFTermData()
{
if ( data == 0 )
{
try
{
data = new FTermData;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return data;
}
//----------------------------------------------------------------------
inline FSystem* FTerm::getFSystem()
{
if ( fsys == 0 )
{
try
{
fsys = new FSystemImpl;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return fsys;
}
//----------------------------------------------------------------------
inline FOptiMove* FTerm::getFOptiMove()
{
if ( opti_move == 0 )
{
try
{
opti_move = new FOptiMove;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return opti_move;
}
//----------------------------------------------------------------------
inline FOptiAttr* FTerm::getFOptiAttr()
{
if ( opti_attr == 0 )
{
try
{
opti_attr = new FOptiAttr;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return opti_attr;
}
//----------------------------------------------------------------------
inline FTermDetection* FTerm::getFTermDetection()
{
if ( term_detection == 0 )
{
try
{
term_detection = new FTermDetection;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return term_detection;
}
//----------------------------------------------------------------------
inline FTermXTerminal* FTerm::getFTermXTerminal()
{
if ( xterm == 0 )
{
try
{
xterm = new FTermXTerminal;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return xterm;
}
//----------------------------------------------------------------------
inline FKeyboard* FTerm::getFKeyboard()
{
if ( keyboard == 0 )
{
try
{
keyboard = new FKeyboard;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return keyboard;
}
//----------------------------------------------------------------------
inline FMouseControl* FTerm::getFMouseControl()
{
if ( mouse == 0 )
{
try
{
mouse = new FMouseControl;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return mouse;
}
#if defined(__linux__)
//----------------------------------------------------------------------
inline FTermLinux* FTerm::getFTermLinux()
{
if ( linux == 0 )
{
try
{
linux = new FTermLinux;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return linux;
}
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
//----------------------------------------------------------------------
inline FTermFreeBSD* FTerm::getFTermFreeBSD()
{
if ( freebsd == 0 )
{
try
{
freebsd = new FTermFreeBSD;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return freebsd;
}
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
//----------------------------------------------------------------------
inline FTermOpenBSD* FTerm::getFTermOpenBSD()
{
if ( openbsd == 0 )
{
try
{
openbsd = new FTermOpenBSD;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return openbsd;
}
#endif
#if DEBUG
//----------------------------------------------------------------------
inline FTermDebugData& FTerm::getFTermDebugData()
{
if ( debug_data == 0 )
{
try
{
debug_data = new FTermDebugData;
}
catch (const std::bad_alloc& ex)
{
std::cerr << bad_alloc_str << ex.what() << std::endl;
std::abort();
}
}
return *debug_data;
}
#endif // DEBUG
//----------------------------------------------------------------------
inline bool FTerm::hasUTF8()
{ return data->hasUTF8Console(); }
//----------------------------------------------------------------------
inline bool FTerm::isMonochron()
{ return data->isMonochron(); }
//----------------------------------------------------------------------
inline bool FTerm::isXTerminal()
{ return term_detection->isXTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isAnsiTerminal()
{ return term_detection->isAnsiTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isRxvtTerminal()
{ return term_detection->isRxvtTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isUrxvtTerminal()
{ return term_detection->isUrxvtTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isMltermTerminal()
{ return term_detection->isMltermTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isPuttyTerminal()
{ return term_detection->isPuttyTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isKdeTerminal()
{ return term_detection->isKdeTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isGnomeTerminal()
{ return term_detection->isGnomeTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isKtermTerminal()
{ return term_detection->isKtermTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isTeraTerm()
{ return term_detection->isTeraTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isSunTerminal()
{ return term_detection->isSunTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isCygwinTerminal()
{ return term_detection->isCygwinTerminal(); }
//----------------------------------------------------------------------
inline bool FTerm::isMinttyTerm()
{ return term_detection->isMinttyTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isLinuxTerm()
{ return term_detection->isLinuxTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isFreeBSDTerm()
{ return term_detection->isFreeBSDTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isNetBSDTerm()
{ return term_detection->isNetBSDTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isOpenBSDTerm()
{ return term_detection->isOpenBSDTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isScreenTerm()
{ return term_detection->isScreenTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isTmuxTerm()
{ return term_detection->isTmuxTerm(); }
//----------------------------------------------------------------------
inline bool FTerm::isNewFont()
{ return data->isNewFont(); }
//----------------------------------------------------------------------
inline bool FTerm::hasChangedTermSize()
{ return data->hasTermResized(); }
//----------------------------------------------------------------------
inline bool FTerm::hasShadowCharacter()
{ return data->hasShadowCharacter(); }
//----------------------------------------------------------------------
inline bool FTerm::hasHalfBlockCharacter()
{ return data->hasHalfBlockCharacter(); }
//----------------------------------------------------------------------
inline bool FTerm::hasAlternateScreen()
{ return data->hasAlternateScreen(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FTerm::setFSystem (FSystem* fsystem) inline void FTerm::setFSystem (FSystem* fsystem)
{ fsys = fsystem; } { fsys = fsystem; }
@ -822,10 +454,6 @@ inline bool FTerm::setUTF8()
inline bool FTerm::unsetUTF8() inline bool FTerm::unsetUTF8()
{ return setUTF8(false); } { return setUTF8(false); }
//----------------------------------------------------------------------
inline void FTerm::changeTermSizeFinished()
{ data->setTermResized(false); }
} // namespace finalcut } // namespace finalcut

View File

@ -39,12 +39,12 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "final/fvterm.h"
#include "final/fstring.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FColorPair;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermBuffer // class FTermBuffer
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -56,7 +56,6 @@ class FTermBuffer
{ {
public: public:
// Typedef // Typedef
typedef FOptiAttr::charData charData;
typedef std::vector<charData> charDataVector; typedef std::vector<charData> charDataVector;
// Constructor // Constructor

View File

@ -58,17 +58,16 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "final/emptyfstring.h"
#include "final/fkey_map.h"
#include "final/ftermdetection.h"
// FTermcap string macro // FTermcap string macro
#define TCAP(...) FTermcap::strings[__VA_ARGS__].string #define TCAP(...) FTermcap::strings[__VA_ARGS__].string
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FTermData;
class FTermDetection;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermcap // class FTermcap
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -35,15 +35,13 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include "final/fc.h"
#include "final/fterm.h"
#include "final/ftermcap.h"
#include "final/ftermdata.h"
#include "final/ftermdetection.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FTermData;
class FTermDetection;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermcapsQuirks // class FTermcapsQuirks
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -58,7 +58,6 @@ class FTermData final
public: public:
// Typedefs // Typedefs
typedef std::unordered_map<std::string, fc::encoding> encodingMap; typedef std::unordered_map<std::string, fc::encoding> encodingMap;
typedef std::unordered_map<wchar_t, wchar_t> characterSub;
// Constructors // Constructors
FTermData() {} FTermData() {}
@ -73,89 +72,88 @@ class FTermData final
FTermData& operator = (const FTermData&) = delete; FTermData& operator = (const FTermData&) = delete;
// Accessors // Accessors
const char* getClassName() const; const char* getClassName() const;
encodingMap& getEncodingList(); encodingMap& getEncodingList();
characterSub& getCharSubstitutionMap(); charSubstitution& getCharSubstitutionMap();
fc::encoding getTermEncoding() const; fc::encoding getTermEncoding() const;
FRect& getTermGeometry(); FRect& getTermGeometry();
int getTTYFileDescriptor() const; int getTTYFileDescriptor() const;
uInt getBaudrate() const; uInt getBaudrate() const;
char* getTermType(); char* getTermType();
char* getTermFileName(); char* getTermFileName();
const FString& getXtermFont() const; const FString& getXtermFont() const;
const FString& getXtermTitle() const; const FString& getXtermTitle() const;
#if DEBUG #if DEBUG
int getFramebufferBpp() const; int getFramebufferBpp() const;
#endif #endif
// Inquiries // Inquiries
bool hasShadowCharacter() const; bool hasShadowCharacter() const;
bool hasHalfBlockCharacter() const; bool hasHalfBlockCharacter() const;
bool hasCursorOptimisation() const; bool hasCursorOptimisation() const;
bool isCursorHidden() const; bool isCursorHidden() const;
bool hasAlternateScreen() const; bool hasAlternateScreen() const;
bool hasASCIIConsole() const; bool hasASCIIConsole() const;
bool hasVT100Console() const; bool hasVT100Console() const;
bool hasUTF8Console() const; bool hasUTF8Console() const;
bool isUTF8() const; bool isUTF8() const;
bool isNewFont() const; bool isNewFont() const;
bool isVGAFont() const; bool isVGAFont() const;
bool isMonochron() const; bool isMonochron() const;
bool hasTermResized() const; bool hasTermResized() const;
// Mutators // Mutators
void setTermEncoding(fc::encoding); void setTermEncoding(fc::encoding);
void setTTYFileDescriptor (int); void setTTYFileDescriptor (int);
void setBaudrate (uInt); void setBaudrate (uInt);
void supportShadowCharacter (bool); void supportShadowCharacter (bool);
void supportHalfBlockCharacter (bool); void supportHalfBlockCharacter (bool);
void supportCursorOptimisation (bool); void supportCursorOptimisation (bool);
void setCursorHidden (bool); void setCursorHidden (bool);
void useAlternateScreen (bool); void useAlternateScreen (bool);
void setASCIIConsole (bool); void setASCIIConsole (bool);
void setVT100Console (bool); void setVT100Console (bool);
void setUTF8Console (bool); void setUTF8Console (bool);
void setUTF8 (bool); void setUTF8 (bool);
void setNewFont (bool); void setNewFont (bool);
void setVGAFont (bool); void setVGAFont (bool);
void setMonochron (bool); void setMonochron (bool);
void setTermResized (bool); void setTermResized (bool);
void setTermType (const char[]); void setTermType (const char[]);
void setTermFileName (const char[]); void setTermFileName (const char[]);
void setXtermFont (const FString&); void setXtermFont (const FString&);
void setXtermTitle (const FString&); void setXtermTitle (const FString&);
#if DEBUG #if DEBUG
void setFramebufferBpp (int); void setFramebufferBpp (int);
#endif #endif
private: private:
// Data Members // Data Members
encodingMap encoding_list{}; encodingMap encoding_list{};
characterSub char_substitution_map{}; charSubstitution char_substitution_map{};
fc::encoding term_encoding{fc::UNKNOWN}; fc::encoding term_encoding{fc::UNKNOWN};
FRect term_geometry{}; // current terminal geometry FRect term_geometry{}; // current terminal geometry
int fd_tty{-1}; // Teletype (tty) file descriptor is still undefined int fd_tty{-1}; // Teletype (tty) file descriptor is still undefined
uInt baudrate{0}; uInt baudrate{0};
bool shadow_character{true}; bool shadow_character{true};
bool half_block_character{true}; bool half_block_character{true};
bool cursor_optimisation{true}; bool cursor_optimisation{true};
bool hidden_cursor{false}; // Global cursor hidden state bool hidden_cursor{false}; // Global cursor hidden state
bool use_alternate_screen{true}; bool use_alternate_screen{true};
bool ascii_console{false}; bool ascii_console{false};
bool vt100_console{false}; bool vt100_console{false};
bool utf8_console{false}; bool utf8_console{false};
bool utf8_state{false}; bool utf8_state{false};
bool new_font{false}; bool new_font{false};
bool vga_font{false}; bool vga_font{false};
bool monochron{false}; bool monochron{false};
bool resize_term{false}; bool resize_term{false};
char termtype[256]{'\0'}; char termtype[256]{'\0'};
char termfilename[256]{'\0'}; char termfilename[256]{'\0'};
FString xterm_font{}; FString xterm_font{};
FString xterm_title{}; FString xterm_title{};
#if DEBUG #if DEBUG
int framebuffer_bpp{-1}; int framebuffer_bpp{-1};
#endif #endif
}; };
#pragma pack(pop) #pragma pack(pop)
@ -170,7 +168,7 @@ inline FTermData::encodingMap& FTermData::getEncodingList()
{ return encoding_list; } { return encoding_list; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FTermData::characterSub& FTermData::getCharSubstitutionMap() inline charSubstitution& FTermData::getCharSubstitutionMap()
{ return char_substitution_map; } { return char_substitution_map; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -40,6 +40,8 @@ namespace finalcut
// class forward declaration // class forward declaration
class FTerm; class FTerm;
class FTermData;
class FTermDetection;
#if DEBUG #if DEBUG
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -79,33 +81,6 @@ class FTermDebugData final
static FTermData* data; static FTermData* data;
static FTermDetection* term_detection; static FTermDetection* term_detection;
}; };
//----------------------------------------------------------------------
inline const FString& FTermDebugData::getAnswerbackString()
{ return term_detection->getAnswerbackString(); }
//----------------------------------------------------------------------
inline const FString& FTermDebugData::getSecDAString()
{ return term_detection->getSecDAString(); }
//----------------------------------------------------------------------
inline const char* FTermDebugData::getTermType_256color()
{ return term_detection->getTermType_256color(); }
//----------------------------------------------------------------------
inline const char* FTermDebugData::getTermType_Answerback()
{ return term_detection->getTermType_Answerback(); }
//----------------------------------------------------------------------
inline const char* FTermDebugData::getTermType_SecDA()
{ return term_detection->getTermType_SecDA(); }
//----------------------------------------------------------------------
#if defined(__linux__)
inline int FTermDebugData::getFramebufferBpp()
{ return data->getFramebufferBpp(); }
#endif // defined(__linux__)
#endif // DEBUG #endif // DEBUG
} // namespace finalcut } // namespace finalcut

View File

@ -41,13 +41,6 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include "final/fc.h"
#include "final/fconfig.h"
#include "final/fsystem.h"
#include "final/ftermdata.h"
#include "final/ftermios.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {
@ -267,14 +260,6 @@ inline FTermDetection::terminalType& FTermDetection::getTermTypeStruct()
{ return terminal_type; } { return terminal_type; }
#if DEBUG #if DEBUG
//----------------------------------------------------------------------
inline const FString& FTermDetection::getAnswerbackString()
{ return ( answer_back ) ? *answer_back : fc::emptyFString::get(); }
//----------------------------------------------------------------------
inline const FString& FTermDetection::getSecDAString()
{ return ( sec_da ) ? *sec_da : fc::emptyFString::get(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const char* FTermDetection::getTermType_256color() inline const char* FTermDetection::getTermType_256color()
{ return termtype_256color; } { return termtype_256color; }

View File

@ -36,8 +36,6 @@
#endif #endif
#include "final/fc.h" #include "final/fc.h"
#include "final/fsystem.h"
#include "final/ftypes.h"
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
#undef mouse_info // consio.h #undef mouse_info // consio.h
@ -50,6 +48,9 @@
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FSystem;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermFreeBSD // class FTermFreeBSD
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -51,15 +51,16 @@
#include <cstdio> // need for sprintf #include <cstdio> // need for sprintf
#include <cstring> #include <cstring>
#include "final/fc.h" #include "final/ftermdata.h"
#include "final/fcharmap.h"
#include "final/fsystem.h"
#include "final/ftermdetection.h"
#include "final/ftypes.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FSystem;
class FTermData;
class FTermDetection;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermLinux // class FTermLinux
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -134,8 +135,6 @@ class FTermLinux final
rgb color[16]; rgb color[16];
} ColorMap; } ColorMap;
typedef FTermData::characterSub characterSub;
// Accessors // Accessors
static int getFramebuffer_bpp(); static int getFramebuffer_bpp();
static bool getScreenFont(); static bool getScreenFont();

View File

@ -36,7 +36,6 @@
#endif #endif
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "final/fsystem.h"
#if defined(UNIT_TEST) #if defined(UNIT_TEST)
#define WSKBDIO_GETENCODING uInt32(0x4004570F) #define WSKBDIO_GETENCODING uInt32(0x4004570F)
@ -50,6 +49,9 @@
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FSystem;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermOpenBSD // class FTermOpenBSD
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -35,14 +35,14 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include "final/fc.h"
#include "final/fstring.h"
#include "final/ftermcap.h"
#include "final/ftermdetection.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FString;
class FSystem;
class FTermDetection;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTermXTerminal // class FTermXTerminal
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -55,15 +55,14 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "final/fapplication.h"
#include "final/fscrollbar.h"
#include "final/fstatusbar.h"
#include "final/fstring.h"
#include "final/fwidget.h" #include "final/fwidget.h"
namespace finalcut namespace finalcut
{ {
// class forward declaration
class FString;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FTextView // class FTextView
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -32,6 +32,7 @@
#include <cstddef> #include <cstddef>
#include <limits> #include <limits>
#include <unordered_map>
#include <string> #include <string>
#define null nullptr #define null nullptr
@ -103,6 +104,51 @@ struct getPrecision
} }
}; };
typedef std::unordered_map<wchar_t, wchar_t> charSubstitution;
#pragma pack(push)
#pragma pack(1)
typedef struct
{
wchar_t code; // character code
wchar_t encoded_code; // encoded output character
FColor fg_color; // foreground color
FColor bg_color; // background color
union attribute
{
struct
{
// Attribute byte #0
uInt8 bold : 1; // bold
uInt8 dim : 1; // dim
uInt8 italic : 1; // italic
uInt8 underline : 1; // underline
uInt8 blink : 1; // blink
uInt8 reverse : 1; // reverse
uInt8 standout : 1; // standout
uInt8 invisible : 1; // invisible
// Attribute byte #1
uInt8 protect : 1; // protect mode
uInt8 crossed_out : 1; // crossed out
uInt8 dbl_underline : 1; // double underline
uInt8 alt_charset : 1; // alternate character set (vt100)
uInt8 pc_charset : 1; // pc character set (CP437)
uInt8 transparent : 1; // transparent
uInt8 trans_shadow : 1; // transparent shadow
uInt8 inherit_bg : 1; // inherit background
// Attribute byte #2
uInt8 no_changes : 1; // no changes required
uInt8 printed : 1; // is printed to VTerm
uInt8 : 6; // padding bits
} bit;
uInt8 byte[3];
} attr;
} charData;
#pragma pack(pop)
namespace fc namespace fc
{ {
#pragma pack(push) #pragma pack(push)

View File

@ -57,9 +57,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "final/fc.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/fcolorpair.h"
// Preprocessing handler macro // Preprocessing handler macro
#define F_PREPROC_HANDLER(i,h) \ #define F_PREPROC_HANDLER(i,h) \
@ -70,10 +69,19 @@ namespace finalcut
{ {
// class forward declaration // class forward declaration
class FColorPair;
class FKeyboard;
class FMouseControl;
class FPoint;
class FRect;
class FSize;
class FString;
class FSystem;
class FTerm;
class FTermBuffer; class FTermBuffer;
class FTermDebugData;
class FWidget; class FWidget;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FVTerm // class FVTerm
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -92,7 +100,6 @@ class FVTerm
uInt trans_count; // Number of transparent characters uInt trans_count; // Number of transparent characters
} line_changes; } line_changes;
typedef FOptiAttr::charData charData;
typedef void (FVTerm::*FPreprocessingHandler)(); typedef void (FVTerm::*FPreprocessingHandler)();
struct term_area; // forward declaration struct term_area; // forward declaration
@ -420,9 +427,7 @@ class FVTerm
term_area* vwin{nullptr}; // virtual window term_area* vwin{nullptr}; // virtual window
private: private:
// Typedef and Enumeration // Enumeration
typedef FTermcap::tcap_map termcap_map;
enum exit_state enum exit_state
{ {
not_used, not_used,
@ -431,8 +436,8 @@ class FVTerm
}; };
// Constants // Constants
// Buffer size for character output on the terminal
static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768; static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768;
// Buffer size for character output on the terminal
// Methods // Methods
void init (bool); void init (bool);
@ -566,7 +571,7 @@ inline FVTerm& FVTerm::operator << (const std::string& string)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FVTerm& FVTerm::operator << \ inline FVTerm& FVTerm::operator << \
(const std::vector<FVTerm::charData>& termString) (const std::vector<charData>& termString)
{ {
print (termString); print (termString);
return *this; return *this;
@ -603,7 +608,7 @@ inline FVTerm::term_area* FVTerm::getVWin() const
{ return vwin; } { return vwin; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FVTerm::charData FVTerm::getAttribute() inline charData FVTerm::getAttribute()
{ return next_attribute; } { return next_attribute; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -99,8 +99,11 @@
#include <vector> #include <vector>
#include "final/fvterm.h" #include "final/fvterm.h"
#include "final/fwidgetcolors.h" #include "final/fobject.h"
#include "final/fpoint.h"
#include "final/frect.h"
#include "final/fsize.h"
#include "final/ftypes.h"
// Callback macros // Callback macros
#define F_FUNCTION_CALLBACK(h) \ #define F_FUNCTION_CALLBACK(h) \
@ -114,8 +117,12 @@ namespace finalcut
{ {
// class forward declaration // class forward declaration
class FStatusBar;
class FMenuBar; class FMenuBar;
class FRect;
class FResizeEvent;
class FSize;
class FStatusBar;
class FWidgetColors;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FWidget // class FWidget

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018 Markus Gans * * Copyright 2018-2019 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -121,7 +121,7 @@ void FOptiAttrTest::classNameTest()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FOptiAttrTest::noArgumentTest() void FOptiAttrTest::noArgumentTest()
{ {
finalcut::FOptiAttr::charData* ch = new finalcut::FOptiAttr::charData(); finalcut::charData* ch = new finalcut::charData();
finalcut::FOptiAttr oa; finalcut::FOptiAttr oa;
oa.initialize(); oa.initialize();
@ -133,7 +133,7 @@ void FOptiAttrTest::noArgumentTest()
CPPUNIT_ASSERT ( oa.isNormal(ch) ); CPPUNIT_ASSERT ( oa.isNormal(ch) );
// Null test // Null test
finalcut::FOptiAttr::charData* ch_null = nullptr; finalcut::charData* 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("") );
@ -207,10 +207,8 @@ void FOptiAttrTest::fakeReverseTest()
oa.set_orig_orig_colors (0); oa.set_orig_orig_colors (0);
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = \ finalcut::charData* from = new finalcut::charData();
new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
finalcut::FOptiAttr::charData* to = \
new finalcut::FOptiAttr::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Gray text on blue background // Gray text on blue background
@ -304,8 +302,8 @@ void FOptiAttrTest::ansiTest()
oa.set_orig_orig_colors (0); oa.set_orig_orig_colors (0);
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -769,8 +767,8 @@ void FOptiAttrTest::vt100Test()
oa.set_orig_orig_colors (0); oa.set_orig_orig_colors (0);
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -1240,8 +1238,8 @@ void FOptiAttrTest::xtermTest()
oa.set_orig_orig_colors (0); oa.set_orig_orig_colors (0);
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -1711,8 +1709,8 @@ void FOptiAttrTest::rxvtTest()
oa.set_orig_orig_colors (0); oa.set_orig_orig_colors (0);
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -2183,8 +2181,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::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -2666,8 +2664,8 @@ void FOptiAttrTest::puttyTest()
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -3139,8 +3137,8 @@ void FOptiAttrTest::teratermTest()
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -3614,8 +3612,8 @@ void FOptiAttrTest::ibmColorTest()
oa.initialize(); oa.initialize();
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold
@ -4055,8 +4053,8 @@ void FOptiAttrTest::wyse50Test()
oa.setTermEnvironment(optiattr_env); oa.setTermEnvironment(optiattr_env);
finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); finalcut::charData* from = new finalcut::charData();
finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); finalcut::charData* to = new finalcut::charData();
CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 );
// Default color + bold // Default color + bold