Fix metadata

This commit is contained in:
Markus Gans 2020-01-20 21:40:00 +01:00
parent 3e3076838f
commit 06d65ed676
45 changed files with 139 additions and 220 deletions

View File

@ -775,7 +775,7 @@ int getTermY() const;
const FPoint getTermPos() const; const FPoint getTermPos() const;
virtual void setX (int x, bool adjust = true); virtual void setX (int x, bool adjust = true);
virtual void setY (int y, bool adjust = true); virtual void setY (int y, bool adjust = true);
virtual void setPos (const Fpoint& p, bool adjust = true); virtual void setPos (const FPoint& p, bool adjust = true);
``` ```
If you set the value of `adjust` to `false` when calling `setX()`, If you set the value of `adjust` to `false` when calling `setX()`,
@ -878,7 +878,7 @@ const FRect& getGeometryWithShadow();
const FRect& getTermGeometryWithShadow(); const FRect& getTermGeometryWithShadow();
virtual void setSize (const FSize& size, bool adjust = true); virtual void setSize (const FSize& size, bool adjust = true);
virtual void setGeometry (const FRect& box, bool adjust = true); virtual void setGeometry (const FRect& box, bool adjust = true);
virtual void setGeometry (const Fpoint& p, const FSize& s, bool adjust = true); virtual void setGeometry (const FPoint& p, const FSize& s, bool adjust = true);
virtual void setShadowSize (const FSize& size); virtual void setShadowSize (const FSize& size);
``` ```

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -79,6 +79,9 @@ void Mandelbrot::draw()
int Cols = int(getClientWidth()); int Cols = int(getClientWidth());
int Lines = int(getClientHeight()); int Lines = int(getClientHeight());
if ( Cols < 2 || Lines < 2 )
return;
double dX = (x_max - x_min) / (Cols - 1); double dX = (x_max - x_min) / (Cols - 1);
double dY = (y_max - y_min) / Lines; double dY = (y_max - y_min) / Lines;

View File

@ -779,7 +779,7 @@ void MyDialog::cb_about (finalcut::FWidget*, FDataPtr)
finalcut::FMessageBox info ( "About" finalcut::FMessageBox info ( "About"
, line + L" The Final Cut " + line + "\n\n" , line + L" The Final Cut " + line + "\n\n"
L"Version " + libver + "\n\n" L"Version " + libver + "\n\n"
L"(c) 2019 by Markus Gans" L"(c) 2020 by Markus Gans"
, finalcut::FMessageBox::Ok, 0, 0, this ); , finalcut::FMessageBox::Ok, 0, 0, this );
info.setCenterText(); info.setCenterText();
info.show(); info.show();
@ -1000,7 +1000,7 @@ int main (int argc, char* argv[])
const finalcut::FString ver{F_VERSION}; // Library version const finalcut::FString ver{F_VERSION}; // Library version
const finalcut::FString title { "The FINAL CUT " const finalcut::FString title { "The FINAL CUT "
+ ver + ver
+ " (C) 2019 by Markus Gans" }; + " (C) 2020 by Markus Gans" };
// Create the application object app // Create the application object app
finalcut::FApplication app(argc, argv); finalcut::FApplication app(argc, argv);

BIN
src/.swp Normal file

Binary file not shown.

View File

