Small cleanups
This commit is contained in:
parent
77b76b7a2a
commit
5257beb73a
|
@ -1,3 +1,11 @@
|
||||||
|
Build FINAL CUT with the clang c++ compiler
|
||||||
|
-------------------------------------------
|
||||||
|
openbsd# CXX=clang++ ./build.sh
|
||||||
|
|
||||||
|
Build FINAL CUT with eg++
|
||||||
|
-------------------------
|
||||||
|
openbsd# CXX=eg++ ./build.sh
|
||||||
|
|
||||||
Install egcc on OpenBSD
|
Install egcc on OpenBSD
|
||||||
-----------------------
|
-----------------------
|
||||||
openbsd# pkg_add g++
|
openbsd# pkg_add g++
|
||||||
|
@ -14,7 +22,3 @@ g++-8.3.0:libmpc-0.9p2: ok
|
||||||
g++-8.3.0:gcc-8.3.0: ok
|
g++-8.3.0:gcc-8.3.0: ok
|
||||||
g++-8.3.0: ok
|
g++-8.3.0: ok
|
||||||
|
|
||||||
Build FINAL CUT with eg++
|
|
||||||
-------------------------
|
|
||||||
openbsd# CXX=eg++ ./build.sh
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ How to use the library
|
||||||
At the beginning of this introduction to the Final Cut
|
At the beginning of this introduction to the Final Cut
|
||||||
we will start with a small example.
|
we will start with a small example.
|
||||||
|
|
||||||
The following example creates an empty 30×10 character dialog.
|
The following example creates an empty 30??10 character dialog.
|
||||||
|
|
||||||
**File:** *dialog.cpp*
|
**File:** *dialog.cpp*
|
||||||
```cpp
|
```cpp
|
||||||
|
@ -290,7 +290,7 @@ class dialogWidget : public FDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void onTimer (FTimerEvent* ev) override
|
void onTimer (FTimerEvent* ev) override
|
||||||
{
|
{
|
||||||
if ( id == ev->getTimerId() && n < 9999999999 )
|
if ( id == ev->getTimerId() && n < 9999999999 )
|
||||||
{
|
{
|
||||||
|
@ -699,12 +699,12 @@ class dialogWidget : public FDialog
|
||||||
void setTemperature()
|
void setTemperature()
|
||||||
{
|
{
|
||||||
label.clear();
|
label.clear();
|
||||||
label << t << "°C";
|
label << t << "??C";
|
||||||
label.redraw();
|
label.redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
int t = 20;
|
int t = 20;
|
||||||
FLabel label{FString() << t << "°C", this};
|
FLabel label{FString() << t << "??C", this};
|
||||||
FButton plus {"&+", this};
|
FButton plus {"&+", this};
|
||||||
FButton minus {"&-", this};
|
FButton minus {"&-", this};
|
||||||
};
|
};
|
||||||
|
@ -795,7 +795,7 @@ class dialogWidget : public FDialog
|
||||||
input.setY (ly, false);
|
input.setY (ly, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void adjustSize() override
|
void adjustSize() override
|
||||||
{
|
{
|
||||||
// Calling super class method adjustSize()
|
// Calling super class method adjustSize()
|
||||||
FDialog::adjustSize();
|
FDialog::adjustSize();
|
||||||
|
@ -803,14 +803,14 @@ class dialogWidget : public FDialog
|
||||||
centerDialog();
|
centerDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setSize (const FSize& size, bool) override
|
void setSize (const FSize& size, bool) override
|
||||||
{
|
{
|
||||||
// Calling super class methods setSize() + adjustSize()
|
// Calling super class methods setSize() + adjustSize()
|
||||||
FDialog::setSize (size, false);
|
FDialog::setSize (size, false);
|
||||||
FDialog::adjustSize();
|
FDialog::adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void draw() override
|
void draw() override
|
||||||
{
|
{
|
||||||
adjustWidgets(); // Adjust widgets before drawing
|
adjustWidgets(); // Adjust widgets before drawing
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,28 @@
|
||||||
|
/***********************************************************************
|
||||||
|
* 7segment.cpp - Seven-segment display *
|
||||||
|
* *
|
||||||
|
* This file is part of the Final Cut widget toolkit *
|
||||||
|
* *
|
||||||
|
* Copyright 2012-2019 Markus Gans *
|
||||||
|
* *
|
||||||
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
* as published by the Free Software Foundation; either version 3 of *
|
||||||
|
* the License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* The Final Cut is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU Lesser General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU Lesser General Public *
|
||||||
|
* License along with this program. If not, see *
|
||||||
|
* <http://www.gnu.org/licenses/>. *
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
namespace fc = finalcut::fc;
|
namespace fc = finalcut::fc;
|
||||||
|
@ -35,7 +60,7 @@ class SegmentView : public finalcut::FDialog
|
||||||
// Methods
|
// Methods
|
||||||
void hexEncoding();
|
void hexEncoding();
|
||||||
void get7Segment (const wchar_t);
|
void get7Segment (const wchar_t);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
std::map<wchar_t, sevenSegment> code{};
|
std::map<wchar_t, sevenSegment> code{};
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Button : public finalcut::FButton
|
||||||
void setChecked(bool);
|
void setChecked(bool);
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data Member
|
// Data Member
|
||||||
|
@ -122,8 +122,8 @@ class Calc : public finalcut::FDialog
|
||||||
~Calc();
|
~Calc();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_buttonClicked (finalcut::FWidget*, FDataPtr);
|
void cb_buttonClicked (finalcut::FWidget*, FDataPtr);
|
||||||
|
@ -173,7 +173,7 @@ class Calc : public finalcut::FDialog
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void drawDispay();
|
void drawDispay();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void clear (lDouble&);
|
void clear (lDouble&);
|
||||||
void zero (lDouble&);
|
void zero (lDouble&);
|
||||||
void one (lDouble&);
|
void one (lDouble&);
|
||||||
|
@ -215,7 +215,7 @@ class Calc : public finalcut::FDialog
|
||||||
void setInfixOperator (char);
|
void setInfixOperator (char);
|
||||||
void clearInfixOperator();
|
void clearInfixOperator();
|
||||||
void calcInfixOperator();
|
void calcInfixOperator();
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
const wchar_t* getButtonText (std::size_t);
|
const wchar_t* getButtonText (std::size_t);
|
||||||
void mapKeyFunctions();
|
void mapKeyFunctions();
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ class CheckList : public finalcut::FDialog
|
||||||
void populate();
|
void populate();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_showList (finalcut::FWidget*, FDataPtr);
|
void cb_showList (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@ class Keyboard : public finalcut::FWidget
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
virtual void onAccel (finalcut::FAccelEvent*) override;
|
void onAccel (finalcut::FAccelEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
@ -95,7 +96,7 @@ class Listbox : public FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onClose (FCloseEvent*) override;
|
void onClose (FCloseEvent*) override;
|
||||||
|
|
||||||
// Data Member
|
// Data Member
|
||||||
std::list<double> double_list{};
|
std::list<double> double_list{};
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Listview : public finalcut::FDialog
|
||||||
void populate();
|
void populate();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_showInMessagebox (finalcut::FWidget*, FDataPtr);
|
void cb_showInMessagebox (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
|
@ -44,13 +44,13 @@ class Mandelbrot : public finalcut::FDialog
|
||||||
~Mandelbrot();
|
~Mandelbrot();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,10 @@ class Menu : public finalcut::FDialog
|
||||||
void configureStyleMenuItems();
|
void configureStyleMenuItems();
|
||||||
void configureBorderMenuItems();
|
void configureBorderMenuItems();
|
||||||
void defaultCallback (finalcut::FMenuList*);
|
void defaultCallback (finalcut::FMenuList*);
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_message (finalcut::FWidget*, FDataPtr);
|
void cb_message (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
|
@ -56,10 +56,10 @@ class ColorChooser : public finalcut::FWidget
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onMouseDown (finalcut::FMouseEvent*) override;
|
void onMouseDown (finalcut::FMouseEvent*) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FColor fg_color{fc::White};
|
FColor fg_color{fc::White};
|
||||||
|
@ -195,10 +195,10 @@ class Brushes : public finalcut::FWidget
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onMouseDown (finalcut::FMouseEvent*) override;
|
void onMouseDown (finalcut::FMouseEvent*) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
wchar_t brush{L' '};
|
wchar_t brush{L' '};
|
||||||
|
@ -329,19 +329,19 @@ class MouseDraw : public finalcut::FDialog
|
||||||
void setGeometry (const FPoint&, const FSize&, bool = true) override;
|
void setGeometry (const FPoint&, const FSize&, bool = true) override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawBrush (int, int, bool = false);
|
void drawBrush (int, int, bool = false);
|
||||||
void drawCanvas();
|
void drawCanvas();
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onMouseDown (finalcut::FMouseEvent*) override;
|
void onMouseDown (finalcut::FMouseEvent*) override;
|
||||||
virtual void onMouseMove (finalcut::FMouseEvent*) override;
|
void onMouseMove (finalcut::FMouseEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_colorChanged (finalcut::FWidget*, FDataPtr);
|
void cb_colorChanged (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Scrollview : public finalcut::FScrollView
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_go_east (finalcut::FWidget*, FDataPtr);
|
void cb_go_east (finalcut::FWidget*, FDataPtr);
|
||||||
|
@ -206,7 +206,7 @@ class Scrollviewdemo : public finalcut::FDialog
|
||||||
~Scrollviewdemo();
|
~Scrollviewdemo();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_quit (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
|
void cb_quit (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <vector>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
namespace fc = finalcut::fc;
|
namespace fc = finalcut::fc;
|
||||||
|
@ -52,9 +53,9 @@ class AttribDlg : public finalcut::FDialog
|
||||||
AttribDlg& operator = (const AttribDlg&) = delete;
|
AttribDlg& operator = (const AttribDlg&) = delete;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent*) override;
|
void onKeyPress (finalcut::FKeyEvent*) override;
|
||||||
virtual void onWheel (finalcut::FWheelEvent*) override;
|
void onWheel (finalcut::FWheelEvent*) override;
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_next (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
|
void cb_next (finalcut::FWidget* = nullptr, FDataPtr = nullptr);
|
||||||
|
@ -65,7 +66,7 @@ class AttribDlg : public finalcut::FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
finalcut::FButton next_button{"&Next >", this};
|
finalcut::FButton next_button{"&Next >", this};
|
||||||
|
@ -210,7 +211,7 @@ class AttribDemo : public finalcut::FWidget
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onWheel (finalcut::FWheelEvent* ev) override
|
void onWheel (finalcut::FWheelEvent* ev) override
|
||||||
{
|
{
|
||||||
auto p = static_cast<AttribDlg*>(getParentWidget());
|
auto p = static_cast<AttribDlg*>(getParentWidget());
|
||||||
|
|
||||||
|
@ -235,7 +236,7 @@ class AttribDemo : public finalcut::FWidget
|
||||||
void printStandout();
|
void printStandout();
|
||||||
void printInvisible();
|
void printInvisible();
|
||||||
void printProtected();
|
void printProtected();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Data Member
|
// Data Member
|
||||||
int colors;
|
int colors;
|
||||||
|
|
|
@ -37,11 +37,11 @@ class Timer : public finalcut::FWidget
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onTimer (finalcut::FTimerEvent*) override;
|
void onTimer (finalcut::FTimerEvent*) override;
|
||||||
virtual void onAccel (finalcut::FAccelEvent*) override;
|
void onAccel (finalcut::FAccelEvent*) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -60,10 +60,10 @@ class Transparent : public finalcut::FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent* ev) override;
|
void onKeyPress (finalcut::FKeyEvent* ev) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
trans_type type;
|
trans_type type;
|
||||||
|
@ -166,13 +166,13 @@ class MainWindow : public finalcut::FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
virtual void onShow (finalcut::FShowEvent*) override;
|
void onShow (finalcut::FShowEvent*) override;
|
||||||
virtual void onTimer (finalcut::FTimerEvent*) override;
|
void onTimer (finalcut::FTimerEvent*) override;
|
||||||
virtual void onKeyPress (finalcut::FKeyEvent* ev) override
|
void onKeyPress (finalcut::FKeyEvent* ev) override
|
||||||
{
|
{
|
||||||
if ( ! ev )
|
if ( ! ev )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -135,7 +135,7 @@ class Treeview : public finalcut::FDialog
|
||||||
struct TreeItem; // forward declaration
|
struct TreeItem; // forward declaration
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ui.cpp - Example of a user interface *
|
* 7segment.cpp - Seven-segment display example *
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
|
@ -21,8 +21,10 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
|
@ -55,8 +57,8 @@ class ProgressDialog : public finalcut::FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onShow (finalcut::FShowEvent*) override;
|
void onShow (finalcut::FShowEvent*) override;
|
||||||
virtual void onTimer (finalcut::FTimerEvent*) override;
|
void onTimer (finalcut::FTimerEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_reset_bar (finalcut::FWidget*, FDataPtr);
|
void cb_reset_bar (finalcut::FWidget*, FDataPtr);
|
||||||
|
@ -204,7 +206,7 @@ class TextWindow : public finalcut::FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
finalcut::FTextView scrollText{this};
|
finalcut::FTextView scrollText{this};
|
||||||
|
@ -284,10 +286,10 @@ class MyDialog : public finalcut::FDialog
|
||||||
void initButtons();
|
void initButtons();
|
||||||
void initLabels();
|
void initLabels();
|
||||||
void initWidgetsCallbacks();
|
void initWidgetsCallbacks();
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_noFunctionMsg (finalcut::FWidget*, FDataPtr);
|
void cb_noFunctionMsg (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
|
@ -53,8 +53,8 @@ class Watch : public finalcut::FDialog
|
||||||
void printTime();
|
void printTime();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onTimer (finalcut::FTimerEvent*) override;
|
void onTimer (finalcut::FTimerEvent*) override;
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_clock (finalcut::FWidget*, FDataPtr);
|
void cb_clock (finalcut::FWidget*, FDataPtr);
|
||||||
|
@ -62,7 +62,7 @@ class Watch : public finalcut::FDialog
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data Members
|
// Data Members
|
||||||
|
|
|
@ -52,11 +52,11 @@ class SmallWindow : public finalcut::FDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onShow (finalcut::FShowEvent*) override;
|
void onShow (finalcut::FShowEvent*) override;
|
||||||
virtual void onTimer (finalcut::FTimerEvent*) override;
|
void onTimer (finalcut::FTimerEvent*) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
finalcut::FLabel left_arrow{this};
|
finalcut::FLabel left_arrow{this};
|
||||||
|
@ -209,12 +209,12 @@ class Window : public finalcut::FDialog
|
||||||
void configureFileMenuItems();
|
void configureFileMenuItems();
|
||||||
void configureDialogButtons();
|
void configureDialogButtons();
|
||||||
void activateWindow (finalcut::FDialog*);
|
void activateWindow (finalcut::FDialog*);
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
void addClickedCallback (finalcut::FWidget*, WindowCallback);
|
void addClickedCallback (finalcut::FWidget*, WindowCallback);
|
||||||
void addClickedCallback (finalcut::FWidget*, FAppCallback);
|
void addClickedCallback (finalcut::FWidget*, FAppCallback);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_createWindows (finalcut::FWidget*, FDataPtr);
|
void cb_createWindows (finalcut::FWidget*, FDataPtr);
|
||||||
|
|
|
@ -201,7 +201,7 @@ const std::size_t lastKeyItem = \
|
||||||
std::size_t((sizeof(vt100_key_to_utf8) / sizeof(vt100_key_to_utf8[0])) - 1);
|
std::size_t((sizeof(vt100_key_to_utf8) / sizeof(vt100_key_to_utf8[0])) - 1);
|
||||||
|
|
||||||
|
|
||||||
wchar_t cp437_to_ucs[][2] =
|
wchar_t cp437_to_ucs[][2] =
|
||||||
{
|
{
|
||||||
{0x00, 0x0000}, // null
|
{0x00, 0x0000}, // null
|
||||||
{0x01, 0x263a}, // white smiling face
|
{0x01, 0x263a}, // white smiling face
|
||||||
|
|
|
@ -449,12 +449,12 @@ void FFileDialog::clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int FFileDialog::numOfDirs()
|
long FFileDialog::numOfDirs()
|
||||||
{
|
{
|
||||||
if ( dir_entries.empty() )
|
if ( dir_entries.empty() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int n = std::count_if ( std::begin(dir_entries)
|
long n = std::count_if ( std::begin(dir_entries)
|
||||||
, std::end(dir_entries)
|
, std::end(dir_entries)
|
||||||
, [] (dir_entry& entry)
|
, [] (dir_entry& entry)
|
||||||
{
|
{
|
||||||
|
@ -468,7 +468,7 @@ int FFileDialog::numOfDirs()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FFileDialog::sortDir()
|
void FFileDialog::sortDir()
|
||||||
{
|
{
|
||||||
int start, dir_num;
|
long start, dir_num;
|
||||||
|
|
||||||
if ( std::strcmp((*dir_entries.begin()).name, "..") == 0 )
|
if ( std::strcmp((*dir_entries.begin()).name, "..") == 0 )
|
||||||
start = 1;
|
start = 1;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include "final/fsize.h"
|
#include "final/fsize.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
#include "final/fcharmap.h"
|
#include "final/fcharmap.h"
|
||||||
#include "final/fsystem.h"
|
#include "final/fsystem.h"
|
||||||
|
@ -573,16 +575,19 @@ bool FTermLinux::getScreenFont()
|
||||||
if ( fsystem )
|
if ( fsystem )
|
||||||
ret = fsystem->ioctl (fd_tty, KDFONTOP, &font);
|
ret = fsystem->ioctl (fd_tty, KDFONTOP, &font);
|
||||||
|
|
||||||
if ( ret == 0 )
|
if ( ret != 0 )
|
||||||
{
|
{
|
||||||
|
if ( font.data )
|
||||||
|
delete[] font.data;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
screen_font.width = font.width;
|
screen_font.width = font.width;
|
||||||
screen_font.height = font.height;
|
screen_font.height = font.height;
|
||||||
screen_font.charcount = font.charcount;
|
screen_font.charcount = font.charcount;
|
||||||
screen_font.data = font.data;
|
screen_font.data = font.data;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -628,7 +628,6 @@ void FTermXTerminal::resetXTermColorMap()
|
||||||
oscPostfix();
|
oscPostfix();
|
||||||
std::fflush(stdout);
|
std::fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
#include "final/fevent.h"
|
#include "final/fevent.h"
|
||||||
#include "final/fmenubar.h"
|
#include "final/fmenubar.h"
|
||||||
|
|
|
@ -109,7 +109,7 @@ class FApplication : public FWidget
|
||||||
FApplication& operator = (const FApplication&) = delete;
|
FApplication& operator = (const FApplication&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
int getArgc() const;
|
int getArgc() const;
|
||||||
char** getArgv() const;
|
char** getArgv() const;
|
||||||
static FApplication* getApplicationObject();
|
static FApplication* getApplicationObject();
|
||||||
|
@ -184,7 +184,7 @@ class FApplication : public FWidget
|
||||||
void processResizeEvent();
|
void processResizeEvent();
|
||||||
void processCloseWidget();
|
void processCloseWidget();
|
||||||
bool processNextEvent();
|
bool processNextEvent();
|
||||||
virtual void performTimerAction ( const FObject*
|
void performTimerAction ( const FObject*
|
||||||
, const FEvent* ) override;
|
, const FEvent* ) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
|
|
|
@ -85,7 +85,7 @@ class FButton : public FWidget
|
||||||
FButton& operator = (const FString&);
|
FButton& operator = (const FString&);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FString& getText();
|
FString& getText();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
|
@ -99,13 +99,13 @@ class FButton : public FWidget
|
||||||
bool setNoUnderline(bool);
|
bool setNoUnderline(bool);
|
||||||
bool setNoUnderline();
|
bool setNoUnderline();
|
||||||
bool unsetNoUnderline();
|
bool unsetNoUnderline();
|
||||||
virtual bool setEnable(bool) override;
|
bool setEnable(bool) override;
|
||||||
virtual bool setEnable() override;
|
bool setEnable() override;
|
||||||
virtual bool unsetEnable() override;
|
bool unsetEnable() override;
|
||||||
virtual bool setDisable() override;
|
bool setDisable() override;
|
||||||
virtual bool setFocus(bool) override;
|
bool setFocus(bool) override;
|
||||||
virtual bool setFocus() override;
|
bool setFocus() override;
|
||||||
virtual bool unsetFocus() override;
|
bool unsetFocus() override;
|
||||||
bool setFlat(bool);
|
bool setFlat(bool);
|
||||||
bool setFlat();
|
bool setFlat();
|
||||||
bool unsetFlat();
|
bool unsetFlat();
|
||||||
|
@ -127,17 +127,17 @@ class FButton : public FWidget
|
||||||
bool hasClickAnimation();
|
bool hasClickAnimation();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onTimer (FTimerEvent*) override;
|
void onTimer (FTimerEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Constants
|
// Constants
|
||||||
|
@ -154,7 +154,7 @@ class FButton : public FWidget
|
||||||
void drawMarginRight();
|
void drawMarginRight();
|
||||||
void drawTopBottomBackground();
|
void drawTopBottomBackground();
|
||||||
void drawButtonTextLine (wchar_t[]);
|
void drawButtonTextLine (wchar_t[]);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void updateStatusBar();
|
void updateStatusBar();
|
||||||
void updateButtonColor();
|
void updateButtonColor();
|
||||||
void processClick();
|
void processClick();
|
||||||
|
|
|
@ -86,7 +86,7 @@ class FButtonGroup : public FScrollView
|
||||||
FButtonGroup& operator = (const FButtonGroup&) = delete;
|
FButtonGroup& operator = (const FButtonGroup&) = delete;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FToggleButton* getFirstButton();
|
FToggleButton* getFirstButton();
|
||||||
FToggleButton* getLastButton();
|
FToggleButton* getLastButton();
|
||||||
FToggleButton* getButton (int) const;
|
FToggleButton* getButton (int) const;
|
||||||
|
@ -94,10 +94,10 @@ class FButtonGroup : public FScrollView
|
||||||
FString& getText();
|
FString& getText();
|
||||||
|
|
||||||
// Mutator
|
// Mutator
|
||||||
virtual bool setEnable(bool) override;
|
bool setEnable(bool) override;
|
||||||
virtual bool setEnable() override;
|
bool setEnable() override;
|
||||||
virtual bool unsetEnable() override;
|
bool unsetEnable() override;
|
||||||
virtual bool setDisable() override;
|
bool setDisable() override;
|
||||||
void setText (const FString&);
|
void setText (const FString&);
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
|
@ -106,23 +106,23 @@ class FButtonGroup : public FScrollView
|
||||||
bool hasCheckedButton() const;
|
bool hasCheckedButton() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
void insert (FToggleButton*);
|
void insert (FToggleButton*);
|
||||||
void remove (FToggleButton*);
|
void remove (FToggleButton*);
|
||||||
void checkScrollSize (FToggleButton*);
|
void checkScrollSize (FToggleButton*);
|
||||||
void checkScrollSize (const FRect&);
|
void checkScrollSize (const FRect&);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Mutator
|
// Mutator
|
||||||
void setHotkeyAccelerator();
|
void setHotkeyAccelerator();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawLabel();
|
void drawLabel();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -86,12 +86,12 @@ class FCheckBox : public FToggleButton
|
||||||
FCheckBox& operator = (const FCheckBox&) = delete;
|
FCheckBox& operator = (const FCheckBox&) = delete;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawCheckButton();
|
void drawCheckButton();
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
|
@ -86,13 +86,13 @@ class FCheckMenuItem : public FMenuItem
|
||||||
FCheckMenuItem& operator = (const FCheckMenuItem&) = delete;
|
FCheckMenuItem& operator = (const FCheckMenuItem&) = delete;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
void init (FWidget*);
|
void init (FWidget*);
|
||||||
void processToggle();
|
void processToggle();
|
||||||
virtual void processClicked() override;
|
void processClicked() override;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class FColorPair
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
FColorPair (FColor fg = fc::Default, FColor bg = fc::Default)
|
explicit FColorPair (FColor fg = fc::Default, FColor bg = fc::Default)
|
||||||
: fg_color(fg)
|
: fg_color(fg)
|
||||||
, bg_color(bg)
|
, bg_color(bg)
|
||||||
{ }
|
{ }
|
||||||
|
|
|
@ -99,7 +99,7 @@ class FDialog : public FWindow
|
||||||
FDialog& operator = (const FDialog&) = delete;
|
FDialog& operator = (const FDialog&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FString getText() const;
|
FString getText() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
|
@ -109,7 +109,7 @@ class FDialog : public FWindow
|
||||||
bool setModal (bool);
|
bool setModal (bool);
|
||||||
bool setModal();
|
bool setModal();
|
||||||
bool unsetModal();
|
bool unsetModal();
|
||||||
virtual bool setResizeable (bool) override;
|
bool setResizeable (bool) override;
|
||||||
bool setScrollable (bool);
|
bool setScrollable (bool);
|
||||||
bool setScrollable();
|
bool setScrollable();
|
||||||
bool unsetScrollable();
|
bool unsetScrollable();
|
||||||
|
@ -120,16 +120,16 @@ class FDialog : public FWindow
|
||||||
bool isScrollable();
|
bool isScrollable();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void show() override;
|
void show() override;
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
int exec();
|
int exec();
|
||||||
virtual void setPos (const FPoint&, bool = true) override;
|
void setPos (const FPoint&, bool = true) override;
|
||||||
virtual void move (const FPoint&) override;
|
void move (const FPoint&) override;
|
||||||
bool moveUp (int);
|
bool moveUp (int);
|
||||||
bool moveDown (int);
|
bool moveDown (int);
|
||||||
bool moveLeft (int);
|
bool moveLeft (int);
|
||||||
bool moveRight (int);
|
bool moveRight (int);
|
||||||
virtual void setSize (const FSize&, bool = true) override;
|
void setSize (const FSize&, bool = true) override;
|
||||||
bool reduceHeight (int);
|
bool reduceHeight (int);
|
||||||
bool expandHeight (int);
|
bool expandHeight (int);
|
||||||
bool reduceWidth (int);
|
bool reduceWidth (int);
|
||||||
|
@ -137,27 +137,27 @@ class FDialog : public FWindow
|
||||||
void activateDialog();
|
void activateDialog();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onMouseDoubleClick (FMouseEvent*) override;
|
void onMouseDoubleClick (FMouseEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
virtual void onWindowActive (FEvent*) override;
|
void onWindowActive (FEvent*) override;
|
||||||
virtual void onWindowInactive (FEvent*) override;
|
void onWindowInactive (FEvent*) override;
|
||||||
virtual void onWindowRaised (FEvent*) override;
|
void onWindowRaised (FEvent*) override;
|
||||||
virtual void onWindowLowered (FEvent*) override;
|
void onWindowLowered (FEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Methods
|
// Methods
|
||||||
virtual void done (int);
|
virtual void done (int);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawDialogShadow();
|
void drawDialogShadow();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onShow (FShowEvent*) override;
|
void onShow (FShowEvent*) override;
|
||||||
virtual void onHide (FHideEvent*) override;
|
void onHide (FHideEvent*) override;
|
||||||
virtual void onClose (FCloseEvent*) override;
|
void onClose (FCloseEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef
|
// Typedef
|
||||||
|
@ -183,7 +183,7 @@ class FDialog : public FWindow
|
||||||
void initMoveSizeMenuItem (FMenu*);
|
void initMoveSizeMenuItem (FMenu*);
|
||||||
void initZoomMenuItem (FMenu*);
|
void initZoomMenuItem (FMenu*);
|
||||||
void initCloseMenuItem (FMenu*);
|
void initCloseMenuItem (FMenu*);
|
||||||
virtual void drawBorder() override;
|
void drawBorder() override;
|
||||||
void drawTitleBar();
|
void drawTitleBar();
|
||||||
void drawBarButton();
|
void drawBarButton();
|
||||||
void drawZoomButton();
|
void drawZoomButton();
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -92,7 +92,7 @@ class FDialogListMenu : public FMenu
|
||||||
FDialogListMenu& operator = (const FDialogListMenu&) = delete;
|
FDialogListMenu& operator = (const FDialogListMenu&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Method
|
// Method
|
||||||
|
|
|
@ -118,7 +118,7 @@ class FFileDialog : public FDialog
|
||||||
FFileDialog& operator = (const FFileDialog&);
|
FFileDialog& operator = (const FFileDialog&);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
const FString getPath() const;
|
const FString getPath() const;
|
||||||
const FString getFilter() const;
|
const FString getFilter() const;
|
||||||
const FString getSelectedFile() const;
|
const FString getSelectedFile() const;
|
||||||
|
@ -132,7 +132,7 @@ class FFileDialog : public FDialog
|
||||||
bool unsetShowHiddenFiles();
|
bool unsetShowHiddenFiles();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
static const FString fileOpenChooser ( FWidget*
|
static const FString fileOpenChooser ( FWidget*
|
||||||
|
@ -149,7 +149,7 @@ class FFileDialog : public FDialog
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef
|
// Typedef
|
||||||
|
@ -175,7 +175,7 @@ class FFileDialog : public FDialog
|
||||||
void initCallbacks();
|
void initCallbacks();
|
||||||
bool pattern_match (const char* const, char[]);
|
bool pattern_match (const char* const, char[]);
|
||||||
void clear();
|
void clear();
|
||||||
int numOfDirs();
|
long numOfDirs();
|
||||||
void sortDir();
|
void sortDir();
|
||||||
int readDir();
|
int readDir();
|
||||||
void getEntry (const char* const, struct dirent*);
|
void getEntry (const char* const, struct dirent*);
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sys/time.h>
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
|
|
@ -101,7 +101,7 @@ class FLabel : public FWidget
|
||||||
const FLabel& operator >> (FString&);
|
const FLabel& operator >> (FString&);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FWidget* getAccelWidget();
|
FWidget* getAccelWidget();
|
||||||
fc::text_alignment getAlignment();
|
fc::text_alignment getAlignment();
|
||||||
FString& getText();
|
FString& getText();
|
||||||
|
@ -115,7 +115,7 @@ class FLabel : public FWidget
|
||||||
bool setReverseMode(bool);
|
bool setReverseMode(bool);
|
||||||
bool setReverseMode();
|
bool setReverseMode();
|
||||||
bool unsetReverseMode();
|
bool unsetReverseMode();
|
||||||
virtual bool setEnable (bool) override;
|
bool setEnable (bool) override;
|
||||||
void setNumber (uLong);
|
void setNumber (uLong);
|
||||||
void setNumber (long);
|
void setNumber (long);
|
||||||
void setNumber (float, int = FLT_DIG);
|
void setNumber (float, int = FLT_DIG);
|
||||||
|
@ -128,12 +128,12 @@ class FLabel : public FWidget
|
||||||
bool hasReverseMode();
|
bool hasReverseMode();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_accel_widget_destroyed (FWidget*, FDataPtr);
|
void cb_accel_widget_destroyed (FWidget*, FDataPtr);
|
||||||
|
@ -147,7 +147,7 @@ class FLabel : public FWidget
|
||||||
std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t);
|
std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t);
|
||||||
void setHotkeyAccelerator();
|
void setHotkeyAccelerator();
|
||||||
std::size_t getAlignOffset (std::size_t);
|
std::size_t getAlignOffset (std::size_t);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawMultiLine();
|
void drawMultiLine();
|
||||||
void drawSingleLine();
|
void drawSingleLine();
|
||||||
void printLine ( wchar_t[], std::size_t
|
void printLine ( wchar_t[], std::size_t
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
@ -108,7 +109,7 @@ class FLineEdit : public FWidget
|
||||||
const FLineEdit& operator >> (FString&);
|
const FLineEdit& operator >> (FString&);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FString getText() const;
|
FString getText() const;
|
||||||
std::size_t getMaxLength() const;
|
std::size_t getMaxLength() const;
|
||||||
std::size_t getCursorPosition() const;
|
std::size_t getCursorPosition() const;
|
||||||
|
@ -122,15 +123,15 @@ class FLineEdit : public FWidget
|
||||||
void setCursorPosition (std::size_t);
|
void setCursorPosition (std::size_t);
|
||||||
void setLabelText (const FString&);
|
void setLabelText (const FString&);
|
||||||
void setLabelOrientation (const label_o);
|
void setLabelOrientation (const label_o);
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
virtual bool setEnable(bool) override;
|
bool setEnable(bool) override;
|
||||||
virtual bool setEnable() override;
|
bool setEnable() override;
|
||||||
virtual bool unsetEnable() override;
|
bool unsetEnable() override;
|
||||||
virtual bool setDisable() override;
|
bool setDisable() override;
|
||||||
virtual bool setFocus(bool) override;
|
bool setFocus(bool) override;
|
||||||
virtual bool setFocus() override;
|
bool setFocus() override;
|
||||||
virtual bool unsetFocus() override;
|
bool unsetFocus() override;
|
||||||
bool setShadow(bool);
|
bool setShadow(bool);
|
||||||
bool setShadow();
|
bool setShadow();
|
||||||
bool unsetShadow();
|
bool unsetShadow();
|
||||||
|
@ -139,23 +140,23 @@ class FLineEdit : public FWidget
|
||||||
bool hasShadow();
|
bool hasShadow();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onTimer (FTimerEvent*) override;
|
void onTimer (FTimerEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
virtual void onHide (FHideEvent*) override;
|
void onHide (FHideEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void adjustLabel();
|
void adjustLabel();
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Enumeration
|
// Enumeration
|
||||||
|
@ -169,7 +170,7 @@ class FLineEdit : public FWidget
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
bool hasHotkey();
|
bool hasHotkey();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawInputField();
|
void drawInputField();
|
||||||
void keyLeft();
|
void keyLeft();
|
||||||
void keyRight();
|
void keyRight();
|
||||||
|
|
|
@ -170,7 +170,7 @@ class FListBox : public FWidget
|
||||||
FListBox& operator = (const FListBox&) = delete;
|
FListBox& operator = (const FListBox&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
std::size_t getCount() const;
|
std::size_t getCount() const;
|
||||||
FListBoxItem getItem (std::size_t);
|
FListBoxItem getItem (std::size_t);
|
||||||
FListBoxItem getItem (listBoxItems::iterator) const;
|
FListBoxItem getItem (listBoxItems::iterator) const;
|
||||||
|
@ -187,15 +187,15 @@ class FListBox : public FWidget
|
||||||
void showInsideBrackets (std::size_t, fc::brackets_type);
|
void showInsideBrackets (std::size_t, fc::brackets_type);
|
||||||
void showNoBrackets (std::size_t);
|
void showNoBrackets (std::size_t);
|
||||||
void showNoBrackets (listBoxItems::iterator);
|
void showNoBrackets (listBoxItems::iterator);
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
void setMultiSelection (bool);
|
void setMultiSelection (bool);
|
||||||
void setMultiSelection ();
|
void setMultiSelection ();
|
||||||
void unsetMultiSelection ();
|
void unsetMultiSelection ();
|
||||||
virtual bool setDisable() override;
|
bool setDisable() override;
|
||||||
virtual bool setFocus (bool) override;
|
bool setFocus (bool) override;
|
||||||
virtual bool setFocus() override;
|
bool setFocus() override;
|
||||||
virtual bool unsetFocus() override;
|
bool unsetFocus() override;
|
||||||
void setText (const FString&);
|
void setText (const FString&);
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
|
@ -206,7 +206,7 @@ class FListBox : public FWidget
|
||||||
bool hasBrackets (listBoxItems::iterator) const;
|
bool hasBrackets (listBoxItems::iterator) const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
template <typename Iterator, typename InsertConverter>
|
template <typename Iterator, typename InsertConverter>
|
||||||
void insert (Iterator, Iterator, InsertConverter);
|
void insert (Iterator, Iterator, InsertConverter);
|
||||||
template <typename Container, typename LazyConverter>
|
template <typename Container, typename LazyConverter>
|
||||||
|
@ -227,20 +227,20 @@ class FListBox : public FWidget
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onMouseDoubleClick (FMouseEvent*) override;
|
void onMouseDoubleClick (FMouseEvent*) override;
|
||||||
virtual void onWheel (FWheelEvent*) override;
|
void onWheel (FWheelEvent*) override;
|
||||||
virtual void onTimer (FTimerEvent*) override;
|
void onTimer (FTimerEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Methods
|
// Methods
|
||||||
void adjustYOffset (std::size_t);
|
void adjustYOffset (std::size_t);
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef
|
// Typedef
|
||||||
|
@ -267,7 +267,7 @@ class FListBox : public FWidget
|
||||||
void initScrollbar ( FScrollbarPtr&
|
void initScrollbar ( FScrollbarPtr&
|
||||||
, fc::orientation
|
, fc::orientation
|
||||||
, FListBoxCallback );
|
, FListBoxCallback );
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawHeadline();
|
void drawHeadline();
|
||||||
void drawList();
|
void drawList();
|
||||||
void drawListLine (int, listBoxItems::iterator, bool);
|
void drawListLine (int, listBoxItems::iterator, bool);
|
||||||
|
|
|
@ -92,7 +92,7 @@ class FListViewItem : public FObject
|
||||||
FListViewItem& operator = (const FListViewItem&);
|
FListViewItem& operator = (const FListViewItem&);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
uInt getColumnCount() const;
|
uInt getColumnCount() const;
|
||||||
int getSortColumn() const;
|
int getSortColumn() const;
|
||||||
FString getText (int) const;
|
FString getText (int) const;
|
||||||
|
@ -285,7 +285,7 @@ class FListView : public FWidget
|
||||||
FListView& operator = (const FListView&) = delete;
|
FListView& operator = (const FListView&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
std::size_t getCount();
|
std::size_t getCount();
|
||||||
fc::text_alignment getColumnAlignment (int) const;
|
fc::text_alignment getColumnAlignment (int) const;
|
||||||
FString getColumnText (int) const;
|
FString getColumnText (int) const;
|
||||||
|
@ -295,7 +295,7 @@ class FListView : public FWidget
|
||||||
FListViewItem* getCurrentItem();
|
FListViewItem* getCurrentItem();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
void setColumnAlignment (int, fc::text_alignment);
|
void setColumnAlignment (int, fc::text_alignment);
|
||||||
void setColumnText (int, const FString&);
|
void setColumnText (int, const FString&);
|
||||||
|
@ -314,7 +314,7 @@ class FListView : public FWidget
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual int addColumn (const FString&, int = USE_MAX_SIZE);
|
virtual int addColumn (const FString&, int = USE_MAX_SIZE);
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
FObjectIterator insert (FListViewItem*);
|
FObjectIterator insert (FListViewItem*);
|
||||||
FObjectIterator insert (FListViewItem*, FObjectIterator);
|
FObjectIterator insert (FListViewItem*, FObjectIterator);
|
||||||
FObjectIterator insert ( const FStringList&
|
FObjectIterator insert ( const FStringList&
|
||||||
|
@ -350,15 +350,15 @@ class FListView : public FWidget
|
||||||
virtual void sort();
|
virtual void sort();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onMouseDoubleClick (FMouseEvent*) override;
|
void onMouseDoubleClick (FMouseEvent*) override;
|
||||||
virtual void onWheel (FWheelEvent*) override;
|
void onWheel (FWheelEvent*) override;
|
||||||
virtual void onTimer (FTimerEvent*) override;
|
void onTimer (FTimerEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
static FObjectIterator null_iter;
|
static FObjectIterator null_iter;
|
||||||
|
@ -366,7 +366,7 @@ class FListView : public FWidget
|
||||||
protected:
|
protected:
|
||||||
// Methods
|
// Methods
|
||||||
void adjustViewport (int);
|
void adjustViewport (int);
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef
|
// Typedef
|
||||||
|
@ -393,7 +393,7 @@ class FListView : public FWidget
|
||||||
std::size_t getAlignOffset ( fc::text_alignment
|
std::size_t getAlignOffset ( fc::text_alignment
|
||||||
, std::size_t
|
, std::size_t
|
||||||
, std::size_t );
|
, std::size_t );
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawHeadlines();
|
void drawHeadlines();
|
||||||
void drawList();
|
void drawList();
|
||||||
void drawListLine (const FListViewItem*, bool, bool);
|
void drawListLine (const FListViewItem*, bool, bool);
|
||||||
|
|
|
@ -93,21 +93,21 @@ class FMenu : public FWindow, public FMenuList
|
||||||
FMenu& operator = (const FMenu&) = delete;
|
FMenu& operator = (const FMenu&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FString getText() const;
|
FString getText() const;
|
||||||
FMenuItem* getItem();
|
FMenuItem* getItem();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
virtual bool setEnable(bool) override;
|
bool setEnable (bool) override;
|
||||||
virtual bool setEnable() override;
|
bool setEnable() override;
|
||||||
virtual bool unsetEnable() override;
|
bool unsetEnable() override;
|
||||||
virtual bool setDisable() override;
|
bool setDisable() override;
|
||||||
void setSelected();
|
void setSelected();
|
||||||
void unsetSelected();
|
void unsetSelected();
|
||||||
bool setMenuWidget (bool);
|
bool setMenuWidget (bool);
|
||||||
bool setMenuWidget();
|
bool setMenuWidget();
|
||||||
bool unsetMenuWidget();
|
bool unsetMenuWidget();
|
||||||
virtual void setStatusbarMessage (const FString&) override;
|
void setStatusbarMessage (const FString&) override;
|
||||||
void setMenu (FMenu*);
|
void setMenu (FMenu*);
|
||||||
void setText (const FString&);
|
void setText (const FString&);
|
||||||
|
|
||||||
|
@ -118,15 +118,15 @@ class FMenu : public FWindow, public FMenuList
|
||||||
bool hasMenu() const;
|
bool hasMenu() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void show() override;
|
void show() override;
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_menuitem_toggled (FWidget*, FDataPtr);
|
void cb_menuitem_toggled (FWidget*, FDataPtr);
|
||||||
|
@ -203,7 +203,7 @@ class FMenu : public FWindow, public FMenuList
|
||||||
void keypressMenuBar (FKeyEvent*);
|
void keypressMenuBar (FKeyEvent*);
|
||||||
bool hotkeyMenu (FKeyEvent*);
|
bool hotkeyMenu (FKeyEvent*);
|
||||||
std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t);
|
std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawItems();
|
void drawItems();
|
||||||
void drawSeparator (int);
|
void drawSeparator (int);
|
||||||
void drawMenuLine (FMenuItem*, int);
|
void drawMenuLine (FMenuItem*, int);
|
||||||
|
@ -257,7 +257,7 @@ inline FMenuItem* FMenu::getItem()
|
||||||
{ return &item; }
|
{ return &item; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FMenu::setEnable(bool enable)
|
inline bool FMenu::setEnable (bool enable)
|
||||||
{ return item.setEnable(enable); }
|
{ return item.setEnable(enable); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -91,19 +91,19 @@ class FMenuBar : public FWindow, public FMenuList
|
||||||
FMenuBar& operator = (const FMenuBar&) = delete;
|
FMenuBar& operator = (const FMenuBar&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void resetMenu();
|
void resetMenu();
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_item_deactivated (FWidget*, FDataPtr);
|
void cb_item_deactivated (FWidget*, FDataPtr);
|
||||||
|
@ -132,7 +132,7 @@ class FMenuBar : public FWindow, public FMenuList
|
||||||
bool selectPrevItem();
|
bool selectPrevItem();
|
||||||
bool hotkeyMenu (FKeyEvent*&);
|
bool hotkeyMenu (FKeyEvent*&);
|
||||||
std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t);
|
std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawItems();
|
void drawItems();
|
||||||
void drawItem (FMenuItem*, std::size_t&);
|
void drawItem (FMenuItem*, std::size_t&);
|
||||||
void setLineAttributes (FMenuItem*);
|
void setLineAttributes (FMenuItem*);
|
||||||
|
|
|
@ -96,17 +96,17 @@ class FMenuItem : public FWidget
|
||||||
FMenuItem& operator = (const FMenuItem&) = delete;
|
FMenuItem& operator = (const FMenuItem&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
uChar getHotkey() const;
|
uChar getHotkey() const;
|
||||||
FMenu* getMenu() const;
|
FMenu* getMenu() const;
|
||||||
std::size_t getTextLength() const;
|
std::size_t getTextLength() const;
|
||||||
FString getText() const;
|
FString getText() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
virtual bool setEnable (bool) override;
|
bool setEnable (bool) override;
|
||||||
virtual bool setFocus (bool) override;
|
bool setFocus (bool) override;
|
||||||
virtual bool setFocus() override;
|
bool setFocus() override;
|
||||||
virtual bool unsetFocus() override;
|
bool unsetFocus() override;
|
||||||
void setSelected();
|
void setSelected();
|
||||||
void unsetSelected();
|
void unsetSelected();
|
||||||
void setSeparator();
|
void setSeparator();
|
||||||
|
@ -124,19 +124,19 @@ class FMenuItem : public FWidget
|
||||||
bool hasMenu() const;
|
bool hasMenu() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void addAccelerator (FKey, FWidget*) override;
|
void addAccelerator (FKey, FWidget*) override;
|
||||||
virtual void delAccelerator (FWidget*) override;
|
void delAccelerator (FWidget*) override;
|
||||||
void openMenu();
|
void openMenu();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDoubleClick (FMouseEvent*) override;
|
void onMouseDoubleClick (FMouseEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Accessor
|
// Accessor
|
||||||
|
|
|
@ -109,7 +109,7 @@ class FMessageBox : public FDialog
|
||||||
FMessageBox& operator = (const FMessageBox&);
|
FMessageBox& operator = (const FMessageBox&);
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
const FString getTitlebarText() const;
|
const FString getTitlebarText() const;
|
||||||
const FString getHeadline() const;
|
const FString getHeadline() const;
|
||||||
const FString getText() const;
|
const FString getText() const;
|
||||||
|
@ -139,7 +139,7 @@ class FMessageBox : public FDialog
|
||||||
, int = 0 );
|
, int = 0 );
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_processClick (FWidget*, FDataPtr);
|
void cb_processClick (FWidget*, FDataPtr);
|
||||||
|
@ -151,7 +151,7 @@ class FMessageBox : public FDialog
|
||||||
void deallocation();
|
void deallocation();
|
||||||
void initCallbacks();
|
void initCallbacks();
|
||||||
void calculateDimensions();
|
void calculateDimensions();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void resizeButtons();
|
void resizeButtons();
|
||||||
void adjustButtons();
|
void adjustButtons();
|
||||||
|
|
||||||
|
|
|
@ -199,18 +199,18 @@ class FMouseGPM final : public FMouse
|
||||||
virtual ~FMouseGPM();
|
virtual ~FMouseGPM();
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setStdinNo(int);
|
void setStdinNo(int);
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
virtual bool hasData() override;
|
bool hasData() override;
|
||||||
bool isGpmMouseEnabled();
|
bool isGpmMouseEnabled();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void setRawData (FKeyboard::keybuffer&) override;
|
void setRawData (FKeyboard::keybuffer&) override;
|
||||||
virtual void processEvent (struct timeval*) override;
|
void processEvent (struct timeval*) override;
|
||||||
bool gpmMouse (bool);
|
bool gpmMouse (bool);
|
||||||
bool enableGpmMouse();
|
bool enableGpmMouse();
|
||||||
bool disableGpmMouse();
|
bool disableGpmMouse();
|
||||||
|
@ -271,14 +271,14 @@ class FMouseX11 final : public FMouse
|
||||||
virtual ~FMouseX11() = default;
|
virtual ~FMouseX11() = default;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
virtual bool hasData() override;
|
bool hasData() override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void setRawData (FKeyboard::keybuffer&) override;
|
void setRawData (FKeyboard::keybuffer&) override;
|
||||||
virtual void processEvent (struct timeval*) override;
|
void processEvent (struct timeval*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Enumeration
|
// Enumeration
|
||||||
|
@ -334,14 +334,14 @@ class FMouseSGR final : public FMouse
|
||||||
virtual ~FMouseSGR() = default;
|
virtual ~FMouseSGR() = default;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
virtual bool hasData() override;
|
bool hasData() override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void setRawData (FKeyboard::keybuffer&) override;
|
void setRawData (FKeyboard::keybuffer&) override;
|
||||||
virtual void processEvent (struct timeval*) override;
|
void processEvent (struct timeval*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Enumeration
|
// Enumeration
|
||||||
|
@ -397,14 +397,14 @@ class FMouseUrxvt final : public FMouse
|
||||||
virtual ~FMouseUrxvt() = default;
|
virtual ~FMouseUrxvt() = default;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
virtual bool hasData() override;
|
bool hasData() override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void setRawData (FKeyboard::keybuffer&) override;
|
void setRawData (FKeyboard::keybuffer&) override;
|
||||||
virtual void processEvent (struct timeval*) override;
|
void processEvent (struct timeval*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Enumeration
|
// Enumeration
|
||||||
|
|
|
@ -77,12 +77,12 @@ class FProgressbar : public FWidget
|
||||||
virtual ~FProgressbar();
|
virtual ~FProgressbar();
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
std::size_t getPercentage();
|
std::size_t getPercentage();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setPercentage (std::size_t);
|
void setPercentage (std::size_t);
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
bool setShadow (bool);
|
bool setShadow (bool);
|
||||||
bool setShadow();
|
bool setShadow();
|
||||||
|
@ -92,7 +92,7 @@ class FProgressbar : public FWidget
|
||||||
bool hasShadow();
|
bool hasShadow();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -100,7 +100,7 @@ class FProgressbar : public FWidget
|
||||||
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1);
|
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawProgressLabel();
|
void drawProgressLabel();
|
||||||
void drawProgressBar();
|
void drawProgressBar();
|
||||||
std::size_t drawProgressIndicator();
|
std::size_t drawProgressIndicator();
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -86,12 +86,12 @@ class FRadioButton : public FToggleButton
|
||||||
FRadioButton& operator = (const FRadioButton&) = delete;
|
FRadioButton& operator = (const FRadioButton&) = delete;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawRadioButton();
|
void drawRadioButton();
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
|
@ -86,13 +86,13 @@ class FRadioMenuItem : public FMenuItem
|
||||||
FRadioMenuItem& operator = (const FRadioMenuItem&) = delete;
|
FRadioMenuItem& operator = (const FRadioMenuItem&) = delete;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
void init (FWidget*);
|
void init (FWidget*);
|
||||||
void processToggle();
|
void processToggle();
|
||||||
virtual void processClicked() override;
|
void processClicked() override;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ class FScrollbar : public FWidget
|
||||||
FScrollbar& operator = (const FScrollbar&) = delete;
|
FScrollbar& operator = (const FScrollbar&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
int getValue() const;
|
int getValue() const;
|
||||||
sType getScrollType() const;
|
sType getScrollType() const;
|
||||||
|
|
||||||
|
@ -109,28 +109,28 @@ class FScrollbar : public FWidget
|
||||||
void setSteps (double);
|
void setSteps (double);
|
||||||
void setPageSize (int, int);
|
void setPageSize (int, int);
|
||||||
void setOrientation (fc::orientation);
|
void setOrientation (fc::orientation);
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void resize() override;
|
void resize() override;
|
||||||
virtual void redraw() override;
|
void redraw() override;
|
||||||
void calculateSliderValues();
|
void calculateSliderValues();
|
||||||
void drawVerticalBar();
|
void drawVerticalBar();
|
||||||
void drawHorizontalBar();
|
void drawHorizontalBar();
|
||||||
void drawBar();
|
void drawBar();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onWheel (FWheelEvent*) override;
|
void onWheel (FWheelEvent*) override;
|
||||||
virtual void onTimer (FTimerEvent*) override;
|
void onTimer (FTimerEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawButtons();
|
void drawButtons();
|
||||||
sType getClickedScrollType (int, int);
|
sType getClickedScrollType (int, int);
|
||||||
sType getVerticalClickedScrollType (int);
|
sType getVerticalClickedScrollType (int);
|
||||||
|
|
|
@ -87,7 +87,7 @@ class FScrollView : public FWidget
|
||||||
FScrollView& operator = (const FScrollView&) = delete;
|
FScrollView& operator = (const FScrollView&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
std::size_t getViewportWidth() const;
|
std::size_t getViewportWidth() const;
|
||||||
std::size_t getViewportHeight() const;
|
std::size_t getViewportHeight() const;
|
||||||
const FSize getViewportSize();
|
const FSize getViewportSize();
|
||||||
|
@ -102,13 +102,13 @@ class FScrollView : public FWidget
|
||||||
virtual void setScrollWidth (std::size_t);
|
virtual void setScrollWidth (std::size_t);
|
||||||
virtual void setScrollHeight (std::size_t);
|
virtual void setScrollHeight (std::size_t);
|
||||||
virtual void setScrollSize (const FSize&);
|
virtual void setScrollSize (const FSize&);
|
||||||
virtual void setX (int, bool = true) override;
|
void setX (int, bool = true) override;
|
||||||
virtual void setY (int, bool = true) override;
|
void setY (int, bool = true) override;
|
||||||
virtual void setPos (const FPoint&, bool = true) override;
|
void setPos (const FPoint&, bool = true) override;
|
||||||
virtual void setWidth (std::size_t, bool = true) override;
|
void setWidth (std::size_t, bool = true) override;
|
||||||
virtual void setHeight (std::size_t, bool = true) override;
|
void setHeight (std::size_t, bool = true) override;
|
||||||
virtual void setSize (const FSize&, bool = true) override;
|
void setSize (const FSize&, bool = true) override;
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
void setCursorPos (const FPoint&);
|
void setCursorPos (const FPoint&);
|
||||||
void setPrintPos (const FPoint&);
|
void setPrintPos (const FPoint&);
|
||||||
|
@ -126,30 +126,30 @@ class FScrollView : public FWidget
|
||||||
bool isViewportPrint();
|
bool isViewportPrint();
|
||||||
|
|
||||||
// Method
|
// Method
|
||||||
virtual void clearArea (int = ' ') override;
|
void clearArea (int = ' ') override;
|
||||||
void scrollToX (int);
|
void scrollToX (int);
|
||||||
void scrollToY (int);
|
void scrollToY (int);
|
||||||
void scrollTo (const FPoint&);
|
void scrollTo (const FPoint&);
|
||||||
void scrollTo (int, int);
|
void scrollTo (int, int);
|
||||||
void scrollBy (int, int);
|
void scrollBy (int, int);
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onWheel (FWheelEvent*) override;
|
void onWheel (FWheelEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onChildFocusIn (FFocusEvent*) override;
|
void onChildFocusIn (FFocusEvent*) override;
|
||||||
virtual void onChildFocusOut (FFocusEvent*) override;
|
void onChildFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Using-declaration
|
// Using-declaration
|
||||||
using FVTerm::clearArea;
|
using FVTerm::clearArea;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual term_area* getPrintArea() override;
|
term_area* getPrintArea() override;
|
||||||
|
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
void copy2area();
|
void copy2area();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
|
@ -94,7 +94,7 @@ class FStatusKey : public FWidget
|
||||||
FStatusKey& operator = (const FStatusKey&) = delete;
|
FStatusKey& operator = (const FStatusKey&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
virtual FKey getKey() const;
|
virtual FKey getKey() const;
|
||||||
virtual FString getText() const;
|
virtual FString getText() const;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ class FStatusKey : public FWidget
|
||||||
bool hasMouseFocus() const;
|
bool hasMouseFocus() const;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
|
@ -207,7 +207,7 @@ class FStatusBar : public FWindow
|
||||||
FStatusBar& operator = (const FStatusBar&) = delete;
|
FStatusBar& operator = (const FStatusBar&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FStatusKey* getStatusKey (int) const;
|
FStatusKey* getStatusKey (int) const;
|
||||||
FString getMessage() const;
|
FString getMessage() const;
|
||||||
std::size_t getCount() const;
|
std::size_t getCount() const;
|
||||||
|
@ -222,19 +222,19 @@ class FStatusBar : public FWindow
|
||||||
bool hasActivatedKey();
|
bool hasActivatedKey();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
void drawMessage();
|
void drawMessage();
|
||||||
void clearMessage();
|
void clearMessage();
|
||||||
void insert (FStatusKey*);
|
void insert (FStatusKey*);
|
||||||
void remove (FStatusKey*);
|
void remove (FStatusKey*);
|
||||||
void remove (int);
|
void remove (int);
|
||||||
void clear();
|
void clear();
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
void cb_statuskey_activated (FWidget*, FDataPtr);
|
void cb_statuskey_activated (FWidget*, FDataPtr);
|
||||||
|
@ -245,7 +245,7 @@ class FStatusBar : public FWindow
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawKeys();
|
void drawKeys();
|
||||||
void drawKey (keyList::const_iterator);
|
void drawKey (keyList::const_iterator);
|
||||||
void drawActiveKey (keyList::const_iterator);
|
void drawActiveKey (keyList::const_iterator);
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -86,19 +86,19 @@ class FSwitch : public FToggleButton
|
||||||
FSwitch& operator = (const FSwitch&) = delete;
|
FSwitch& operator = (const FSwitch&) = delete;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
|
|
||||||
// Mutator
|
// Mutator
|
||||||
virtual void setText (const FString&) override;
|
void setText (const FString&) override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawCheckButton();
|
void drawCheckButton();
|
||||||
void drawChecked();
|
void drawChecked();
|
||||||
void drawUnchecked();
|
void drawUnchecked();
|
||||||
|
|
|
@ -94,18 +94,18 @@ class FSystemImpl : public FSystem
|
||||||
// Methods
|
// Methods
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
||||||
virtual uChar inPortByte (uShort port) override
|
uChar inPortByte (uShort port) override
|
||||||
{
|
{
|
||||||
return ::inb (port);
|
return ::inb (port);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
virtual uChar inPortByte (uShort) override
|
uChar inPortByte (uShort) override
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
virtual uChar inPortByte (uShort) override
|
uChar inPortByte (uShort) override
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -114,26 +114,26 @@ class FSystemImpl : public FSystem
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
#if defined(__x86_64__) || defined(__i386) || defined(__arm__)
|
||||||
virtual void outPortByte (uChar value, uShort port) override
|
void outPortByte (uChar value, uShort port) override
|
||||||
{
|
{
|
||||||
::outb (value, port);
|
::outb (value, port);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
virtual void outPortByte (uChar, uShort) override
|
void outPortByte (uChar, uShort) override
|
||||||
{ }
|
{ }
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
virtual void outPortByte (uChar, uShort) override
|
void outPortByte (uChar, uShort) override
|
||||||
{ }
|
{ }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
virtual int isTTY (int fd) override
|
int isTTY (int fd) override
|
||||||
{
|
{
|
||||||
return ::isatty(fd);
|
return ::isatty(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int ioctl (int fd, uLong request, ...) override
|
int ioctl (int fd, uLong request, ...) override
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, request);
|
va_start (args, request);
|
||||||
|
@ -143,7 +143,7 @@ class FSystemImpl : public FSystem
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int open (const char* pathname, int flags, ...) override
|
int open (const char* pathname, int flags, ...) override
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, flags);
|
va_start (args, flags);
|
||||||
|
@ -153,22 +153,22 @@ class FSystemImpl : public FSystem
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int close (int fildes) override
|
int close (int fildes) override
|
||||||
{
|
{
|
||||||
return ::close(fildes);
|
return ::close(fildes);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual FILE* fopen (const char* path, const char* mode) override
|
FILE* fopen (const char* path, const char* mode) override
|
||||||
{
|
{
|
||||||
return std::fopen (path, mode);
|
return std::fopen (path, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int fclose (FILE* fp) override
|
int fclose (FILE* fp) override
|
||||||
{
|
{
|
||||||
return std::fclose (fp);
|
return std::fclose (fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int putchar (int c) override
|
int putchar (int c) override
|
||||||
{
|
{
|
||||||
#if defined(__sun) && defined(__SVR4)
|
#if defined(__sun) && defined(__SVR4)
|
||||||
return std::putchar(char(c));
|
return std::putchar(char(c));
|
||||||
|
@ -177,7 +177,7 @@ class FSystemImpl : public FSystem
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int tputs (const char* str, int affcnt, int (*putc)(int)) override
|
int tputs (const char* str, int affcnt, int (*putc)(int)) override
|
||||||
{
|
{
|
||||||
#if defined(__sun) && defined(__SVR4)
|
#if defined(__sun) && defined(__SVR4)
|
||||||
return ::tputs (C_STR(str), affcnt, reinterpret_cast<int (*)(char)>(putc));
|
return ::tputs (C_STR(str), affcnt, reinterpret_cast<int (*)(char)>(putc));
|
||||||
|
@ -186,7 +186,7 @@ class FSystemImpl : public FSystem
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual uid_t getuid() override
|
uid_t getuid() override
|
||||||
{
|
{
|
||||||
return ::getuid();
|
return ::getuid();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
|
|
||||||
#include <cstdio> // need for sprintf
|
#include <cstdio> // need for sprintf
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "final/ftermdata.h"
|
#include "final/ftermdata.h"
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,14 @@ class FTextView : public FWidget
|
||||||
FTextView& operator = (const FTextView&) = delete;
|
FTextView& operator = (const FTextView&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
std::size_t getColumns() const;
|
std::size_t getColumns() const;
|
||||||
std::size_t getRows() const;
|
std::size_t getRows() const;
|
||||||
const FString getText() const;
|
const FString getText() const;
|
||||||
const FStringList& getLines() const;
|
const FStringList& getLines() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
void setText (const FString&);
|
void setText (const FString&);
|
||||||
void scrollToX (int);
|
void scrollToX (int);
|
||||||
|
@ -106,7 +106,7 @@ class FTextView : public FWidget
|
||||||
void scrollBy (int, int);
|
void scrollBy (int, int);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void append (const std::initializer_list<T>&);
|
void append (const std::initializer_list<T>&);
|
||||||
void append (const FString&);
|
void append (const FString&);
|
||||||
|
@ -119,17 +119,17 @@ class FTextView : public FWidget
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
virtual void onWheel (FWheelEvent*) override;
|
void onWheel (FWheelEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef
|
// Typedef
|
||||||
|
@ -149,7 +149,7 @@ class FTextView : public FWidget
|
||||||
void initScrollbar ( FScrollbarPtr&
|
void initScrollbar ( FScrollbarPtr&
|
||||||
, fc::orientation
|
, fc::orientation
|
||||||
, FTextViewCallback );
|
, FTextViewCallback );
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawText();
|
void drawText();
|
||||||
void processChanged();
|
void processChanged();
|
||||||
|
|
||||||
|
|
|
@ -87,22 +87,22 @@ class FToggleButton : public FWidget
|
||||||
FToggleButton& operator = (const FToggleButton&) = delete;
|
FToggleButton& operator = (const FToggleButton&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FString& getText();
|
FString& getText();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
bool setNoUnderline (bool);
|
bool setNoUnderline (bool);
|
||||||
bool setNoUnderline();
|
bool setNoUnderline();
|
||||||
bool unsetNoUnderline();
|
bool unsetNoUnderline();
|
||||||
virtual bool setEnable (bool) override;
|
bool setEnable (bool) override;
|
||||||
virtual bool setEnable() override;
|
bool setEnable() override;
|
||||||
virtual bool unsetEnable() override;
|
bool unsetEnable() override;
|
||||||
virtual bool setDisable() override;
|
bool setDisable() override;
|
||||||
virtual bool setFocus (bool) override;
|
bool setFocus (bool) override;
|
||||||
virtual bool setFocus() override;
|
bool setFocus() override;
|
||||||
virtual bool unsetFocus() override;
|
bool unsetFocus() override;
|
||||||
bool setChecked (bool);
|
bool setChecked (bool);
|
||||||
bool setChecked();
|
bool setChecked();
|
||||||
bool unsetChecked();
|
bool unsetChecked();
|
||||||
|
@ -112,15 +112,15 @@ class FToggleButton : public FWidget
|
||||||
bool isChecked();
|
bool isChecked();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
virtual void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
virtual void onWheel (FWheelEvent*) override;
|
void onWheel (FWheelEvent*) override;
|
||||||
virtual void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
virtual void onFocusIn (FFocusEvent*) override;
|
void onFocusIn (FFocusEvent*) override;
|
||||||
virtual void onFocusOut (FFocusEvent*) override;
|
void onFocusOut (FFocusEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Accessor
|
// Accessor
|
||||||
|
@ -135,13 +135,13 @@ class FToggleButton : public FWidget
|
||||||
bool hasGroup() const;
|
bool hasGroup() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
void drawLabel();
|
void drawLabel();
|
||||||
void processClick();
|
void processClick();
|
||||||
void processToggle();
|
void processToggle();
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
bool checked{false};
|
bool checked{false};
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -88,25 +88,25 @@ class FToolTip : public FWindow
|
||||||
FToolTip& operator = (const FToolTip&) = delete;
|
FToolTip& operator = (const FToolTip&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
const FString getText() const;
|
const FString getText() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setText (const FString&);
|
void setText (const FString&);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void draw() override;
|
void draw() override;
|
||||||
virtual void show() override;
|
void show() override;
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
virtual void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
void calculateDimensions();
|
void calculateDimensions();
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
FString text{};
|
FString text{};
|
||||||
|
|
|
@ -186,7 +186,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
FWidget& operator = (const FWidget&) = delete;
|
FWidget& operator = (const FWidget&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
FWidget* getRootWidget() const;
|
FWidget* getRootWidget() const;
|
||||||
FWidget* getParentWidget() const;
|
FWidget* getParentWidget() const;
|
||||||
static FWidget*& getMainWidget();
|
static FWidget*& getMainWidget();
|
||||||
|
@ -333,7 +333,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
virtual bool focusLastChild();
|
virtual bool focusLastChild();
|
||||||
FPoint termToWidgetPos (const FPoint&);
|
FPoint termToWidgetPos (const FPoint&);
|
||||||
void detectTermSize();
|
void detectTermSize();
|
||||||
virtual void print (const FPoint& p) override;
|
void print (const FPoint& p) override;
|
||||||
virtual void move (const FPoint&);
|
virtual void move (const FPoint&);
|
||||||
void drawShadow();
|
void drawShadow();
|
||||||
void clearShadow();
|
void clearShadow();
|
||||||
|
@ -368,10 +368,10 @@ class FWidget : public FVTerm, public FObject
|
||||||
typedef std::vector<member_callback_data> MemberCallbackObjects;
|
typedef std::vector<member_callback_data> MemberCallbackObjects;
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
virtual term_area* getPrintArea() override;
|
term_area* getPrintArea() override;
|
||||||
virtual void addPreprocessingHandler ( FVTerm*
|
void addPreprocessingHandler ( FVTerm*
|
||||||
, FPreprocessingHandler ) override;
|
, FPreprocessingHandler ) override;
|
||||||
virtual void delPreprocessingHandler (FVTerm*) override;
|
void delPreprocessingHandler (FVTerm*) override;
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
bool isChildPrintArea() const;
|
bool isChildPrintArea() const;
|
||||||
|
@ -388,7 +388,7 @@ class FWidget : public FVTerm, public FObject
|
||||||
virtual bool focusPrevChild(); // ...focus
|
virtual bool focusPrevChild(); // ...focus
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual bool event (FEvent*) override;
|
bool event (FEvent*) override;
|
||||||
virtual void onKeyPress (FKeyEvent*);
|
virtual void onKeyPress (FKeyEvent*);
|
||||||
virtual void onKeyUp (FKeyEvent*);
|
virtual void onKeyUp (FKeyEvent*);
|
||||||
virtual void onKeyDown (FKeyEvent*);
|
virtual void onKeyDown (FKeyEvent*);
|
||||||
|
|
|
@ -92,7 +92,7 @@ class FWindow : public FWidget
|
||||||
FWindow& operator = (const FWindow&) = delete;
|
FWindow& operator = (const FWindow&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const char* getClassName() const override;
|
const char* getClassName() const override;
|
||||||
static FWindow* getWindowWidget (const FWidget*);
|
static FWindow* getWindowWidget (const FWidget*);
|
||||||
static int getWindowLayer (const FWidget*);
|
static int getWindowLayer (const FWidget*);
|
||||||
FWidget* getWindowFocusWidget() const;
|
FWidget* getWindowFocusWidget() const;
|
||||||
|
@ -130,18 +130,18 @@ class FWindow : public FWidget
|
||||||
bool hasShadow() const;
|
bool hasShadow() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual void drawBorder() override;
|
void drawBorder() override;
|
||||||
virtual void show() override;
|
void show() override;
|
||||||
virtual void hide() override;
|
void hide() override;
|
||||||
virtual void setX (int, bool = true) override;
|
void setX (int, bool = true) override;
|
||||||
virtual void setY (int, bool = true) override;
|
void setY (int, bool = true) override;
|
||||||
virtual void setPos (const FPoint&, bool = true) override;
|
void setPos (const FPoint&, bool = true) override;
|
||||||
virtual void setWidth (std::size_t, bool = true) override;
|
void setWidth (std::size_t, bool = true) override;
|
||||||
virtual void setHeight (std::size_t, bool = true) override;
|
void setHeight (std::size_t, bool = true) override;
|
||||||
virtual void setSize (const FSize&, bool = true) override;
|
void setSize (const FSize&, bool = true) override;
|
||||||
virtual void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
virtual void move (const FPoint&) override;
|
void move (const FPoint&) override;
|
||||||
static FWindow* getWindowWidgetAt (const FPoint&);
|
static FWindow* getWindowWidgetAt (const FPoint&);
|
||||||
static FWindow* getWindowWidgetAt (int, int);
|
static FWindow* getWindowWidgetAt (int, int);
|
||||||
static void addWindow (FWidget*);
|
static void addWindow (FWidget*);
|
||||||
|
@ -154,17 +154,17 @@ class FWindow : public FWidget
|
||||||
bool zoomWindow ();
|
bool zoomWindow ();
|
||||||
static void switchToPrevWindow (FWidget*);
|
static void switchToPrevWindow (FWidget*);
|
||||||
static bool activatePrevWindow();
|
static bool activatePrevWindow();
|
||||||
virtual void setShadowSize (const FSize&) override;
|
void setShadowSize (const FSize&) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Method
|
// Method
|
||||||
virtual void adjustSize() override;
|
void adjustSize() override;
|
||||||
|
|
||||||
// Mutator
|
// Mutator
|
||||||
static void setPreviousWindow (FWindow*);
|
static void setPreviousWindow (FWindow*);
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
virtual bool event (FEvent*) override;
|
bool event (FEvent*) override;
|
||||||
virtual void onWindowActive (FEvent*);
|
virtual void onWindowActive (FEvent*);
|
||||||
virtual void onWindowInactive (FEvent*);
|
virtual void onWindowInactive (FEvent*);
|
||||||
virtual void onWindowRaised (FEvent*);
|
virtual void onWindowRaised (FEvent*);
|
||||||
|
@ -181,7 +181,6 @@ class FWindow : public FWidget
|
||||||
FWidget* win_focus_widget{nullptr};
|
FWidget* win_focus_widget{nullptr};
|
||||||
FRect normalGeometry{};
|
FRect normalGeometry{};
|
||||||
static FWindow* previous_window;
|
static FWindow* previous_window;
|
||||||
|
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ endif
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough"
|
$(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough"
|
||||||
|
|
||||||
check: test
|
check: test
|
||||||
test: debug
|
test: debug
|
||||||
|
|
|
@ -29,7 +29,7 @@ endif
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic"
|
$(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic"
|
||||||
|
|
||||||
check: test
|
check: test
|
||||||
test: debug
|
test: debug
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
namespace test
|
namespace test
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <cppunit/TestAssert.h>
|
#include <cppunit/TestAssert.h>
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <string>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 *
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
#include <cppunit/TestAssert.h>
|
#include <cppunit/TestAssert.h>
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <string>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <cppunit/BriefTestProgressListener.h>
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
@ -106,7 +107,7 @@ void FPointTest::noArgumentTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::copyConstructorTest()
|
void FPointTest::copyConstructorTest()
|
||||||
{
|
{
|
||||||
const finalcut::FPoint p1 (15,10);
|
const finalcut::FPoint p1 (15, 10);
|
||||||
const finalcut::FPoint p2 (p1);
|
const finalcut::FPoint p2 (p1);
|
||||||
CPPUNIT_ASSERT ( p2.getX() == 15 );
|
CPPUNIT_ASSERT ( p2.getX() == 15 );
|
||||||
CPPUNIT_ASSERT ( p2.getY() == 10 );
|
CPPUNIT_ASSERT ( p2.getY() == 10 );
|
||||||
|
@ -115,7 +116,7 @@ void FPointTest::copyConstructorTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::moveConstructorTest()
|
void FPointTest::moveConstructorTest()
|
||||||
{
|
{
|
||||||
finalcut::FPoint p1 (25,16);
|
finalcut::FPoint p1 (25, 16);
|
||||||
const finalcut::FPoint p2 (std::move(p1));
|
const finalcut::FPoint p2 (std::move(p1));
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
||||||
|
@ -126,7 +127,7 @@ void FPointTest::moveConstructorTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::assignmentTest()
|
void FPointTest::assignmentTest()
|
||||||
{
|
{
|
||||||
const finalcut::FPoint p1 (-99,100);
|
const finalcut::FPoint p1 (-99, 100);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == -99 );
|
CPPUNIT_ASSERT ( p1.getX() == -99 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 100 );
|
CPPUNIT_ASSERT ( p1.getY() == 100 );
|
||||||
|
|
||||||
|
@ -169,12 +170,12 @@ void FPointTest::assignmentTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::additionAssignmentTest()
|
void FPointTest::additionAssignmentTest()
|
||||||
{
|
{
|
||||||
finalcut::FPoint p1 (1,2);
|
finalcut::FPoint p1 (1, 2);
|
||||||
p1 += finalcut::FPoint (3,1);
|
p1 += finalcut::FPoint (3, 1);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 4 );
|
CPPUNIT_ASSERT ( p1.getX() == 4 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 3 );
|
CPPUNIT_ASSERT ( p1.getY() == 3 );
|
||||||
|
|
||||||
p1 += finalcut::FPoint (-4,-3);
|
p1 += finalcut::FPoint (-4, -3);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.isOrigin() );
|
CPPUNIT_ASSERT ( p1.isOrigin() );
|
||||||
|
@ -194,37 +195,37 @@ void FPointTest::additionAssignmentTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::subtractionAssignmentTest()
|
void FPointTest::subtractionAssignmentTest()
|
||||||
{
|
{
|
||||||
finalcut::FPoint p1 (10,20);
|
finalcut::FPoint p1 (10, 20);
|
||||||
p1 -= finalcut::FPoint (5,5);
|
p1 -= finalcut::FPoint (5, 5);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 5 );
|
CPPUNIT_ASSERT ( p1.getX() == 5 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 15 );
|
CPPUNIT_ASSERT ( p1.getY() == 15 );
|
||||||
|
|
||||||
p1 -= finalcut::FPoint (-5,20);
|
p1 -= finalcut::FPoint (-5, 20);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 10 );
|
CPPUNIT_ASSERT ( p1.getX() == 10 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == -5 );
|
CPPUNIT_ASSERT ( p1.getY() == -5 );
|
||||||
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
||||||
|
|
||||||
p1 -= finalcut::FPoint (-10,0);
|
p1 -= finalcut::FPoint (-10, 0);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 20 );
|
CPPUNIT_ASSERT ( p1.getX() == 20 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == -5 );
|
CPPUNIT_ASSERT ( p1.getY() == -5 );
|
||||||
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
||||||
|
|
||||||
p1 -= finalcut::FPoint (20,0);
|
p1 -= finalcut::FPoint (20, 0);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == -5 );
|
CPPUNIT_ASSERT ( p1.getY() == -5 );
|
||||||
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
||||||
|
|
||||||
p1 -= finalcut::FPoint (0,-6);
|
p1 -= finalcut::FPoint (0, -6);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 1 );
|
CPPUNIT_ASSERT ( p1.getY() == 1 );
|
||||||
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
||||||
|
|
||||||
p1 -= finalcut::FPoint (1,0);
|
p1 -= finalcut::FPoint (1, 0);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == -1 );
|
CPPUNIT_ASSERT ( p1.getX() == -1 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 1 );
|
CPPUNIT_ASSERT ( p1.getY() == 1 );
|
||||||
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
CPPUNIT_ASSERT ( ! p1.isOrigin() );
|
||||||
|
|
||||||
p1 -= (finalcut::FPoint (0,1) + finalcut::FPoint (-1,0));
|
p1 -= (finalcut::FPoint (0, 1) + finalcut::FPoint (-1, 0));
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
CPPUNIT_ASSERT ( p1.getX() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
CPPUNIT_ASSERT ( p1.getY() == 0 );
|
||||||
CPPUNIT_ASSERT ( p1.isOrigin() );
|
CPPUNIT_ASSERT ( p1.isOrigin() );
|
||||||
|
@ -243,11 +244,11 @@ void FPointTest::subtractionAssignmentTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::equalTest()
|
void FPointTest::equalTest()
|
||||||
{
|
{
|
||||||
const finalcut::FPoint p1 (1,2);
|
const finalcut::FPoint p1 (1, 2);
|
||||||
const finalcut::FPoint p2 (1,2);
|
const finalcut::FPoint p2 (1, 2);
|
||||||
CPPUNIT_ASSERT ( p1 == p2 );
|
CPPUNIT_ASSERT ( p1 == p2 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FPoint(1,2) == p2 );
|
CPPUNIT_ASSERT ( finalcut::FPoint(1, 2) == p2 );
|
||||||
CPPUNIT_ASSERT ( p1 == finalcut::FPoint(1,2) );
|
CPPUNIT_ASSERT ( p1 == finalcut::FPoint(1, 2) );
|
||||||
const finalcut::FPoint p3{};
|
const finalcut::FPoint p3{};
|
||||||
const finalcut::FPoint p4{};
|
const finalcut::FPoint p4{};
|
||||||
CPPUNIT_ASSERT ( p3 == p4 );
|
CPPUNIT_ASSERT ( p3 == p4 );
|
||||||
|
@ -257,11 +258,11 @@ void FPointTest::equalTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::notEqualTest()
|
void FPointTest::notEqualTest()
|
||||||
{
|
{
|
||||||
const finalcut::FPoint p1 (1,2);
|
const finalcut::FPoint p1 (1, 2);
|
||||||
const finalcut::FPoint p2 (2,4);
|
const finalcut::FPoint p2 (2, 4);
|
||||||
CPPUNIT_ASSERT ( p1 != p2 );
|
CPPUNIT_ASSERT ( p1 != p2 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FPoint(1,2) != p2 );
|
CPPUNIT_ASSERT ( finalcut::FPoint(1, 2) != p2 );
|
||||||
CPPUNIT_ASSERT ( p1 != finalcut::FPoint(2,4) );
|
CPPUNIT_ASSERT ( p1 != finalcut::FPoint(2, 4) );
|
||||||
CPPUNIT_ASSERT ( finalcut::FPoint() != p2 );
|
CPPUNIT_ASSERT ( finalcut::FPoint() != p2 );
|
||||||
CPPUNIT_ASSERT ( p1 != finalcut::FPoint() );
|
CPPUNIT_ASSERT ( p1 != finalcut::FPoint() );
|
||||||
}
|
}
|
||||||
|
@ -269,12 +270,12 @@ void FPointTest::notEqualTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::additionTest()
|
void FPointTest::additionTest()
|
||||||
{
|
{
|
||||||
const finalcut::FPoint p1 (1,2);
|
const finalcut::FPoint p1 (1, 2);
|
||||||
const finalcut::FPoint p2 (5,8);
|
const finalcut::FPoint p2 (5, 8);
|
||||||
const finalcut::FPoint p3 = p1 + p2;
|
const finalcut::FPoint p3 = p1 + p2;
|
||||||
CPPUNIT_ASSERT ( p3.getX() == 6 );
|
CPPUNIT_ASSERT ( p3.getX() == 6 );
|
||||||
CPPUNIT_ASSERT ( p3.getY() == 10 );
|
CPPUNIT_ASSERT ( p3.getY() == 10 );
|
||||||
CPPUNIT_ASSERT ( p1 + p2 == finalcut::FPoint(6,10) );
|
CPPUNIT_ASSERT ( p1 + p2 == finalcut::FPoint(6, 10) );
|
||||||
CPPUNIT_ASSERT ( p1 + finalcut::FPoint() == p1 );
|
CPPUNIT_ASSERT ( p1 + finalcut::FPoint() == p1 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FPoint() + p2 == p2 );
|
CPPUNIT_ASSERT ( finalcut::FPoint() + p2 == p2 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FPoint() + finalcut::FPoint() == finalcut::FPoint() );
|
CPPUNIT_ASSERT ( finalcut::FPoint() + finalcut::FPoint() == finalcut::FPoint() );
|
||||||
|
@ -283,12 +284,12 @@ void FPointTest::additionTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::subtractionTest()
|
void FPointTest::subtractionTest()
|
||||||
{
|
{
|
||||||
const finalcut::FPoint p1 (-5,-20);
|
const finalcut::FPoint p1 (-5, -20);
|
||||||
const finalcut::FPoint p2 (0,-30);
|
const finalcut::FPoint p2 (0, -30);
|
||||||
const finalcut::FPoint p3 = p1 - p2;
|
const finalcut::FPoint p3 = p1 - p2;
|
||||||
CPPUNIT_ASSERT ( p3.getX() == -5 );
|
CPPUNIT_ASSERT ( p3.getX() == -5 );
|
||||||
CPPUNIT_ASSERT ( p3.getY() == 10 );
|
CPPUNIT_ASSERT ( p3.getY() == 10 );
|
||||||
CPPUNIT_ASSERT ( p1 - p2 == finalcut::FPoint(-5,10) );
|
CPPUNIT_ASSERT ( p1 - p2 == finalcut::FPoint(-5, 10) );
|
||||||
CPPUNIT_ASSERT ( p1 - finalcut::FPoint() == p1 );
|
CPPUNIT_ASSERT ( p1 - finalcut::FPoint() == p1 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FPoint() - finalcut::FPoint() == finalcut::FPoint() );
|
CPPUNIT_ASSERT ( finalcut::FPoint() - finalcut::FPoint() == finalcut::FPoint() );
|
||||||
}
|
}
|
||||||
|
@ -296,7 +297,7 @@ void FPointTest::subtractionTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FPointTest::referenceTest()
|
void FPointTest::referenceTest()
|
||||||
{
|
{
|
||||||
finalcut::FPoint p1 (1,1);
|
finalcut::FPoint p1 (1, 1);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 1 );
|
CPPUNIT_ASSERT ( p1.getX() == 1 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == 1 );
|
CPPUNIT_ASSERT ( p1.getY() == 1 );
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <cppunit/BriefTestProgressListener.h>
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
@ -133,7 +134,7 @@ void FSizeTest::moveConstructorTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FSizeTest::assignmentTest()
|
void FSizeTest::assignmentTest()
|
||||||
{
|
{
|
||||||
const finalcut::FSize s1 (0,100);
|
const finalcut::FSize s1 (0, 100);
|
||||||
CPPUNIT_ASSERT ( s1.getWidth() == 0 );
|
CPPUNIT_ASSERT ( s1.getWidth() == 0 );
|
||||||
CPPUNIT_ASSERT ( s1.getHeight() == 100 );
|
CPPUNIT_ASSERT ( s1.getHeight() == 100 );
|
||||||
|
|
||||||
|
@ -178,8 +179,8 @@ void FSizeTest::assignmentTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FSizeTest::additionAssignmentTest()
|
void FSizeTest::additionAssignmentTest()
|
||||||
{
|
{
|
||||||
finalcut::FSize s1 (1,2);
|
finalcut::FSize s1 (1, 2);
|
||||||
s1 += finalcut::FSize{3,1};
|
s1 += finalcut::FSize{3, 1};
|
||||||
CPPUNIT_ASSERT ( s1.getWidth() == 4 );
|
CPPUNIT_ASSERT ( s1.getWidth() == 4 );
|
||||||
CPPUNIT_ASSERT ( s1.getHeight() == 3 );
|
CPPUNIT_ASSERT ( s1.getHeight() == 3 );
|
||||||
|
|
||||||
|
@ -256,11 +257,11 @@ void FSizeTest::subtractionAssignmentTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FSizeTest::equalTest()
|
void FSizeTest::equalTest()
|
||||||
{
|
{
|
||||||
const finalcut::FSize s1 (1,2);
|
const finalcut::FSize s1 (1, 2);
|
||||||
const finalcut::FSize s2 (1,2);
|
const finalcut::FSize s2 (1, 2);
|
||||||
CPPUNIT_ASSERT ( s1 == s2 );
|
CPPUNIT_ASSERT ( s1 == s2 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FSize(1,2) == s2 );
|
CPPUNIT_ASSERT ( finalcut::FSize(1, 2) == s2 );
|
||||||
CPPUNIT_ASSERT ( s1 == finalcut::FSize(1,2) );
|
CPPUNIT_ASSERT ( s1 == finalcut::FSize(1, 2) );
|
||||||
const finalcut::FSize s3{};
|
const finalcut::FSize s3{};
|
||||||
const finalcut::FSize s4{};
|
const finalcut::FSize s4{};
|
||||||
CPPUNIT_ASSERT ( s3 == s4 );
|
CPPUNIT_ASSERT ( s3 == s4 );
|
||||||
|
@ -269,11 +270,11 @@ void FSizeTest::equalTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FSizeTest::notEqualTest()
|
void FSizeTest::notEqualTest()
|
||||||
{
|
{
|
||||||
const finalcut::FSize s1 (3,5);
|
const finalcut::FSize s1 (3, 5);
|
||||||
const finalcut::FSize s2 (2,4);
|
const finalcut::FSize s2 (2, 4);
|
||||||
CPPUNIT_ASSERT ( s1 != s2 );
|
CPPUNIT_ASSERT ( s1 != s2 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FSize(1,2) != s2 );
|
CPPUNIT_ASSERT ( finalcut::FSize(1, 2) != s2 );
|
||||||
CPPUNIT_ASSERT ( s1 != finalcut::FSize(2,4) );
|
CPPUNIT_ASSERT ( s1 != finalcut::FSize(2, 4) );
|
||||||
CPPUNIT_ASSERT ( finalcut::FSize() != s2 );
|
CPPUNIT_ASSERT ( finalcut::FSize() != s2 );
|
||||||
CPPUNIT_ASSERT ( s1 != finalcut::FSize() );
|
CPPUNIT_ASSERT ( s1 != finalcut::FSize() );
|
||||||
}
|
}
|
||||||
|
@ -313,12 +314,12 @@ void FSizeTest::LessTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FSizeTest::additionTest()
|
void FSizeTest::additionTest()
|
||||||
{
|
{
|
||||||
const finalcut::FSize s1 (1 ,2);
|
const finalcut::FSize s1 (1, 2);
|
||||||
const finalcut::FSize s2 (5 ,8);
|
const finalcut::FSize s2 (5, 8);
|
||||||
const finalcut::FSize s3 = s1 + s2;
|
const finalcut::FSize s3 = s1 + s2;
|
||||||
CPPUNIT_ASSERT ( s3.getWidth() == 6 );
|
CPPUNIT_ASSERT ( s3.getWidth() == 6 );
|
||||||
CPPUNIT_ASSERT ( s3.getHeight() == 10 );
|
CPPUNIT_ASSERT ( s3.getHeight() == 10 );
|
||||||
CPPUNIT_ASSERT ( s1 + s2 == finalcut::FSize(6 ,10) );
|
CPPUNIT_ASSERT ( s1 + s2 == finalcut::FSize(6, 10) );
|
||||||
CPPUNIT_ASSERT ( s1 + finalcut::FSize() == s1 );
|
CPPUNIT_ASSERT ( s1 + finalcut::FSize() == s1 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FSize() + s2 == s2 );
|
CPPUNIT_ASSERT ( finalcut::FSize() + s2 == s2 );
|
||||||
CPPUNIT_ASSERT ( finalcut::FSize() + finalcut::FSize() == finalcut::FSize() );
|
CPPUNIT_ASSERT ( finalcut::FSize() + finalcut::FSize() == finalcut::FSize() );
|
||||||
|
@ -355,7 +356,7 @@ void FSizeTest::areaTest()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FSizeTest::referenceTest()
|
void FSizeTest::referenceTest()
|
||||||
{
|
{
|
||||||
finalcut::FSize s1 (1,1);
|
finalcut::FSize s1 (1, 1);
|
||||||
CPPUNIT_ASSERT ( s1.getWidth() == 1 );
|
CPPUNIT_ASSERT ( s1.getWidth() == 1 );
|
||||||
CPPUNIT_ASSERT ( s1.getHeight() == 1 );
|
CPPUNIT_ASSERT ( s1.getHeight() == 1 );
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
#define CPPUNIT_ASSERT_CSTRING(expected, actual) \
|
#define CPPUNIT_ASSERT_CSTRING(expected, actual) \
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
#include <cppunit/BriefTestProgressListener.h>
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
@ -31,7 +29,10 @@
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <conemu.h>
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "conemu.h"
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
namespace test
|
namespace test
|
||||||
|
@ -54,17 +55,17 @@ class FSystemTest : public finalcut::FSystem
|
||||||
virtual ~FSystemTest();
|
virtual ~FSystemTest();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual uChar inPortByte (uShort) override;
|
uChar inPortByte (uShort) override;
|
||||||
virtual void outPortByte (uChar, uShort) override;
|
void outPortByte (uChar, uShort) override;
|
||||||
virtual int isTTY (int) override;
|
int isTTY (int) override;
|
||||||
virtual int ioctl (int, uLong, ...) override;
|
int ioctl (int, uLong, ...) override;
|
||||||
virtual int open (const char*, int, ...) override;
|
int open (const char*, int, ...) override;
|
||||||
virtual int close (int) override;
|
int close (int) override;
|
||||||
virtual FILE* fopen (const char*, const char*) override;
|
FILE* fopen (const char*, const char*) override;
|
||||||
virtual int fclose (FILE*) override;
|
int fclose (FILE*) override;
|
||||||
virtual int putchar (int) override;
|
int putchar (int) override;
|
||||||
virtual int tputs (const char*, int, int (*)(int)) override;
|
int tputs (const char*, int, int (*)(int)) override;
|
||||||
virtual uid_t getuid() override;
|
uid_t getuid() override;
|
||||||
std::string& getCharacters();
|
std::string& getCharacters();
|
||||||
int& getCursorType();
|
int& getCursorType();
|
||||||
struct keymap_t& getTerminalKeymap();
|
struct keymap_t& getTerminalKeymap();
|
||||||
|
@ -73,14 +74,14 @@ class FSystemTest : public finalcut::FSystem
|
||||||
// Data Members
|
// Data Members
|
||||||
std::string characters;
|
std::string characters;
|
||||||
int cursor_type = 0;
|
int cursor_type = 0;
|
||||||
static struct keymap_t keymap;
|
static keymap_t keymap;
|
||||||
static struct keymap_t terminal_keymap;
|
static keymap_t terminal_keymap;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
// private Data Member of FSystemTest
|
// private Data Member of FSystemTest
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
struct keymap_t FSystemTest::keymap =
|
keymap_t FSystemTest::keymap =
|
||||||
{
|
{
|
||||||
109, // Number of keys
|
109, // Number of keys
|
||||||
{
|
{
|
||||||
|
@ -363,7 +364,7 @@ struct keymap_t FSystemTest::keymap =
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
struct keymap_t FSystemTest::terminal_keymap{};
|
keymap_t FSystemTest::terminal_keymap{};
|
||||||
|
|
||||||
// constructors and destructor
|
// constructors and destructor
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -587,14 +588,12 @@ class ftermfreebsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
ftermfreebsdTest::ftermfreebsdTest()
|
ftermfreebsdTest::ftermfreebsdTest()
|
||||||
{
|
{ }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ftermfreebsdTest::classNameTest()
|
void ftermfreebsdTest::classNameTest()
|
||||||
{
|
{
|
||||||
const finalcut::FTermFreeBSD p;
|
const finalcut::FTermFreeBSD p{};
|
||||||
const char* const classname = p.getClassName();
|
const char* const classname = p.getClassName();
|
||||||
CPPUNIT_ASSERT ( std::strcmp(classname, "FTermFreeBSD") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(classname, "FTermFreeBSD") == 0 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <cppunit/BriefTestProgressListener.h>
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
@ -86,17 +87,17 @@ class FSystemTest : public finalcut::FSystem
|
||||||
virtual ~FSystemTest();
|
virtual ~FSystemTest();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual uChar inPortByte (uShort) override;
|
uChar inPortByte (uShort) override;
|
||||||
virtual void outPortByte (uChar, uShort) override;
|
void outPortByte (uChar, uShort) override;
|
||||||
virtual int isTTY (int) override;
|
int isTTY (int) override;
|
||||||
virtual int ioctl (int, uLong, ...) override;
|
int ioctl (int, uLong, ...) override;
|
||||||
virtual int open (const char*, int, ...) override;
|
int open (const char*, int, ...) override;
|
||||||
virtual int close (int) override;
|
int close (int) override;
|
||||||
virtual FILE* fopen (const char*, const char*) override;
|
FILE* fopen (const char*, const char*) override;
|
||||||
virtual int fclose (FILE*) override;
|
int fclose (FILE*) override;
|
||||||
virtual int putchar (int) override;
|
int putchar (int) override;
|
||||||
virtual int tputs (const char*, int, int (*)(int)) override;
|
int tputs (const char*, int, int (*)(int)) override;
|
||||||
virtual uid_t getuid() override;
|
uid_t getuid() override;
|
||||||
rgb& getRGB (std::size_t);
|
rgb& getRGB (std::size_t);
|
||||||
console_font_op& getConsoleFont();
|
console_font_op& getConsoleFont();
|
||||||
shiftstate& getShiftState();
|
shiftstate& getShiftState();
|
||||||
|
@ -1470,14 +1471,12 @@ class FTermLinuxTest : public CPPUNIT_NS::TestFixture, test::ConEmu
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FTermLinuxTest::FTermLinuxTest()
|
FTermLinuxTest::FTermLinuxTest()
|
||||||
{
|
{ }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTermLinuxTest::classNameTest()
|
void FTermLinuxTest::classNameTest()
|
||||||
{
|
{
|
||||||
const finalcut::FTermLinux p;
|
const finalcut::FTermLinux p{};
|
||||||
const char* const classname = p.getClassName();
|
const char* const classname = p.getClassName();
|
||||||
CPPUNIT_ASSERT ( std::strcmp(classname, "FTermLinux") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(classname, "FTermLinux") == 0 );
|
||||||
}
|
}
|
||||||
|
@ -2210,7 +2209,7 @@ void FTermLinuxTest::modifierKeyTest()
|
||||||
{
|
{
|
||||||
FKey keycode;
|
FKey keycode;
|
||||||
FKey mod_keycode;
|
FKey mod_keycode;
|
||||||
const finalcut::FTermLinux linux;
|
const finalcut::FTermLinux linux{};
|
||||||
finalcut::FSystem* fsys;
|
finalcut::FSystem* fsys;
|
||||||
fsys = new test::FSystemTest();
|
fsys = new test::FSystemTest();
|
||||||
test::FSystemTest* fsystest = static_cast<test::FSystemTest*>(fsys);
|
test::FSystemTest* fsystest = static_cast<test::FSystemTest*>(fsys);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <cppunit/BriefTestProgressListener.h>
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
@ -72,17 +73,17 @@ class FSystemTest : public finalcut::FSystem
|
||||||
virtual ~FSystemTest();
|
virtual ~FSystemTest();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual uChar inPortByte (uShort) override;
|
uChar inPortByte (uShort) override;
|
||||||
virtual void outPortByte (uChar, uShort) override;
|
void outPortByte (uChar, uShort) override;
|
||||||
virtual int isTTY (int) override;
|
int isTTY (int) override;
|
||||||
virtual int ioctl (int, uLong, ...) override;
|
int ioctl (int, uLong, ...) override;
|
||||||
virtual int open (const char*, int, ...) override;
|
int open (const char*, int, ...) override;
|
||||||
virtual int close (int) override;
|
int close (int) override;
|
||||||
virtual FILE* fopen (const char*, const char*) override;
|
FILE* fopen (const char*, const char*) override;
|
||||||
virtual int fclose (FILE*) override;
|
int fclose (FILE*) override;
|
||||||
virtual int putchar (int) override;
|
int putchar (int) override;
|
||||||
virtual int tputs (const char*, int, int (*)(int)) override;
|
int tputs (const char*, int, int (*)(int)) override;
|
||||||
virtual uid_t getuid() override;
|
uid_t getuid() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_t kbdencoding = 512;
|
kbd_t kbdencoding = 512;
|
||||||
|
@ -265,14 +266,12 @@ class ftermopenbsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
ftermopenbsdTest::ftermopenbsdTest()
|
ftermopenbsdTest::ftermopenbsdTest()
|
||||||
{
|
{ }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void ftermopenbsdTest::classNameTest()
|
void ftermopenbsdTest::classNameTest()
|
||||||
{
|
{
|
||||||
const finalcut::FTermOpenBSD p;
|
const finalcut::FTermOpenBSD p{};
|
||||||
const char* const classname = p.getClassName();
|
const char* const classname = p.getClassName();
|
||||||
CPPUNIT_ASSERT ( std::strcmp(classname, "FTermOpenBSD") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(classname, "FTermOpenBSD") == 0 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue