Fixed a problem for a non-debug compilation

This commit is contained in:
Markus Gans 2018-09-01 19:06:17 +02:00
parent 0c3be5e726
commit c38775f878
5 changed files with 57 additions and 66 deletions

View File

@ -1,180 +1,183 @@
2017-08-08 Markus Gans <guru.mail@muenster.de> 2018-08-31 Markus Gans <guru.mail@muenster.de>
* Fixed a problem for a non-debug compilation
2018-08-08 Markus Gans <guru.mail@muenster.de>
* Added unit test for FTermcapQuirks * Added unit test for FTermcapQuirks
2017-07-29 Markus Gans <guru.mail@muenster.de> 2018-07-29 Markus Gans <guru.mail@muenster.de>
* Added numeric Keypad [/], [*], [-], [+] support * Added numeric Keypad [/], [*], [-], [+] support
* Handling of keys that are substrings of other keys * Handling of keys that are substrings of other keys
* More tests in FKeyboard unit test * More tests in FKeyboard unit test
2017-07-27 Markus Gans <guru.mail@muenster.de> 2018-07-27 Markus Gans <guru.mail@muenster.de>
* The array for keyboard input of UTF-8 characters was * The array for keyboard input of UTF-8 characters was
not long enough for 4 bytes of UTF-8 codes. not long enough for 4 bytes of UTF-8 codes.
* More tests in FKeyboard unit test * More tests in FKeyboard unit test
2017-07-22 Markus Gans <guru.mail@muenster.de> 2018-07-22 Markus Gans <guru.mail@muenster.de>
* Added unit test for FKeyboard * Added unit test for FKeyboard
2017-07-15 Markus Gans <guru.mail@muenster.de> 2018-07-15 Markus Gans <guru.mail@muenster.de>
* Keyboard functions are now in a separate class * Keyboard functions are now in a separate class
* Fix Parameter passing in term::init_OptiAttr * Fix Parameter passing in term::init_OptiAttr
2017-07-08 Markus Gans <guru.mail@muenster.de> 2018-07-08 Markus Gans <guru.mail@muenster.de>
* Extension of the unit test of FOptiMove * Extension of the unit test of FOptiMove
2017-07-01 Markus Gans <guru.mail@muenster.de> 2018-07-01 Markus Gans <guru.mail@muenster.de>
* All in FOptiMove required termcap values can now be passed * All in FOptiMove required termcap values can now be passed
with a single struct with a single struct
2017-06-25 Markus Gans <guru.mail@muenster.de> 2018-06-25 Markus Gans <guru.mail@muenster.de>
* All termcap values required in FOptiAttr can now be passed * All termcap values required in FOptiAttr can now be passed
with a single struct with a single struct
2017-06-17 Markus Gans <guru.mail@muenster.de> 2018-06-17 Markus Gans <guru.mail@muenster.de>
* Added special console options for FreeBSD, NetBSD and OpenBSD * Added special console options for FreeBSD, NetBSD and OpenBSD
2017-06-12 Markus Gans <guru.mail@muenster.de> 2018-06-12 Markus Gans <guru.mail@muenster.de>
* Linux functions from FTerm moved into the FTermLinux class * Linux functions from FTerm moved into the FTermLinux class
2017-05-27 Markus Gans <guru.mail@muenster.de> 2018-05-27 Markus Gans <guru.mail@muenster.de>
* Move FreeBSD, NetBSD and OpenBSD functions to separate classes * Move FreeBSD, NetBSD and OpenBSD functions to separate classes
2017-05-20 Markus Gans <guru.mail@muenster.de> 2018-05-20 Markus Gans <guru.mail@muenster.de>
* Methods outsourcing from FTerm to FTermXTerminal * Methods outsourcing from FTerm to FTermXTerminal
2017-05-06 Markus Gans <guru.mail@muenster.de> 2018-05-06 Markus Gans <guru.mail@muenster.de>
* Some protected data members in FTerm moved to private * Some protected data members in FTerm moved to private
2017-05-03 Markus Gans <guru.mail@muenster.de> 2018-05-03 Markus Gans <guru.mail@muenster.de>
* Fix resetColorMap in FTerm * Fix resetColorMap in FTerm
2017-05-02 Markus Gans <guru.mail@muenster.de> 2018-05-02 Markus Gans <guru.mail@muenster.de>
* Outsourcing of data from FTerm to the classes FTermios, * Outsourcing of data from FTerm to the classes FTermios,
FTermDetection and FTermcapQuirks FTermDetection and FTermcapQuirks
2017-04-19 Markus Gans <guru.mail@muenster.de> 2018-04-19 Markus Gans <guru.mail@muenster.de>
* Placing the terminal types in FTerm in a separate structure * Placing the terminal types in FTerm in a separate structure
2017-04-15 Markus Gans <guru.mail@muenster.de> 2018-04-15 Markus Gans <guru.mail@muenster.de>
* Fake-reverse bugfix in FOptiAttr * Fake-reverse bugfix in FOptiAttr
* Strict use of fc::colornames in FOptiAttr * Strict use of fc::colornames in FOptiAttr
* Stream support for FPoint and FRect * Stream support for FPoint and FRect
2017-04-11 Markus Gans <guru.mail@muenster.de> 2018-04-11 Markus Gans <guru.mail@muenster.de>
* Remove Cygwin bold color quirks fix in FOptiAttr * Remove Cygwin bold color quirks fix in FOptiAttr
* Added unit test for FOptiAttr * Added unit test for FOptiAttr
2017-04-08 Markus Gans <guru.mail@muenster.de> 2018-04-08 Markus Gans <guru.mail@muenster.de>
* Improved Linux terminal quirks * Improved Linux terminal quirks
* Improvement in class FOptiAttr * Improvement in class FOptiAttr
2017-04-02 Markus Gans <guru.mail@muenster.de> 2018-04-02 Markus Gans <guru.mail@muenster.de>
* Improved cygwin terminal quirks * Improved cygwin terminal quirks
* Optimized character set switching in FOptiAttr * Optimized character set switching in FOptiAttr
2017-03-30 Markus Gans <guru.mail@muenster.de> 2018-03-30 Markus Gans <guru.mail@muenster.de>
* Added unit test for FOptiMove * Added unit test for FOptiMove
2017-03-28 Markus Gans <guru.mail@muenster.de> 2018-03-28 Markus Gans <guru.mail@muenster.de>
* Add boundary check to FOptiMove * Add boundary check to FOptiMove
2017-03-25 Markus Gans <guru.mail@muenster.de> 2018-03-25 Markus Gans <guru.mail@muenster.de>
* Added unit test for the mouse classes * Added unit test for the mouse classes
* Fixed small parsing errors with mouse events * Fixed small parsing errors with mouse events
2017-03-17 Markus Gans <guru.mail@muenster.de> 2018-03-17 Markus Gans <guru.mail@muenster.de>
* Added unit test for FObject * Added unit test for FObject
* Some minor bug fixes in FObject * Some minor bug fixes in FObject
2017-03-13 Markus Gans <guru.mail@muenster.de> 2018-03-13 Markus Gans <guru.mail@muenster.de>
* Added unit test for FRect * Added unit test for FRect
2017-03-11 Markus Gans <guru.mail@muenster.de> 2018-03-11 Markus Gans <guru.mail@muenster.de>
* Added unit test for FPoint * Added unit test for FPoint
2017-03-10 Markus Gans <guru.mail@muenster.de> 2018-03-10 Markus Gans <guru.mail@muenster.de>
* Unit tests for the FString class completed * Unit tests for the FString class completed
* Minor bug fixes in FString * Minor bug fixes in FString
2017-02-25 Markus Gans <guru.mail@muenster.de> 2018-02-25 Markus Gans <guru.mail@muenster.de>
* First CppUnit tests implemented * First CppUnit tests implemented
2017-02-22 Markus Gans <guru.mail@muenster.de> 2018-02-22 Markus Gans <guru.mail@muenster.de>
* Generalize mouse event passing in FMenuItem * Generalize mouse event passing in FMenuItem
2017-02-19 Markus Gans <guru.mail@muenster.de> 2018-02-19 Markus Gans <guru.mail@muenster.de>
* Refactoring FTerm::init_termcaps * Refactoring FTerm::init_termcaps
* Refactoring FTerm::init_encoding * Refactoring FTerm::init_encoding
2017-02-18 Markus Gans <guru.mail@muenster.de> 2018-02-18 Markus Gans <guru.mail@muenster.de>
* Avoid scroll bar overshooting * Avoid scroll bar overshooting
* Refactoring FListView::onMouseMove * Refactoring FListView::onMouseMove
* Refactoring FDialog::initDialogMenu * Refactoring FDialog::initDialogMenu
2017-02-17 Markus Gans <guru.mail@muenster.de> 2018-02-17 Markus Gans <guru.mail@muenster.de>
* Generalize scroll functions in FTextView * Generalize scroll functions in FTextView
* Refactoring FButtonGroup::drawLabel * Refactoring FButtonGroup::drawLabel
* Refactoring FToggleButton::drawLabel * Refactoring FToggleButton::drawLabel
2017-02-11 Markus Gans <guru.mail@muenster.de> 2018-02-11 Markus Gans <guru.mail@muenster.de>
* Refactoring FWidget::focusNextChild and FWidget::focusPrevChild * Refactoring FWidget::focusNextChild and FWidget::focusPrevChild
* Refactoring FListView::onWheel * Refactoring FListView::onWheel
* Refactoring FListView::drawColumnLabels * Refactoring FListView::drawColumnLabels
* Refactoring FTerm::getSystemTermType * Refactoring FTerm::getSystemTermType
* Rename getTermName() to getTermFileName() * Rename getTermName() to getTermFileName()
2017-02-10 Markus Gans <guru.mail@muenster.de> 2018-02-10 Markus Gans <guru.mail@muenster.de>
* Refactoring FOptiMove::verticalMove and FOptiMove::horizontalMove * Refactoring FOptiMove::verticalMove and FOptiMove::horizontalMove
* Refactoring FVTerm::getCharacter * Refactoring FVTerm::getCharacter
* Refactoring FWidget::drawBorder * Refactoring FWidget::drawBorder
2017-02-02 Markus Gans <guru.mail@muenster.de> 2018-02-02 Markus Gans <guru.mail@muenster.de>
* Avoids flickering when redrawing a focused widget * Avoids flickering when redrawing a focused widget
2017-01-31 Markus Gans <guru.mail@muenster.de> 2018-01-31 Markus Gans <guru.mail@muenster.de>
* Refactoring FSwitch::drawCheckButton * Refactoring FSwitch::drawCheckButton
* Refactoring FWidget::redraw * Refactoring FWidget::redraw
* Refactoring FMessageBox::init * Refactoring FMessageBox::init
* Refactoring FFileDialog::init * Refactoring FFileDialog::init
2017-01-30 Markus Gans <guru.mail@muenster.de> 2018-01-30 Markus Gans <guru.mail@muenster.de>
* Refactoring FLabel::draw * Refactoring FLabel::draw
* Refactoring FFileDialog::readDir * Refactoring FFileDialog::readDir
2017-01-28 Markus Gans <guru.mail@muenster.de> 2018-01-28 Markus Gans <guru.mail@muenster.de>
* Refactoring FApplication::processKeyboardEvent * Refactoring FApplication::processKeyboardEvent
* Shorter methods and a fix for recreating new windows * Shorter methods and a fix for recreating new windows
in the window example in the window example
2017-01-25 Markus Gans <guru.mail@muenster.de> 2018-01-25 Markus Gans <guru.mail@muenster.de>
* UTF-8 fix for Solaris * UTF-8 fix for Solaris
2017-01-24 Markus Gans <guru.mail@muenster.de> 2018-01-24 Markus Gans <guru.mail@muenster.de>
* Fixes compiler errors for latest Cygwin versions * Fixes compiler errors for latest Cygwin versions
* Widget color scheme settings moved to a separate class * Widget color scheme settings moved to a separate class
* The color palette redefinition now has its own class * The color palette redefinition now has its own class
2017-01-21 Markus Gans <guru.mail@muenster.de> 2018-01-21 Markus Gans <guru.mail@muenster.de>
* The Final Cut can now also be compiled under Cygwin * The Final Cut can now also be compiled under Cygwin
* Fixed bug in FScrollView::scrollTo * Fixed bug in FScrollView::scrollTo
* Refactoring FStatusBar::drawKeys * Refactoring FStatusBar::drawKeys
* Refactoring FListView::drawListLine * Refactoring FListView::drawListLine
2017-01-17 Markus Gans <guru.mail@muenster.de> 2018-01-17 Markus Gans <guru.mail@muenster.de>
* Small array optimizations in the examples * Small array optimizations in the examples
2017-01-14 Markus Gans <guru.mail@muenster.de> 2018-01-14 Markus Gans <guru.mail@muenster.de>
* Mouse functions are now in a separate class * Mouse functions are now in a separate class
2017-01-05 Markus Gans <guru.mail@muenster.de> 2018-01-05 Markus Gans <guru.mail@muenster.de>
* Refactoring FVTerm::restoreVTerm * Refactoring FVTerm::restoreVTerm
* Fixed buffer size in FOptiMove * Fixed buffer size in FOptiMove
2017-01-03 Markus Gans <guru.mail@muenster.de> 2018-01-03 Markus Gans <guru.mail@muenster.de>
* Refactoring FOptiMove::relativeMove * Refactoring FOptiMove::relativeMove
* Refactoring attribute settings in FOptiAttr * Refactoring attribute settings in FOptiAttr
* Refactoring FTerm::parseKeyString and timeout settings * Refactoring FTerm::parseKeyString and timeout settings
2017-01-02 Markus Gans <guru.mail@muenster.de> 2018-01-02 Markus Gans <guru.mail@muenster.de>
* Refactoring of secondary device attributes parsing * Refactoring of secondary device attributes parsing
* Small menu improvements * Small menu improvements