@ -31,6 +31,7 @@
#include "final/fmouse.h" #include "final/fmouse.h"
#include "final/fstartoptions.h" #include "final/fstartoptions.h"
#include "final/fstatusbar.h" #include "final/fstatusbar.h"
#include "final/ftermdata.h"
#include "final/ftermios.h" #include "final/ftermios.h"
#include "final/fwidgetcolors.h" #include "final/fwidgetcolors.h"
#include "final/fwindow.h" #include "final/fwindow.h"
@ -75,8 +76,13 @@ FApplication::FApplication ( const int& _argc
, app_argv{_argv} , app_argv{_argv}
{ {
if ( app_object ) if ( app_object )
throw std::runtime_error( "FApplication: There should be " {
auto ftermdata = getFTerm().getFTermData();
ftermdata->setExitMessage("FApplication: There should be "
"only one application object"); "only one application object");
FApplication::exit(EXIT_FAILURE);
return;
}
app_object = this; app_object = this;
@ -96,6 +102,7 @@ FApplication::~FApplication() // destructor
if ( event_queue ) if ( event_queue )
delete event_queue; delete event_queue;
event_queue = nullptr;
app_object = nullptr; app_object = nullptr;
} }
@ -153,12 +160,6 @@ void FApplication::exitLoop()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::exit (int retcode) void FApplication::exit (int retcode)
{ {
if ( ! app_object ) // no global app object
return;
if ( quit_now ) // don't overwrite quit code
return;
quit_now = true; quit_now = true;
quit_code = retcode; quit_code = retcode;
} }

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 2012-2019 Markus Gans * * Copyright 2012-2020 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 *
@ -917,7 +917,16 @@ void FLineEdit::adjustTextOffset()
char_width_offset = 0; char_width_offset = 0;
if ( cursor_pos < len ) if ( cursor_pos < len )
{
try
{
cursor_char_width = getColumnWidth(print_text[cursor_pos]); cursor_char_width = getColumnWidth(print_text[cursor_pos]);
}
catch (const std::out_of_range& ex)
{
std::cerr << "Out of Range error: " << ex.what() << std::endl;
}
}
if ( len > 0 ) if ( len > 0 )
first_char_width = getColumnWidth(print_text[0]); first_char_width = getColumnWidth(print_text[0]);

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -106,12 +106,22 @@ bool FSize::isEmpty() const
void FSize::scaleBy (int dx, int dy) void FSize::scaleBy (int dx, int dy)
{ {
if ( dx < 0 ) if ( dx < 0 )
{
if ( std::size_t(-dx) < width )
width -= std::size_t(-dx); width -= std::size_t(-dx);
else
width = std::size_t(-dx) - width;
}
else else
width += std::size_t(dx); width += std::size_t(dx);
if ( dx < 0 ) if ( dy < 0 )
{
if ( std::size_t(-dy) < height )
height -= std::size_t(-dy); height -= std::size_t(-dy);
else
height = std::size_t(-dy) - height;
}
else else
height += std::size_t(dy); height += std::size_t(dy);
} }

View File

@ -2440,6 +2440,12 @@ void FTerm::finish()
if ( data->isNewFont() || data->isVGAFont() ) if ( data->isNewFont() || data->isVGAFont() )
setOldFont(); setOldFont();
// Print exit message
const auto& exit_message = data->getExitMessage();
if ( ! exit_message.isEmpty() )
std::cerr << exit_message << std::endl;
deallocationValues(); deallocationValues();
} }

View File

