Small code and text changes
This commit is contained in:
parent
2b33c1875a
commit
b9042d5a03
|
@ -510,7 +510,7 @@ clicked by a keyboard or mouse, it sends the string "clicked". A signal
|
||||||
handler explicitly provided by Widget, in the form of a callback function
|
handler explicitly provided by Widget, in the form of a callback function
|
||||||
or a callback method, can react to such a signal.
|
or a callback method, can react to such a signal.
|
||||||
|
|
||||||
A callback function has no return value can have various arguments:
|
A callback function has no return value and can have various arguments:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void cb_function (FWidget* w, int* i, double* d, ...)
|
void cb_function (FWidget* w, int* i, double* d, ...)
|
||||||
|
@ -527,29 +527,137 @@ void classname::cb_methode (FWidget* w, int* i, double* d, ...)
|
||||||
We use the `addCallback()` method of the `FWidget` class to connect
|
We use the `addCallback()` method of the `FWidget` class to connect
|
||||||
to other widget objects.
|
to other widget objects.
|
||||||
|
|
||||||
For calling functions and static methods:
|
(1) For calling functions or static methods via a pointer:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
template<typename Function
|
||||||
|
, typename FunctionPointer<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
void FWidget::addCallback ( const FString& cb_signal
|
void FWidget::addCallback ( const FString& cb_signal
|
||||||
, FCallback cb_handler
|
, Function&& cb_function
|
||||||
, FDataPtr data )
|
, Args&&... args)
|
||||||
{...}
|
{...}
|
||||||
```
|
```
|
||||||
|
|
||||||
For calling a member method of a specific instance:
|
(2) For calling functions or static methods via a reference:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
template<typename Function
|
||||||
|
, typename FunctionReference<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
void FWidget::addCallback ( const FString& cb_signal
|
void FWidget::addCallback ( const FString& cb_signal
|
||||||
, FWidget* cb_instance
|
, Function& cb_function
|
||||||
, FMemberCallback cb_handler
|
, Args&&... args)
|
||||||
, FDataPtr data )
|
|
||||||
{...}
|
{...}
|
||||||
```
|
```
|
||||||
|
|
||||||
There are two macros `F_FUNCTION_CALLBACK` and `F_METHOD_CALLBACK` to avoid
|
(3) For calling a member method of a specific instance:
|
||||||
having to deal with necessary type conversions. With `delCallback()` you can
|
|
||||||
remove a connection to a signal handler or a widget. Alternatively, you can
|
```cpp
|
||||||
use `delAllCallbacks()` to remove all existing callbacks from an object.
|
template<typename Object
|
||||||
|
, typename Function
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr
|
||||||
|
, typename MemberFunctionPointer<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void FWidget::addCallback ( const FString& cb_signal
|
||||||
|
, Object&& cb_instance
|
||||||
|
, Function&& cb_member
|
||||||
|
, Args&&... args)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
(4) For calling a std::bind call wrapper or a lambda expression:
|
||||||
|
```cpp
|
||||||
|
template<typename Function
|
||||||
|
, typename ClassObject<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void FWidget::addCallback ( const FString& cb_signal
|
||||||
|
, Function&& cb_function
|
||||||
|
, Args&&... args)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
(5) For calling a std::bind call wrapper to a specific instance:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename Object
|
||||||
|
, typename Function
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr
|
||||||
|
, typename ClassObject<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void FWidget::addCallback ( const FString& cb_signal
|
||||||
|
, Object&& cb_instance
|
||||||
|
, Function&& cb_function
|
||||||
|
, Args&&... args)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
(6) For calling a lambda function that has been stored in a variable
|
||||||
|
with the keyword auto:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename Function
|
||||||
|
, typename ClassObject<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void FWidget::addCallback ( const FString& cb_signal
|
||||||
|
, Function& cb_function
|
||||||
|
, Args&&... args)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
With `delCallback(...)` you can remove a connection to a signal handler
|
||||||
|
or a widget instance. Alternatively, you can use `delCallbacks()` to
|
||||||
|
remove all existing callbacks from an object.
|
||||||
|
|
||||||
|
To delete functions or static methods callbacks via a pointer:(4)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename FunctionPtr
|
||||||
|
, typename FunctionPointer<FunctionPtr>::type = nullptr>
|
||||||
|
void FWidget::delCallback (FunctionPtr&& cb_func_ptr)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete functions or static methods callbacks via a reference:(5)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename Function
|
||||||
|
, typename FunctionReference<Function>::type = nullptr>
|
||||||
|
void FWidget::delCallback (Function& cb_function)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete all callbacks from a specific instance:(1)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename Object
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr>
|
||||||
|
void FWidget::delCallback (Object&& cb_instance)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete all callbacks of a signal:(2)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
void delCallback (const FString& cb_signal)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete all callbacks of a signal and specific instance:(3)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename Object
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr>
|
||||||
|
void delCallback (const FString& cb_signal, Object&& cb_instance)
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
To delete all callbacks from a widget:(6)
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
void delCallback()
|
||||||
|
{...}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### The FINAL CUT widgets emit the following default signals ###
|
### The FINAL CUT widgets emit the following default signals ###
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
|
@ -28,7 +28,10 @@
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
namespace fc = finalcut::fc;
|
namespace fc = finalcut::fc;
|
||||||
using namespace std::chrono;
|
using std::chrono::duration_cast;
|
||||||
|
using std::chrono::milliseconds;
|
||||||
|
using std::chrono::system_clock;
|
||||||
|
using std::chrono::time_point;
|
||||||
using finalcut::FPoint;
|
using finalcut::FPoint;
|
||||||
using finalcut::FSize;
|
using finalcut::FSize;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace fc = finalcut::fc;
|
||||||
void tcapBoolean (const std::string&, bool);
|
void tcapBoolean (const std::string&, bool);
|
||||||
void tcapNumeric (const std::string&, int);
|
void tcapNumeric (const std::string&, int);
|
||||||
void tcapString (const std::string&, const char[]);
|
void tcapString (const std::string&, const char[]);
|
||||||
void debug (finalcut::FApplication&);
|
void debug (const finalcut::FApplication&);
|
||||||
void booleans();
|
void booleans();
|
||||||
void numeric();
|
void numeric();
|
||||||
void string();
|
void string();
|
||||||
|
@ -207,7 +207,7 @@ void tcapString (const std::string& name, const char cap_str[])
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
void debug (finalcut::FApplication& TermApp)
|
void debug (const finalcut::FApplication& TermApp)
|
||||||
{
|
{
|
||||||
const auto& fterm = TermApp.getFTerm();
|
const auto& fterm = TermApp.getFTerm();
|
||||||
auto& debug_data = fterm.getFTermDebugData();
|
auto& debug_data = fterm.getFTermDebugData();
|
||||||
|
|
|
@ -103,7 +103,6 @@ ProgressDialog::ProgressDialog (finalcut::FWidget* parent)
|
||||||
progressBar.setGeometry(FPoint{2, 3}, FSize{34, 1}, false);
|
progressBar.setGeometry(FPoint{2, 3}, FSize{34, 1}, false);
|
||||||
//progressBar.setPercentage(78);
|
//progressBar.setPercentage(78);
|
||||||
|
|
||||||
using namespace std::placeholders;
|
|
||||||
reset.addCallback
|
reset.addCallback
|
||||||
(
|
(
|
||||||
"clicked",
|
"clicked",
|
||||||
|
@ -293,7 +292,7 @@ class MyDialog final : public finalcut::FDialog
|
||||||
void onClose (finalcut::FCloseEvent*) override;
|
void onClose (finalcut::FCloseEvent*) override;
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_noFunctionMsg (finalcut::FButton&);
|
void cb_noFunctionMsg (const finalcut::FButton&);
|
||||||
void cb_about();
|
void cb_about();
|
||||||
void cb_terminfo();
|
void cb_terminfo();
|
||||||
void cb_drives();
|
void cb_drives();
|
||||||
|
@ -311,7 +310,7 @@ class MyDialog final : public finalcut::FDialog
|
||||||
void cb_activateButton ( const finalcut::FRadioButton&
|
void cb_activateButton ( const finalcut::FRadioButton&
|
||||||
, finalcut::FButton& ) const;
|
, finalcut::FButton& ) const;
|
||||||
void cb_view (const finalcut::FMenuItem*);
|
void cb_view (const finalcut::FMenuItem*);
|
||||||
void cb_setInput (finalcut::FListBox&, finalcut::FLineEdit&) const;
|
void cb_setInput (const finalcut::FListBox&, finalcut::FLineEdit&) const;
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
bool initialized{false};
|
bool initialized{false};
|
||||||
|
@ -805,7 +804,7 @@ void MyDialog::onClose (finalcut::FCloseEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_noFunctionMsg (finalcut::FButton& button)
|
void MyDialog::cb_noFunctionMsg (const finalcut::FButton& button)
|
||||||
{
|
{
|
||||||
auto text = button.getText();
|
auto text = button.getText();
|
||||||
text = text.replace('&', "");
|
text = text.replace('&', "");
|
||||||
|
@ -1033,7 +1032,7 @@ void MyDialog::cb_view (const finalcut::FMenuItem* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void MyDialog::cb_setInput ( finalcut::FListBox& listbox
|
void MyDialog::cb_setInput ( const finalcut::FListBox& listbox
|
||||||
, finalcut::FLineEdit& lineedit) const
|
, finalcut::FLineEdit& lineedit) const
|
||||||
{
|
{
|
||||||
lineedit = listbox.getItem(listbox.currentItem()).getText();
|
lineedit = listbox.getItem(listbox.currentItem()).getText();
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
namespace fc = finalcut::fc;
|
namespace fc = finalcut::fc;
|
||||||
|
|
|
@ -38,5 +38,52 @@ FCallback::FCallback()
|
||||||
FCallback::~FCallback() // destructor
|
FCallback::~FCallback() // destructor
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
// public methods of FCallback
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FCallback::delCallback (const FString& cb_signal)
|
||||||
|
{
|
||||||
|
// Deletes entries with the given signal from the callback list
|
||||||
|
|
||||||
|
if ( callback_objects.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto iter = callback_objects.begin();
|
||||||
|
|
||||||
|
while ( iter != callback_objects.end() )
|
||||||
|
{
|
||||||
|
if ( iter->cb_signal == cb_signal )
|
||||||
|
iter = callback_objects.erase(iter);
|
||||||
|
else
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FCallback::delCallback()
|
||||||
|
{
|
||||||
|
// Delete all callbacks from this widget
|
||||||
|
|
||||||
|
callback_objects.clear(); // function pointer
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FCallback::emitCallback (const FString& emit_signal) const
|
||||||
|
{
|
||||||
|
// Initiate callback for the given signal
|
||||||
|
|
||||||
|
if ( callback_objects.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (auto&& cback : callback_objects)
|
||||||
|
{
|
||||||
|
if ( cback.cb_signal == emit_signal )
|
||||||
|
{
|
||||||
|
// Calling the stored function pointer
|
||||||
|
cback.cb_function();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
#include "final/fcolorpair.h"
|
#include "final/fcolorpair.h"
|
||||||
#include "final/fcombobox.h"
|
#include "final/fcombobox.h"
|
||||||
|
|
|
@ -235,7 +235,7 @@ void FFocusEvent::ignore()
|
||||||
// class FAccelEvent
|
// class FAccelEvent
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
FAccelEvent::FAccelEvent (fc::events ev_type, void* focused) // constructor
|
FAccelEvent::FAccelEvent (fc::events ev_type, FWidget* focused) // constructor
|
||||||
: FEvent{ev_type}
|
: FEvent{ev_type}
|
||||||
, focus_widget{focused}
|
, focus_widget{focused}
|
||||||
{ }
|
{ }
|
||||||
|
@ -245,7 +245,7 @@ FAccelEvent::~FAccelEvent() // destructor
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void* FAccelEvent::focusedWidget() const
|
FWidget* FAccelEvent::focusedWidget() const
|
||||||
{ return focus_widget; }
|
{ return focus_widget; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -644,7 +644,7 @@ void FListBox::adjustSize()
|
||||||
|
|
||||||
// private methods of FListBox
|
// private methods of FListBox
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FString& FListBox::getString (listBoxItems::iterator iter)
|
inline FString FListBox::getString (listBoxItems::iterator iter)
|
||||||
{
|
{
|
||||||
return iter->getText();
|
return iter->getText();
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,10 @@
|
||||||
#include <strings.h> // need for strcasecmp
|
#include <strings.h> // need for strcasecmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/emptyfstring.h"
|
#include "final/emptyfstring.h"
|
||||||
|
|
|
@ -45,7 +45,7 @@ FLog::~FLog() // destructor
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FLog& FLog::operator << (LogLevel l)
|
FLog& FLog::operator << (LogLevel l)
|
||||||
{
|
{
|
||||||
using namespace std::placeholders;
|
using std::placeholders::_1;
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
switch ( l )
|
switch ( l )
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "final/flogger.h"
|
#include "final/flogger.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
#include "final/fdialog.h"
|
#include "final/fdialog.h"
|
||||||
|
|
|
@ -20,12 +20,13 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "final/fconfig.h"
|
#include "final/fconfig.h"
|
||||||
#include "final/fkeyboard.h"
|
#include "final/fkeyboard.h"
|
||||||
|
@ -843,7 +844,8 @@ void FMouseSGR::setMoveState (const FPoint& mouse_position, int btn)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMouseSGR::setPressedButtonState (const int btn, const struct timeval* time)
|
void FMouseSGR::setPressedButtonState ( const int btn
|
||||||
|
, const struct timeval* time )
|
||||||
{
|
{
|
||||||
// Gets the extended x11 mouse mode (SGR) status for pressed buttons
|
// Gets the extended x11 mouse mode (SGR) status for pressed buttons
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fpoint.h"
|
#include "final/fpoint.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
#include "final/fradiomenuitem.h"
|
#include "final/fradiomenuitem.h"
|
||||||
#include "final/fmenu.h"
|
#include "final/fmenu.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fpoint.h"
|
#include "final/fpoint.h"
|
||||||
#include "final/frect.h"
|
#include "final/frect.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fpoint.h"
|
#include "final/fpoint.h"
|
||||||
#include "final/fsize.h"
|
#include "final/fsize.h"
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
#include "final/fstringstream.h"
|
#include "final/fstringstream.h"
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <limits>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
#include "final/fcharmap.h"
|
#include "final/fcharmap.h"
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
{ \
|
{ \
|
||||||
if ( ! FApplication::isQuit() ) \
|
if ( ! FApplication::isQuit() ) \
|
||||||
warnNotInitialized(); \
|
warnNotInitialized(); \
|
||||||
|
\
|
||||||
return ret_value; \
|
return ret_value; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
{ \
|
{ \
|
||||||
if ( ! FApplication::isQuit() ) \
|
if ( ! FApplication::isQuit() ) \
|
||||||
warnNotInitialized(); \
|
warnNotInitialized(); \
|
||||||
|
\
|
||||||
return ret_value; \
|
return ret_value; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
{ \
|
{ \
|
||||||
if ( ! FApplication::isQuit() ) \
|
if ( ! FApplication::isQuit() ) \
|
||||||
warnNotInitialized(); \
|
warnNotInitialized(); \
|
||||||
|
\
|
||||||
return ret_value; \
|
return ret_value; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,8 +159,9 @@ void FToolTip::calculateDimensions()
|
||||||
|
|
||||||
int x{};
|
int x{};
|
||||||
int y{};
|
int y{};
|
||||||
const std::size_t h = ( hasBorder() ) ? text_num_lines + 2 : text_num_lines;
|
bool border = hasBorder();
|
||||||
const std::size_t w = ( hasBorder() ) ? max_line_width + 4 : max_line_width + 2;
|
const std::size_t h = ( border ) ? text_num_lines + 2 : text_num_lines;
|
||||||
|
const std::size_t w = ( border ) ? max_line_width + 4 : max_line_width + 2;
|
||||||
const auto& r = getRootWidget();
|
const auto& r = getRootWidget();
|
||||||
|
|
||||||
if ( r )
|
if ( r )
|
||||||
|
|
|
@ -252,7 +252,7 @@ void FVTerm::putVTerm()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateTerminal()
|
void FVTerm::updateTerminal() const
|
||||||
{
|
{
|
||||||
// Updates pending changes to the terminal
|
// Updates pending changes to the terminal
|
||||||
|
|
||||||
|
@ -655,7 +655,7 @@ void FVTerm::flush()
|
||||||
|
|
||||||
while ( ! output_buffer->empty() )
|
while ( ! output_buffer->empty() )
|
||||||
{
|
{
|
||||||
const static FTerm::defaultPutChar& FTermPutchar = FTerm::putchar();
|
static const FTerm::defaultPutChar& FTermPutchar = FTerm::putchar();
|
||||||
FTermPutchar (output_buffer->front());
|
FTermPutchar (output_buffer->front());
|
||||||
output_buffer->pop();
|
output_buffer->pop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ class FButton : public FWidget
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
const FString getClassName() const override;
|
const FString getClassName() const override;
|
||||||
FString& getText();
|
FString getText() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setForegroundColor (FColor) override;
|
void setForegroundColor (FColor) override;
|
||||||
|
@ -178,7 +178,7 @@ inline const FString FButton::getClassName() const
|
||||||
{ return "FButton"; }
|
{ return "FButton"; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FString& FButton::getText()
|
inline FString FButton::getText() const
|
||||||
{ return text; }
|
{ return text; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
|
@ -64,7 +67,7 @@ struct FCallbackData
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
FCallbackData (const FCallbackData&) = default;
|
FCallbackData (const FCallbackData&) = default;
|
||||||
FCallbackData (FCallbackData&&) noexcept = default;
|
FCallbackData (FCallbackData&&) = default;
|
||||||
|
|
||||||
FCallbackData& operator = (const FCallbackData&) = default;
|
FCallbackData& operator = (const FCallbackData&) = default;
|
||||||
FCallbackData& operator = (FCallbackData&&) noexcept = default;
|
FCallbackData& operator = (FCallbackData&&) noexcept = default;
|
||||||
|
@ -144,15 +147,8 @@ class FCallback
|
||||||
FCallback& operator = (const FCallback&) = delete;
|
FCallback& operator = (const FCallback&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
const FString getClassName() const
|
const FString getClassName() const;
|
||||||
{
|
std::size_t getCallbackCount() const;
|
||||||
return "FCallback";
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t getCallbackCount() const
|
|
||||||
{
|
|
||||||
return callback_objects.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
template<typename Object
|
template<typename Object
|
||||||
|
@ -161,6 +157,82 @@ class FCallback
|
||||||
, typename MemberFunctionPointer<Function>::type = nullptr
|
, typename MemberFunctionPointer<Function>::type = nullptr
|
||||||
, typename... Args>
|
, typename... Args>
|
||||||
void addCallback ( const FString& cb_signal
|
void addCallback ( const FString& cb_signal
|
||||||
|
, Object&& cb_instance
|
||||||
|
, Function&& cb_member
|
||||||
|
, Args&&... args);
|
||||||
|
template<typename Object
|
||||||
|
, typename Function
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr
|
||||||
|
, typename ClassObject<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void addCallback ( const FString& cb_signal
|
||||||
|
, Object&& cb_instance
|
||||||
|
, Function&& cb_function
|
||||||
|
, Args&&... args);
|
||||||
|
template<typename Function
|
||||||
|
, typename ClassObject<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void addCallback ( const FString& cb_signal
|
||||||
|
, Function&& cb_function
|
||||||
|
, Args&&... args);
|
||||||
|
template<typename Function
|
||||||
|
, typename ClassObject<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void addCallback ( const FString& cb_signal
|
||||||
|
, Function& cb_function
|
||||||
|
, Args&&... args);
|
||||||
|
template<typename Function
|
||||||
|
, typename FunctionReference<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void addCallback ( const FString& cb_signal
|
||||||
|
, Function& cb_function
|
||||||
|
, Args&&... args);
|
||||||
|
template<typename Function
|
||||||
|
, typename FunctionPointer<Function>::type = nullptr
|
||||||
|
, typename... Args>
|
||||||
|
void addCallback ( const FString& cb_signal
|
||||||
|
, Function&& cb_function
|
||||||
|
, Args&&... args);
|
||||||
|
template<typename Object
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr>
|
||||||
|
void delCallback (Object&& cb_instance);
|
||||||
|
void delCallback (const FString& cb_signal);
|
||||||
|
template<typename Object
|
||||||
|
, typename ObjectPointer<Object>::type = nullptr>
|
||||||
|
void delCallback (const FString& cb_signal, Object&& cb_instance);
|
||||||
|
template<typename FunctionPtr
|
||||||
|
, typename FunctionPointer<FunctionPtr>::type = nullptr>
|
||||||
|
void delCallback (FunctionPtr&& cb_func_ptr);
|
||||||
|
template<typename Function
|
||||||
|
, typename FunctionReference<Function>::type = nullptr>
|
||||||
|
void delCallback (const Function& cb_function);
|
||||||
|
void delCallback();
|
||||||
|
void emitCallback (const FString& emit_signal) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Typedefs
|
||||||
|
typedef std::vector<FCallbackData> FCallbackObjects;
|
||||||
|
|
||||||
|
// Data members
|
||||||
|
FCallbackObjects callback_objects{};
|
||||||
|
};
|
||||||
|
|
||||||
|
// FCallback inline functions
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline const FString FCallback::getClassName() const
|
||||||
|
{ return "FCallback"; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline std::size_t FCallback::getCallbackCount() const
|
||||||
|
{ return callback_objects.size(); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
template<typename Object
|
||||||
|
, typename Function
|
||||||
|
, typename FCallback::ObjectPointer<Object>::type
|
||||||
|
, typename FCallback::MemberFunctionPointer<Function>::type
|
||||||
|
, typename... Args>
|
||||||
|
inline void FCallback::addCallback ( const FString& cb_signal
|
||||||
, Object&& cb_instance
|
, Object&& cb_instance
|
||||||
, Function&& cb_member
|
, Function&& cb_member
|
||||||
, Args&&... args)
|
, Args&&... args)
|
||||||
|
@ -175,12 +247,13 @@ class FCallback
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
template<typename Object
|
template<typename Object
|
||||||
, typename Function
|
, typename Function
|
||||||
, typename ObjectPointer<Object>::type = nullptr
|
, typename FCallback::ObjectPointer<Object>::type
|
||||||
, typename ClassObject<Function>::type = nullptr
|
, typename FCallback::ClassObject<Function>::type
|
||||||
, typename... Args>
|
, typename... Args>
|
||||||
void addCallback ( const FString& cb_signal
|
inline void FCallback::addCallback ( const FString& cb_signal
|
||||||
, Object&& cb_instance
|
, Object&& cb_instance
|
||||||
, Function&& cb_function
|
, Function&& cb_function
|
||||||
, Args&&... args)
|
, Args&&... args)
|
||||||
|
@ -192,10 +265,11 @@ class FCallback
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
template<typename Function
|
template<typename Function
|
||||||
, typename ClassObject<Function>::type = nullptr
|
, typename FCallback::ClassObject<Function>::type
|
||||||
, typename... Args>
|
, typename... Args>
|
||||||
void addCallback ( const FString& cb_signal
|
inline void FCallback::addCallback ( const FString& cb_signal
|
||||||
, Function&& cb_function
|
, Function&& cb_function
|
||||||
, Args&&... args)
|
, Args&&... args)
|
||||||
{
|
{
|
||||||
|
@ -207,14 +281,30 @@ class FCallback
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
template<typename Function
|
template<typename Function
|
||||||
, typename FunctionReference<Function>::type = nullptr
|
, typename FCallback::ClassObject<Function>::type
|
||||||
, typename... Args>
|
, typename... Args>
|
||||||
void addCallback ( const FString& cb_signal
|
inline void FCallback::addCallback ( const FString& cb_signal
|
||||||
, Function& cb_function
|
, Function& cb_function
|
||||||
, Args&&... args)
|
, Args&&... args)
|
||||||
{
|
{
|
||||||
// Add a function as callback
|
// Add a function object reference as callback
|
||||||
|
|
||||||
|
auto fn = std::bind (cb_function, std::forward<Args>(args)...);
|
||||||
|
FCallbackData obj{ cb_signal, nullptr, nullptr, fn };
|
||||||
|
callback_objects.push_back(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
template<typename Function
|
||||||
|
, typename FCallback::FunctionReference<Function>::type
|
||||||
|
, typename... Args>
|
||||||
|
inline void FCallback::addCallback ( const FString& cb_signal
|
||||||
|
, Function& cb_function
|
||||||
|
, Args&&... args)
|
||||||
|
{
|
||||||
|
// Add a function reference as callback
|
||||||
|
|
||||||
auto ptr = reinterpret_cast<void*>(&cb_function);
|
auto ptr = reinterpret_cast<void*>(&cb_function);
|
||||||
auto fn = std::bind (cb_function, std::forward<Args>(args)...);
|
auto fn = std::bind (cb_function, std::forward<Args>(args)...);
|
||||||
|
@ -222,10 +312,11 @@ class FCallback
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
template<typename Function
|
template<typename Function
|
||||||
, typename FunctionPointer<Function>::type = nullptr
|
, typename FCallback::FunctionPointer<Function>::type
|
||||||
, typename... Args>
|
, typename... Args>
|
||||||
void addCallback ( const FString& cb_signal
|
inline void FCallback::addCallback ( const FString& cb_signal
|
||||||
, Function&& cb_function
|
, Function&& cb_function
|
||||||
, Args&&... args)
|
, Args&&... args)
|
||||||
{
|
{
|
||||||
|
@ -238,23 +329,10 @@ class FCallback
|
||||||
callback_objects.push_back(obj);
|
callback_objects.push_back(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Function
|
//----------------------------------------------------------------------
|
||||||
, typename ClassObject<Function>::type = nullptr
|
|
||||||
, typename... Args>
|
|
||||||
void addCallback ( const FString& cb_signal
|
|
||||||
, Function& cb_function
|
|
||||||
, Args&&... args)
|
|
||||||
{
|
|
||||||
// Add a non-union class type as callback
|
|
||||||
|
|
||||||
auto fn = std::bind (cb_function, std::forward<Args>(args)...);
|
|
||||||
FCallbackData obj{ cb_signal, nullptr, nullptr, fn };
|
|
||||||
callback_objects.push_back(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Object
|
template<typename Object
|
||||||
, typename ObjectPointer<Object>::type = nullptr>
|
, typename FCallback::ObjectPointer<Object>::type>
|
||||||
void delCallback (Object&& cb_instance)
|
inline void FCallback::delCallback (Object&& cb_instance)
|
||||||
{
|
{
|
||||||
// Deletes entries with the given instance from the callback list
|
// Deletes entries with the given instance from the callback list
|
||||||
|
|
||||||
|
@ -272,27 +350,10 @@ class FCallback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void delCallback (const FString& cb_signal)
|
//----------------------------------------------------------------------
|
||||||
{
|
|
||||||
// Deletes entries with the given signal from the callback list
|
|
||||||
|
|
||||||
if ( callback_objects.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto iter = callback_objects.begin();
|
|
||||||
|
|
||||||
while ( iter != callback_objects.end() )
|
|
||||||
{
|
|
||||||
if ( iter->cb_signal == cb_signal )
|
|
||||||
iter = callback_objects.erase(iter);
|
|
||||||
else
|
|
||||||
++iter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Object
|
template<typename Object
|
||||||
, typename ObjectPointer<Object>::type = nullptr>
|
, typename FCallback::ObjectPointer<Object>::type>
|
||||||
void delCallback (const FString& cb_signal, Object&& cb_instance)
|
inline void FCallback::delCallback (const FString& cb_signal, Object&& cb_instance)
|
||||||
{
|
{
|
||||||
// Deletes entries with the given signal and instance
|
// Deletes entries with the given signal and instance
|
||||||
// from the callback list
|
// from the callback list
|
||||||
|
@ -312,9 +373,10 @@ class FCallback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
template<typename FunctionPtr
|
template<typename FunctionPtr
|
||||||
, typename FunctionPointer<FunctionPtr>::type = nullptr>
|
, typename FCallback::FunctionPointer<FunctionPtr>::type>
|
||||||
void delCallback (FunctionPtr&& cb_func_ptr)
|
inline void FCallback::delCallback (FunctionPtr&& cb_func_ptr)
|
||||||
{
|
{
|
||||||
// Deletes entries with the given function pointer
|
// Deletes entries with the given function pointer
|
||||||
// from the callback list
|
// from the callback list
|
||||||
|
@ -334,11 +396,13 @@ class FCallback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
template<typename Function
|
template<typename Function
|
||||||
, typename FunctionReference<Function>::type = nullptr>
|
, typename FCallback::FunctionReference<Function>::type>
|
||||||
void delCallback (Function& cb_function)
|
inline void FCallback::delCallback (const Function& cb_function)
|
||||||
{
|
{
|
||||||
// Deletes entries with the given function from the callback list
|
// Deletes entries with the given function reference
|
||||||
|
// from the callback list
|
||||||
|
|
||||||
if ( callback_objects.empty() )
|
if ( callback_objects.empty() )
|
||||||
return;
|
return;
|
||||||
|
@ -355,39 +419,6 @@ class FCallback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void delCallback()
|
|
||||||
{
|
|
||||||
// Delete all callbacks from this widget
|
|
||||||
|
|
||||||
callback_objects.clear(); // function pointer
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void emitCallback (const FString& emit_signal) const
|
|
||||||
{
|
|
||||||
// Initiate callback for the given signal
|
|
||||||
|
|
||||||
if ( callback_objects.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (auto&& cback : callback_objects)
|
|
||||||
{
|
|
||||||
if ( cback.cb_signal == emit_signal )
|
|
||||||
{
|
|
||||||
// Calling the stored function pointer
|
|
||||||
cback.cb_function();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Typedefs
|
|
||||||
typedef std::vector<FCallbackData> FCallbackObjects;
|
|
||||||
|
|
||||||
// Data members
|
|
||||||
FCallbackObjects callback_objects{};
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
||||||
#endif // FCALLBACK_H
|
#endif // FCALLBACK_H
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct FData
|
struct FData
|
||||||
{
|
{
|
||||||
|
|
|
@ -194,7 +194,8 @@ class FDialog : public FWindow
|
||||||
void leaveZoomButton (const mouseStates&);
|
void leaveZoomButton (const mouseStates&);
|
||||||
void pressZoomButton (const mouseStates&);
|
void pressZoomButton (const mouseStates&);
|
||||||
bool isMouseOverMenu (const FPoint&) const;
|
bool isMouseOverMenu (const FPoint&) const;
|
||||||
void passEventToSubMenu (const mouseStates&, const FMouseEvent*);
|
void passEventToSubMenu ( const mouseStates&
|
||||||
|
, const FMouseEvent* );
|
||||||
void moveSizeKey (FKeyEvent*);
|
void moveSizeKey (FKeyEvent*);
|
||||||
void raiseActivateDialog();
|
void raiseActivateDialog();
|
||||||
void lowerActivateDialog();
|
void lowerActivateDialog();
|
||||||
|
|
|
@ -218,24 +218,25 @@ class FFocusEvent : public FEvent // focus event
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FAccelEvent
|
// class FAccelEvent
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
class FWidget; // class forward declaration
|
||||||
|
|
||||||
class FAccelEvent : public FEvent // focus event
|
class FAccelEvent : public FEvent // focus event
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FAccelEvent() = default;
|
FAccelEvent() = default;
|
||||||
FAccelEvent (fc::events, void*);
|
FAccelEvent (fc::events, FWidget*);
|
||||||
FAccelEvent (const FAccelEvent&) = delete;
|
FAccelEvent (const FAccelEvent&) = delete;
|
||||||
~FAccelEvent();
|
~FAccelEvent();
|
||||||
FAccelEvent& operator = (const FAccelEvent&) = delete;
|
FAccelEvent& operator = (const FAccelEvent&) = delete;
|
||||||
|
|
||||||
void* focusedWidget() const;
|
FWidget* focusedWidget() const;
|
||||||
bool isAccepted() const;
|
bool isAccepted() const;
|
||||||
void accept();
|
void accept();
|
||||||
void ignore();
|
void ignore();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool accpt{false};
|
bool accpt{false};
|
||||||
void* focus_widget{};
|
FWidget* focus_widget{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ class FListBoxItem
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
virtual const FString getClassName() const;
|
virtual const FString getClassName() const;
|
||||||
virtual FString& getText();
|
virtual FString getText() const;
|
||||||
virtual FDataPtr getData() const;
|
virtual FDataPtr getData() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
|
@ -110,7 +110,7 @@ inline const FString FListBoxItem::getClassName() const
|
||||||
{ return "FListBoxItem"; }
|
{ return "FListBoxItem"; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FString& FListBoxItem::getText()
|
inline FString FListBoxItem::getText() const
|
||||||
{ return text; }
|
{ return text; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -247,7 +247,7 @@ class FListBox : public FWidget
|
||||||
};
|
};
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
static FString& getString (listBoxItems::iterator);
|
static FString getString (listBoxItems::iterator);
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
bool isHorizontallyScrollable() const;
|
bool isHorizontallyScrollable() const;
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fscrollbar.h"
|
#include "final/fscrollbar.h"
|
||||||
|
|
|
@ -54,6 +54,8 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
#include "final/fmenulist.h"
|
#include "final/fmenulist.h"
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,6 @@ void initScrollbar ( FScrollbarPtr& bar
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace std::placeholders;
|
|
||||||
bar->setMinimum(0);
|
bar->setMinimum(0);
|
||||||
bar->setValue(0);
|
bar->setValue(0);
|
||||||
bar->hide();
|
bar->hide();
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
#include "final/ftypes.h"
|
#include "final/ftypes.h"
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
#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
|
||||||
|
|
|
@ -166,7 +166,7 @@ class FTerm final
|
||||||
typedef FColorPalette::FSetPalette FSetPalette;
|
typedef FColorPalette::FSetPalette FSetPalette;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit FTerm();
|
FTerm();
|
||||||
|
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
FTerm (const FTerm&) = delete;
|
FTerm (const FTerm&) = delete;
|
||||||
|
|
|
@ -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 <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// FTermcap string macro
|
// FTermcap string macro
|
||||||
|
|
|
@ -118,7 +118,7 @@ class FVTerm
|
||||||
};
|
};
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit FVTerm();
|
FVTerm();
|
||||||
|
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
FVTerm (const FVTerm&) = delete;
|
FVTerm (const FVTerm&) = delete;
|
||||||
|
@ -148,7 +148,7 @@ class FVTerm
|
||||||
const FTermArea* getVWin() const;
|
const FTermArea* getVWin() const;
|
||||||
const FPoint getPrintCursor();
|
const FPoint getPrintCursor();
|
||||||
static const FChar getAttribute();
|
static const FChar getAttribute();
|
||||||
FTerm& getFTerm();
|
FTerm& getFTerm() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setTermXY (int, int) const;
|
void setTermXY (int, int) const;
|
||||||
|
@ -253,7 +253,7 @@ class FVTerm
|
||||||
void createVTerm (const FSize&);
|
void createVTerm (const FSize&);
|
||||||
void resizeVTerm (const FSize&) const;
|
void resizeVTerm (const FSize&) const;
|
||||||
void putVTerm();
|
void putVTerm();
|
||||||
void updateTerminal();
|
void updateTerminal() const;
|
||||||
virtual void addPreprocessingHandler ( const FVTerm*
|
virtual void addPreprocessingHandler ( const FVTerm*
|
||||||
, const FPreprocessingFunction& );
|
, const FPreprocessingFunction& );
|
||||||
virtual void delPreprocessingHandler (const FVTerm*);
|
virtual void delPreprocessingHandler (const FVTerm*);
|
||||||
|
@ -629,7 +629,7 @@ inline const FChar FVTerm::getAttribute()
|
||||||
{ return next_attribute; }
|
{ return next_attribute; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FTerm& FVTerm::getFTerm()
|
inline FTerm& FVTerm::getFTerm() const
|
||||||
{ return *fterm; }
|
{ return *fterm; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -95,6 +95,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fc.h"
|
#include "final/fc.h"
|
||||||
#include "final/sgr_optimizer.h"
|
#include "final/sgr_optimizer.h"
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -121,12 +123,12 @@ class FCallbackTest : public CPPUNIT_NS::TestFixture
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void classNameTest();
|
void classNameTest();
|
||||||
void memberFunctionCallbackTest();
|
void memberFunctionPointerCallbackTest();
|
||||||
void instanceWithFunctionCallbackTest();
|
void instanceWithFunctionObjectCallbackTest();
|
||||||
void functionObjectTest();
|
void functionObjectCallbackTest();
|
||||||
void functionCallbackTest();
|
void functionObjectReferenceCallbackTest();
|
||||||
|
void functionReferenceCallbackTest();
|
||||||
void functionPointerCallbackTest();
|
void functionPointerCallbackTest();
|
||||||
void nonUnionClassCallbackTest();
|
|
||||||
void ownWidgetTest();
|
void ownWidgetTest();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -135,12 +137,12 @@ class FCallbackTest : public CPPUNIT_NS::TestFixture
|
||||||
|
|
||||||
// Add a methods to the test suite
|
// Add a methods to the test suite
|
||||||
CPPUNIT_TEST (classNameTest);
|
CPPUNIT_TEST (classNameTest);
|
||||||
CPPUNIT_TEST (memberFunctionCallbackTest);
|
CPPUNIT_TEST (memberFunctionPointerCallbackTest);
|
||||||
CPPUNIT_TEST (instanceWithFunctionCallbackTest);
|
CPPUNIT_TEST (instanceWithFunctionObjectCallbackTest);
|
||||||
CPPUNIT_TEST (functionObjectTest);
|
CPPUNIT_TEST (functionObjectCallbackTest);
|
||||||
CPPUNIT_TEST (functionCallbackTest);
|
CPPUNIT_TEST (functionObjectReferenceCallbackTest);
|
||||||
|
CPPUNIT_TEST (functionReferenceCallbackTest);
|
||||||
CPPUNIT_TEST (functionPointerCallbackTest);
|
CPPUNIT_TEST (functionPointerCallbackTest);
|
||||||
CPPUNIT_TEST (nonUnionClassCallbackTest);
|
|
||||||
CPPUNIT_TEST (ownWidgetTest);
|
CPPUNIT_TEST (ownWidgetTest);
|
||||||
|
|
||||||
// End of test suite definition
|
// End of test suite definition
|
||||||
|
@ -162,7 +164,7 @@ void FCallbackTest::classNameTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FCallbackTest::memberFunctionCallbackTest()
|
void FCallbackTest::memberFunctionPointerCallbackTest()
|
||||||
{
|
{
|
||||||
finalcut::FCallback cb{};
|
finalcut::FCallback cb{};
|
||||||
cb_class c{5, &root_widget};
|
cb_class c{5, &root_widget};
|
||||||
|
@ -228,7 +230,7 @@ void FCallbackTest::memberFunctionCallbackTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FCallbackTest::instanceWithFunctionCallbackTest()
|
void FCallbackTest::instanceWithFunctionObjectCallbackTest()
|
||||||
{
|
{
|
||||||
finalcut::FCallback cb{};
|
finalcut::FCallback cb{};
|
||||||
cb_class c{15, &root_widget};
|
cb_class c{15, &root_widget};
|
||||||
|
@ -317,7 +319,7 @@ void FCallbackTest::instanceWithFunctionCallbackTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FCallbackTest::functionObjectTest()
|
void FCallbackTest::functionObjectCallbackTest()
|
||||||
{
|
{
|
||||||
finalcut::FCallback cb{};
|
finalcut::FCallback cb{};
|
||||||
int i1{2};
|
int i1{2};
|
||||||
|
@ -377,7 +379,47 @@ void FCallbackTest::functionObjectTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FCallbackTest::functionCallbackTest()
|
void FCallbackTest::functionObjectReferenceCallbackTest()
|
||||||
|
{
|
||||||
|
finalcut::FCallback cb{};
|
||||||
|
int i{4};
|
||||||
|
auto lambda1 = [] (int* value)
|
||||||
|
{
|
||||||
|
*value = *value << 8;
|
||||||
|
};
|
||||||
|
auto lambda2 = [] (int& value)
|
||||||
|
{
|
||||||
|
value = value >> 4;
|
||||||
|
};
|
||||||
|
using NonUnionClass = decltype(lambda1);
|
||||||
|
|
||||||
|
CPPUNIT_ASSERT ( 0 == std::is_member_function_pointer<NonUnionClass>::value );
|
||||||
|
CPPUNIT_ASSERT ( 0 == std::is_function<typename std::remove_pointer<NonUnionClass>::type>::value );
|
||||||
|
CPPUNIT_ASSERT ( 0 == std::is_function<NonUnionClass>::value );
|
||||||
|
CPPUNIT_ASSERT ( 0 == std::is_pointer<NonUnionClass>::value );
|
||||||
|
CPPUNIT_ASSERT ( 1 == std::is_object<NonUnionClass>::value );
|
||||||
|
CPPUNIT_ASSERT ( 1 == std::is_class<NonUnionClass>::value );
|
||||||
|
|
||||||
|
cb.addCallback ("toggled", lambda1, &i);
|
||||||
|
CPPUNIT_ASSERT ( cb.getCallbackCount() == 1 );
|
||||||
|
CPPUNIT_ASSERT ( i == 4 );
|
||||||
|
|
||||||
|
cb.emitCallback ("toggled");
|
||||||
|
CPPUNIT_ASSERT ( i == 1024 );
|
||||||
|
|
||||||
|
cb.addCallback ("row-selected", lambda2, std::ref(i));
|
||||||
|
CPPUNIT_ASSERT ( cb.getCallbackCount() == 2 );
|
||||||
|
CPPUNIT_ASSERT ( i == 1024 );
|
||||||
|
|
||||||
|
cb.emitCallback ("row-selected");
|
||||||
|
CPPUNIT_ASSERT ( i == 64 );
|
||||||
|
|
||||||
|
cb.delCallback();
|
||||||
|
CPPUNIT_ASSERT ( cb.getCallbackCount() == 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FCallbackTest::functionReferenceCallbackTest()
|
||||||
{
|
{
|
||||||
finalcut::FCallback cb{};
|
finalcut::FCallback cb{};
|
||||||
int i1{22};
|
int i1{22};
|
||||||
|
@ -464,45 +506,6 @@ void FCallbackTest::functionPointerCallbackTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FCallbackTest::nonUnionClassCallbackTest()
|
|
||||||
{
|
|
||||||
finalcut::FCallback cb{};
|
|
||||||
int i{4};
|
|
||||||
auto lambda1 = [] (int* value)
|
|
||||||
{
|
|
||||||
*value = *value << 8;
|
|
||||||
};
|
|
||||||
auto lambda2 = [] (int& value)
|
|
||||||
{
|
|
||||||
value = value >> 4;
|
|
||||||
};
|
|
||||||
using NonUnionClass = decltype(lambda1);
|
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( 0 == std::is_member_function_pointer<NonUnionClass>::value );
|
|
||||||
CPPUNIT_ASSERT ( 0 == std::is_function<typename std::remove_pointer<NonUnionClass>::type>::value );
|
|
||||||
CPPUNIT_ASSERT ( 0 == std::is_function<NonUnionClass>::value );
|
|
||||||
CPPUNIT_ASSERT ( 0 == std::is_pointer<NonUnionClass>::value );
|
|
||||||
CPPUNIT_ASSERT ( 1 == std::is_object<NonUnionClass>::value );
|
|
||||||
CPPUNIT_ASSERT ( 1 == std::is_class<NonUnionClass>::value );
|
|
||||||
|
|
||||||
cb.addCallback ("toggled", lambda1, &i);
|
|
||||||
CPPUNIT_ASSERT ( cb.getCallbackCount() == 1 );
|
|
||||||
CPPUNIT_ASSERT ( i == 4 );
|
|
||||||
|
|
||||||
cb.emitCallback ("toggled");
|
|
||||||
CPPUNIT_ASSERT ( i == 1024 );
|
|
||||||
|
|
||||||
cb.addCallback ("row-selected", lambda2, std::ref(i));
|
|
||||||
CPPUNIT_ASSERT ( cb.getCallbackCount() == 2 );
|
|
||||||
CPPUNIT_ASSERT ( i == 1024 );
|
|
||||||
|
|
||||||
cb.emitCallback ("row-selected");
|
|
||||||
CPPUNIT_ASSERT ( i == 64 );
|
|
||||||
|
|
||||||
cb.delCallback();
|
|
||||||
CPPUNIT_ASSERT ( cb.getCallbackCount() == 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
void FCallbackTest::ownWidgetTest()
|
void FCallbackTest::ownWidgetTest()
|
||||||
{
|
{
|
||||||
Widget w;
|
Widget w;
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -28,7 +30,6 @@
|
||||||
#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
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -28,8 +32,6 @@
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#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-2019 Markus Gans *
|
* Copyright 2018-2020 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* FINAL CUT is free software; you can redistribute it and/or modify *
|
* FINAL CUT is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU Lesser General Public License as *
|
* it under the terms of the GNU Lesser General Public License as *
|
||||||
|
@ -20,6 +20,9 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <iomanip>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -27,12 +30,9 @@
|
||||||
#include <cppunit/TestResult.h>
|
#include <cppunit/TestResult.h>
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
#include <cppunit/SourceLine.h>
|
#include <cppunit/SourceLine.h>
|
||||||
#include <cppunit/TestAssert.h>
|
#include <cppunit/TestAssert.h>
|
||||||
|
|
||||||
#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-2019 Markus Gans *
|
* Copyright 2018-2020 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* FINAL CUT is free software; you can redistribute it and/or modify *
|
* FINAL CUT is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU Lesser General Public License as *
|
* it under the terms of the GNU Lesser General Public License as *
|
||||||
|
@ -20,6 +20,9 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <iomanip>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -27,12 +30,9 @@
|
||||||
#include <cppunit/TestResult.h>
|
#include <cppunit/TestResult.h>
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
#include <cppunit/SourceLine.h>
|
#include <cppunit/SourceLine.h>
|
||||||
#include <cppunit/TestAssert.h>
|
#include <cppunit/TestAssert.h>
|
||||||
|
|
||||||
#include <iomanip>
|
|
||||||
#include <string>
|
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,6 @@ void FPointTest::moveTest()
|
||||||
p1.move (-2, -7);
|
p1.move (-2, -7);
|
||||||
CPPUNIT_ASSERT ( p1.getX() == 4 );
|
CPPUNIT_ASSERT ( p1.getX() == 4 );
|
||||||
CPPUNIT_ASSERT ( p1.getY() == -1 );
|
CPPUNIT_ASSERT ( p1.getY() == -1 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <clocale>
|
#include <clocale>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <cppunit/BriefTestProgressListener.h>
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -28,8 +32,6 @@
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#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-2019 Markus Gans *
|
* Copyright 2018-2020 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* FINAL CUT is free software; you can redistribute it and/or modify *
|
* FINAL CUT is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU Lesser General Public License as *
|
* it under the terms of the GNU Lesser General Public License as *
|
||||||
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -28,7 +30,6 @@
|
||||||
#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,6 +20,11 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#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>
|
||||||
|
@ -27,10 +32,6 @@
|
||||||
#include <cppunit/TestResult.h>
|
#include <cppunit/TestResult.h>
|
||||||
#include <cppunit/TestResultCollector.h>
|
#include <cppunit/TestResultCollector.h>
|
||||||
#include <cppunit/TestRunner.h>
|
#include <cppunit/TestRunner.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "conemu.h"
|
#include "conemu.h"
|
||||||
#include <final/final.h>
|
#include <final/final.h>
|
||||||
|
|
Loading…
Reference in New Issue