View File

@ -179,9 +179,7 @@ class FTermLinux
static unimapdesc screen_unicode_map; static unimapdesc screen_unicode_map;
static ColorMap saved_color_map; static ColorMap saved_color_map;
static ColorMap cmap; static ColorMap cmap;
#if DEBUG
static int framebuffer_bpp; static int framebuffer_bpp;
#endif
#endif // defined(__linux__) #endif // defined(__linux__)
}; };
#pragma pack(pop) #pragma pack(pop)

View File

@ -2063,9 +2063,13 @@ void FTerm::initOSspecifics()
#if defined(__linux__) #if defined(__linux__)
linux->setFTermDetection(term_detection); linux->setFTermDetection(term_detection);
linux->init(); // Initialize Linux console linux->init(); // Initialize Linux console
#if DEBUG
framebuffer_bpp = linux->getFramebufferBpp(); framebuffer_bpp = linux->getFramebufferBpp();
#endif #endif
#endif
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
if ( init_values.meta_sends_escape ) if ( init_values.meta_sends_escape )
freebsd->enableMetaSendsEscape(); freebsd->enableMetaSendsEscape();

View File

@ -45,10 +45,7 @@
fc::linuxConsoleCursorStyle FTermLinux::linux_console_cursor_style; fc::linuxConsoleCursorStyle FTermLinux::linux_console_cursor_style;
FTermLinux::ColorMap FTermLinux::saved_color_map; FTermLinux::ColorMap FTermLinux::saved_color_map;
FTermLinux::ColorMap FTermLinux::cmap; FTermLinux::ColorMap FTermLinux::cmap;
#if DEBUG
int FTermLinux::framebuffer_bpp = -1; int FTermLinux::framebuffer_bpp = -1;
#endif
#endif // defined(__linux__) #endif // defined(__linux__)
@ -172,15 +169,11 @@ void FTermLinux::init()
setCursorStyle (fc::underscore_cursor, true); setCursorStyle (fc::underscore_cursor, true);
// Framebuffer color depth in bits per pixel // Framebuffer color depth in bits per pixel
int bpp = getFramebuffer_bpp(); framebuffer_bpp = getFramebuffer_bpp();
// More than 4 bits per pixel and the font uses the blink-bit // More than 4 bits per pixel and the font uses the blink-bit
if ( bpp >= 4 && screen_font.charcount <= 256 ) if ( framebuffer_bpp >= 4 && screen_font.charcount <= 256 )
FTermcap::max_color = 16; FTermcap::max_color = 16;
#if DEBUG
framebuffer_bpp = bpp;
#endif
} }
FTerm::detectTermSize(); FTerm::detectTermSize();