@ -430,7 +430,16 @@ std::size_t getColumnWidth (const FString& s, std::size_t pos)
pos = length; pos = length;
for (std::size_t i{0}; i < pos; i++) for (std::size_t i{0}; i < pos; i++)
{
try
{
column_width += getColumnWidth(s[i]); column_width += getColumnWidth(s[i]);
}
catch (const std::out_of_range& ex)
{
std::cerr << "Out of Range error: " << ex.what() << std::endl;
}
}
return column_width; return column_width;
} }

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-2019 Markus Gans * * Copyright 2015-2020 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,7 +59,7 @@ uInt FWidget::modal_dialog_counter{};
// constructors and destructor // constructors and destructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FWidget::FWidget (FWidget* parent, bool disable_alt_screen) FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
: FVTerm(bool(! parent), disable_alt_screen) : FVTerm( ! (bool(parent) || rootObject), disable_alt_screen)
, FObject(parent) , FObject(parent)
{ {
// init bit field with 0 // init bit field with 0
@ -74,8 +74,14 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
if ( ! parent ) if ( ! parent )
{ {
if ( rootObject ) if ( rootObject )
throw std::runtime_error( "FWidget: No parent defined! " {
auto ftermdata = getFTerm().getFTermData();
ftermdata->setExitMessage("FWidget: No parent defined! "
"There should be only one root object"); "There should be only one root object");
FApplication::exit(EXIT_FAILURE);
return;
}
rootObject = this; rootObject = this;
show_root_widget = nullptr; show_root_widget = nullptr;
redraw_root_widget = nullptr; redraw_root_widget = nullptr;

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-2019 Markus Gans * * Copyright 2013-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2012-2019 Markus Gans * * Copyright 2012-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -24,11 +24,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2019 Markus Gans * * Copyright 2019-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2012-2019 Markus Gans * * Copyright 2012-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2016-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2012-2019 Markus Gans * * Copyright 2012-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 *
* * * *
e Copyright 2014-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@ e Copyright 2014-2019 Markus Gans *
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2017-2019 Markus Gans * * Copyright 2017-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2012-2019 Markus Gans * * Copyright 2012-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2017-2019 Markus Gans * * Copyright 2017-2020 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 *
@ -24,11 +24,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2019 Markus Gans * * Copyright 2019-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2018-2020 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 *
@ -80,6 +80,7 @@ class FTermData final
char* getTermFileName(); char* getTermFileName();
const FString& getXtermFont() const; const FString& getXtermFont() const;
const FString& getXtermTitle() const; const FString& getXtermTitle() const;
const FString& getExitMessage() const;
#if DEBUG #if DEBUG
int getFramebufferBpp() const; int getFramebufferBpp() const;
#endif #endif
@ -120,6 +121,7 @@ class FTermData final
void setTermFileName (const char[]); void setTermFileName (const char[]);
void setXtermFont (const FString&); void setXtermFont (const FString&);
void setXtermTitle (const FString&); void setXtermTitle (const FString&);
void setExitMessage (const FString&);
#if DEBUG #if DEBUG
void setFramebufferBpp (int); void setFramebufferBpp (int);
#endif #endif
@ -131,6 +133,7 @@ class FTermData final
FRect term_geometry{}; // current terminal geometry FRect term_geometry{}; // current terminal geometry
FString xterm_font{}; FString xterm_font{};
FString xterm_title{}; FString xterm_title{};
FString exit_message{};
fc::encoding term_encoding{fc::UNKNOWN}; fc::encoding term_encoding{fc::UNKNOWN};
int fd_tty{-1}; // Teletype (tty) file descriptor int fd_tty{-1}; // Teletype (tty) file descriptor
// is still undefined // is still undefined
@ -201,6 +204,10 @@ inline const FString& FTermData::getXtermFont() const
inline const FString& FTermData::getXtermTitle() const inline const FString& FTermData::getXtermTitle() const
{ return xterm_title; } { return xterm_title; }
//----------------------------------------------------------------------
inline const FString& FTermData::getExitMessage() const
{ return exit_message; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#if DEBUG #if DEBUG
inline int FTermData::getFramebufferBpp() const inline int FTermData::getFramebufferBpp() const
@ -351,6 +358,10 @@ inline void FTermData::setXtermFont (const FString& font)
inline void FTermData::setXtermTitle (const FString& title) inline void FTermData::setXtermTitle (const FString& title)
{ xterm_title = title; } { xterm_title = title; }
//----------------------------------------------------------------------
inline void FTermData::setExitMessage (const FString& message)
{ exit_message = message; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#if DEBUG && defined(__linux__) #if DEBUG && defined(__linux__)
inline void FTermData::setFramebufferBpp (int bpp) inline void FTermData::setFramebufferBpp (int bpp)

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-2019 Markus Gans * * Copyright 2018-2020 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,7 +20,6 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
/* Standalone class /* Standalone class
* *
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2014-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2016-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2016-2020 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 *
@ -23,22 +23,22 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
* * 1 *
* FTerm * FVTerm - - -- - - FTerm
* * :
* * :
* * : *
* 1 * * :- - - FString
* FVTerm - - -- - - FString * :
* :
* : * :
* : * * : *
* :- - - FPoint * - - - FPoint
* : * :
* : * :
* : * * : *
* - - - FRect * - - - FRect
* *
*/ */
#ifndef FVTERM_H #ifndef FVTERM_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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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-2019 Markus Gans * * Copyright 2015-2020 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 *
@ -23,11 +23,6 @@
/* Inheritance diagram /* Inheritance diagram
* *
* *
*
* FTerm
*
*
*
* *
* FVTerm FObject * FVTerm FObject
* *

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 2019 Markus Gans * * Copyright 2019-2020 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 *
@ -400,6 +400,16 @@ void FSizeTest::scaleTest()
CPPUNIT_ASSERT ( s1.getWidth() == 15 ); CPPUNIT_ASSERT ( s1.getWidth() == 15 );
CPPUNIT_ASSERT ( s1.getHeight() == 15 ); CPPUNIT_ASSERT ( s1.getHeight() == 15 );
CPPUNIT_ASSERT ( s1 == finalcut::FSize(15, 15) ); CPPUNIT_ASSERT ( s1 == finalcut::FSize(15, 15) );
s1.scaleBy(-20, 0);
CPPUNIT_ASSERT ( s1.getWidth() == 5 );
CPPUNIT_ASSERT ( s1.getHeight() == 15 );
CPPUNIT_ASSERT ( s1 == finalcut::FSize(5, 15) );
s1.scaleBy(0, -20);
CPPUNIT_ASSERT ( s1.getWidth() == 5 );
CPPUNIT_ASSERT ( s1.getHeight() == 5 );
CPPUNIT_ASSERT ( s1 == finalcut::FSize(5, 5) );
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

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-2019 Markus Gans * * Copyright 2018-2020 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 *
@ -97,6 +97,7 @@ void FTermDataTest::defaultDataTest()
CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), C_STR("") ); CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), C_STR("") );
CPPUNIT_ASSERT ( data.getXtermFont() == finalcut::FString() ); CPPUNIT_ASSERT ( data.getXtermFont() == finalcut::FString() );
CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString() ); CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString() );
CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString() );
#if DEBUG #if DEBUG
CPPUNIT_ASSERT ( data.getFramebufferBpp() == -1 ); CPPUNIT_ASSERT ( data.getFramebufferBpp() == -1 );
@ -192,6 +193,10 @@ void FTermDataTest::dataTest()
data.setXtermTitle("Terminal"); data.setXtermTitle("Terminal");
CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString("Terminal") ); CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString("Terminal") );
CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString() );
data.setExitMessage("No tty found");
CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString("No tty found") );
#if DEBUG #if DEBUG
CPPUNIT_ASSERT ( data.getFramebufferBpp() == -1 ); CPPUNIT_ASSERT ( data.getFramebufferBpp() == -1 );
data.setFramebufferBpp(32); data.setFramebufferBpp(32);