View File

@ -227,7 +227,6 @@ void FTermcapQuirksTest::classNameTest()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermcapQuirksTest::generalTest() void FTermcapQuirksTest::generalTest()
{ {
const int last_item = int(sizeof(test::tcap) / sizeof(test::tcap[0])) - 1; const int last_item = int(sizeof(test::tcap) / sizeof(test::tcap[0])) - 1;
test::tcap_map* caps = new test::tcap_map[last_item]; test::tcap_map* caps = new test::tcap_map[last_item];
@ -287,6 +286,7 @@ void FTermcapQuirksTest::generalTest()
, C_STR(CSI "29m") ); , C_STR(CSI "29m") );
delete[] caps; delete[] caps;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermcapQuirksTest::xtermTest() void FTermcapQuirksTest::xtermTest()
{ {
@ -304,13 +304,6 @@ void FTermcapQuirksTest::xtermTest()
quirks.setFTermDetection (&detect); quirks.setFTermDetection (&detect);
quirks.terminalFixup(); quirks.terminalFixup();
/*
printf ("\n(%s)\n", printSequence(caps[fc::t_initialize_color].string).c_str());
printf ("\n(%s)\n", printSequence(C_STR(OSC "4;%p1%d;rgb:"
"%p2%{255}%*%{1000}%/%2.2X/"
"%p3%{255}%*%{1000}%/%2.2X/"
"%p4%{255}%*%{1000}%/%2.2X" ESC "\\")).c_str());
*/
CPPUNIT_ASSERT_CSTRING ( caps[fc::t_initialize_color].string CPPUNIT_ASSERT_CSTRING ( caps[fc::t_initialize_color].string
, C_STR(OSC "4;%p1%d;rgb:" , C_STR(OSC "4;%p1%d;rgb:"
"%p2%{255}%*%{1000}%/%2.2X/" "%p2%{255}%*%{1000}%/%2.2X/"