Small data type changes
This commit is contained in:
parent
bc389b730e
commit
250c04cefd
|
@ -213,7 +213,7 @@ class Calc : public finalcut::FDialog
|
||||||
void clearInfixOperator();
|
void clearInfixOperator();
|
||||||
void calcInfixOperator();
|
void calcInfixOperator();
|
||||||
virtual void adjustSize();
|
virtual void adjustSize();
|
||||||
const wchar_t* getButtonText (int);
|
const wchar_t* getButtonText (std::size_t);
|
||||||
void mapKeyFunctions();
|
void mapKeyFunctions();
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
|
@ -228,7 +228,7 @@ class Calc : public finalcut::FDialog
|
||||||
char infix_operator{'\0'};
|
char infix_operator{'\0'};
|
||||||
char last_infix_operator{'\0'};
|
char last_infix_operator{'\0'};
|
||||||
finalcut::FString input{""};
|
finalcut::FString input{""};
|
||||||
int button_no[Calc::NUM_OF_BUTTONS]{};
|
std::size_t button_no[Calc::NUM_OF_BUTTONS]{};
|
||||||
|
|
||||||
struct stack_data
|
struct stack_data
|
||||||
{
|
{
|
||||||
|
@ -262,10 +262,11 @@ Calc::Calc (FWidget* parent)
|
||||||
btn->setGeometry(30, 15, 5, 3);
|
btn->setGeometry(30, 15, 5, 3);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int x, y, n;
|
int x, y;
|
||||||
|
std::size_t n;
|
||||||
( key <= Three ) ? n = 0 : n = 1;
|
( key <= Three ) ? n = 0 : n = 1;
|
||||||
x = (key + n) % 5 * 7 + 2;
|
x = int(key + n) % 5 * 7 + 2;
|
||||||
y = (key + n) / 5 * 2 + 3;
|
y = int(key + n) / 5 * 2 + 3;
|
||||||
btn->setGeometry(x, y, 5, 1);
|
btn->setGeometry(x, y, 5, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1095,7 +1096,7 @@ void Calc::adjustSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
const wchar_t* Calc::getButtonText (int key)
|
const wchar_t* Calc::getButtonText (std::size_t key)
|
||||||
{
|
{
|
||||||
static const wchar_t* const button_text[Calc::NUM_OF_BUTTONS] =
|
static const wchar_t* const button_text[Calc::NUM_OF_BUTTONS] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -489,10 +489,10 @@ void MouseDraw::drawCanvas()
|
||||||
winchar = &print_area->text[(ay + y) * w_line_len + ax];
|
winchar = &print_area->text[(ay + y) * w_line_len + ax];
|
||||||
std::memcpy (winchar, canvaschar, sizeof(charData) * unsigned(x_end));
|
std::memcpy (winchar, canvaschar, sizeof(charData) * unsigned(x_end));
|
||||||
|
|
||||||
if ( short(print_area->changes[ay + y].xmin) > ax )
|
if ( int(print_area->changes[ay + y].xmin) > ax )
|
||||||
print_area->changes[ay + y].xmin = uInt(ax);
|
print_area->changes[ay + y].xmin = uInt(ax);
|
||||||
|
|
||||||
if ( short(print_area->changes[ay + y].xmax) < ax + x_end - 1 )
|
if ( int(print_area->changes[ay + y].xmax) < ax + x_end - 1 )
|
||||||
print_area->changes[ay + y].xmax = uInt(ax + x_end - 1);
|
print_area->changes[ay + y].xmax = uInt(ax + x_end - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,19 +29,19 @@
|
||||||
|
|
||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
long StringToLong (const finalcut::FString&);
|
uInt64 StringToNumber (const finalcut::FString&);
|
||||||
bool sortAscending (const finalcut::FObject*, const finalcut::FObject*);
|
bool sortAscending (const finalcut::FObject*, const finalcut::FObject*);
|
||||||
bool sortDescending (const finalcut::FObject*, const finalcut::FObject*);
|
bool sortDescending (const finalcut::FObject*, const finalcut::FObject*);
|
||||||
|
|
||||||
|
|
||||||
// non-member functions
|
// non-member functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
long StringToLong (const finalcut::FString& str)
|
uInt64 StringToNumber (const finalcut::FString& str)
|
||||||
{
|
{
|
||||||
auto NumString = str;
|
auto NumString = str;
|
||||||
NumString = NumString.replace(",", "");
|
NumString = NumString.replace(",", "");
|
||||||
NumString = NumString.replace('.', "");
|
NumString = NumString.replace('.', "");
|
||||||
long number = NumString.toLong();
|
uInt64 number = uInt64(NumString.toLong());
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@ bool sortAscending ( const finalcut::FObject* lhs
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
const long l_number = StringToLong(l_item->getText(column));
|
const uInt64 l_number = StringToNumber(l_item->getText(column));
|
||||||
const long r_number = StringToLong(r_item->getText(column));
|
const uInt64 r_number = StringToNumber(r_item->getText(column));
|
||||||
return bool( l_number < r_number ); // lhs < rhs
|
return bool( l_number < r_number ); // lhs < rhs
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -85,8 +85,8 @@ bool sortDescending ( const finalcut::FObject* lhs
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
const long l_number = StringToLong(l_item->getText(column));
|
const uInt64 l_number = StringToNumber(l_item->getText(column));
|
||||||
const long r_number = StringToLong(r_item->getText(column));
|
const uInt64 r_number = StringToNumber(r_item->getText(column));
|
||||||
return bool( l_number > r_number ); // lhs > rhs
|
return bool( l_number > r_number ); // lhs > rhs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
|
@ -51,7 +52,7 @@ int FApplication::loop_level = 0; // event loop level
|
||||||
int FApplication::quit_code = 0;
|
int FApplication::quit_code = 0;
|
||||||
bool FApplication::quit_now = false;
|
bool FApplication::quit_now = false;
|
||||||
|
|
||||||
FApplication::eventQueuePtr FApplication::event_queue = nullptr;
|
FApplication::eventQueue* FApplication::event_queue = nullptr;
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -86,6 +87,9 @@ FApplication::FApplication ( const int& _argc
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FApplication::~FApplication() // destructor
|
FApplication::~FApplication() // destructor
|
||||||
{
|
{
|
||||||
|
if ( event_queue )
|
||||||
|
delete event_queue;
|
||||||
|
|
||||||
app_object = nullptr;
|
app_object = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +192,7 @@ bool FApplication::sendEvent ( const FObject* receiver
|
||||||
&& ! window->getFlags().modal
|
&& ! window->getFlags().modal
|
||||||
&& ! window->isMenuWidget() )
|
&& ! window->isMenuWidget() )
|
||||||
{
|
{
|
||||||
switch ( event->type() )
|
switch ( uInt(event->type()) )
|
||||||
{
|
{
|
||||||
case fc::KeyPress_Event:
|
case fc::KeyPress_Event:
|
||||||
case fc::KeyUp_Event:
|
case fc::KeyUp_Event:
|
||||||
|
@ -355,7 +359,7 @@ void FApplication::closeConfirmationDialog (FWidget* w, FCloseEvent* ev)
|
||||||
|
|
||||||
// private methods of FApplication
|
// private methods of FApplication
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FApplication::init (long key_time, long dblclick_time)
|
void FApplication::init (uInt64 key_time, uInt64 dblclick_time)
|
||||||
{
|
{
|
||||||
// Initialize keyboard
|
// Initialize keyboard
|
||||||
keyboard = FVTerm::getKeyboard();
|
keyboard = FVTerm::getKeyboard();
|
||||||
|
@ -385,7 +389,7 @@ void FApplication::init (long key_time, long dblclick_time)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
event_queue = std::make_shared<eventQueue>();
|
event_queue = new eventQueue;
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc& ex)
|
catch (const std::bad_alloc& ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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/fdialog.h"
|
#include "final/fdialog.h"
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
|
@ -1312,7 +1314,7 @@ inline void FDialog::deactivateZoomButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FDialog::activateZoomButton (mouseStates& ms)
|
inline void FDialog::activateZoomButton (const mouseStates& ms)
|
||||||
{
|
{
|
||||||
if ( ms.mouse_x <= int(getWidth() - ms.zoom_btn)
|
if ( ms.mouse_x <= int(getWidth() - ms.zoom_btn)
|
||||||
|| ms.mouse_y != 1 )
|
|| ms.mouse_y != 1 )
|
||||||
|
@ -1324,7 +1326,7 @@ inline void FDialog::activateZoomButton (mouseStates& ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FDialog::leaveZoomButton (mouseStates& ms)
|
inline void FDialog::leaveZoomButton (const mouseStates& ms)
|
||||||
{
|
{
|
||||||
bool zoom_button_pressed_before = zoom_button_pressed;
|
bool zoom_button_pressed_before = zoom_button_pressed;
|
||||||
|
|
||||||
|
@ -1341,7 +1343,7 @@ inline void FDialog::leaveZoomButton (mouseStates& ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FDialog::pressZoomButton (mouseStates& ms)
|
void FDialog::pressZoomButton (const mouseStates& ms)
|
||||||
{
|
{
|
||||||
if ( ms.mouse_x <= int(getWidth() - ms.zoom_btn)
|
if ( ms.mouse_x <= int(getWidth() - ms.zoom_btn)
|
||||||
|| ms.mouse_y != 1
|
|| ms.mouse_y != 1
|
||||||
|
@ -1365,7 +1367,7 @@ inline bool FDialog::isMouseOverMenu (const FPoint& termpos)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FDialog::passEventToSubMenu ( mouseStates& ms
|
inline void FDialog::passEventToSubMenu ( const mouseStates& ms
|
||||||
, FMouseEvent* ev )
|
, FMouseEvent* ev )
|
||||||
{
|
{
|
||||||
// Mouse event handover to the dialog menu
|
// Mouse event handover to the dialog menu
|
||||||
|
@ -1481,7 +1483,7 @@ inline void FDialog::lowerActivateDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FDialog::isLowerRightResizeCorner (mouseStates& ms)
|
bool FDialog::isLowerRightResizeCorner (const mouseStates& ms)
|
||||||
{
|
{
|
||||||
// 3 characters in the lower right corner |
|
// 3 characters in the lower right corner |
|
||||||
// x
|
// x
|
||||||
|
@ -1500,7 +1502,7 @@ bool FDialog::isLowerRightResizeCorner (mouseStates& ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FDialog::resizeMouseDown (mouseStates& ms)
|
void FDialog::resizeMouseDown (const mouseStates& ms)
|
||||||
{
|
{
|
||||||
// Click on the lower right resize corner
|
// Click on the lower right resize corner
|
||||||
|
|
||||||
|
@ -1524,7 +1526,7 @@ void FDialog::resizeMouseDown (mouseStates& ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FDialog::resizeMouseUpMove (mouseStates& ms, bool mouse_up)
|
void FDialog::resizeMouseUpMove (const mouseStates& ms, bool mouse_up)
|
||||||
{
|
{
|
||||||
// Resize the dialog
|
// Resize the dialog
|
||||||
if ( isResizeable() && ! resize_click_pos.isNull() )
|
if ( isResizeable() && ! resize_click_pos.isNull() )
|
||||||
|
|
|
@ -35,10 +35,6 @@ FEvent::FEvent (fc::events ev_type) // constructor
|
||||||
: t{ev_type}
|
: t{ev_type}
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
FEvent::~FEvent() // destructor
|
|
||||||
{ }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
fc::events FEvent::type() const
|
fc::events FEvent::type() const
|
||||||
{ return t; }
|
{ return t; }
|
||||||
|
|
|
@ -220,7 +220,6 @@ const FString FFileDialog::fileOpenChooser ( FWidget* parent
|
||||||
, const FString& dirname
|
, const FString& dirname
|
||||||
, const FString& filter )
|
, const FString& filter )
|
||||||
{
|
{
|
||||||
//FFileDialog* fileopen;
|
|
||||||
FString ret;
|
FString ret;
|
||||||
FString path = dirname;
|
FString path = dirname;
|
||||||
FString file_filter = filter;
|
FString file_filter = filter;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "final/fkeyboard.h"
|
#include "final/fkeyboard.h"
|
||||||
#include "final/fkey_map.h"
|
#include "final/fkey_map.h"
|
||||||
|
@ -30,7 +31,7 @@ namespace finalcut
|
||||||
{
|
{
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
long FKeyboard::key_timeout = 100000; // 100 ms (default timeout for keypress)
|
uInt64 FKeyboard::key_timeout = 100000; // 100 ms (default timeout for keypress)
|
||||||
struct timeval FKeyboard::time_keypressed{};
|
struct timeval FKeyboard::time_keypressed{};
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
|
|
@ -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/flabel.h"
|
#include "final/flabel.h"
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
#include "final/flistbox.h"
|
#include "final/flistbox.h"
|
||||||
|
@ -161,7 +162,9 @@ void FListBox::showInsideBrackets ( std::size_t index
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FListBox::setGeometry (int x, int y, std::size_t w, std::size_t h, bool adjust)
|
void FListBox::setGeometry ( int x, int y
|
||||||
|
, std::size_t w, std::size_t h
|
||||||
|
, bool adjust )
|
||||||
{
|
{
|
||||||
// Set the widget geometry
|
// Set the widget geometry
|
||||||
|
|
||||||
|
@ -260,27 +263,6 @@ void FListBox::insert (FListBoxItem listItem)
|
||||||
recalculateVerticalBar (element_count);
|
recalculateVerticalBar (element_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void FListBox::insert ( const FString& item
|
|
||||||
, fc::brackets_type b
|
|
||||||
, bool s
|
|
||||||
, FDataPtr d )
|
|
||||||
{
|
|
||||||
FListBoxItem listItem (item, d);
|
|
||||||
listItem.brackets = b;
|
|
||||||
listItem.selected = s;
|
|
||||||
insert (listItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void FListBox::insert ( long item
|
|
||||||
, fc::brackets_type b
|
|
||||||
, bool s
|
|
||||||
, FDataPtr d )
|
|
||||||
{
|
|
||||||
insert (FString() << item, b, s, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FListBox::remove (std::size_t item)
|
void FListBox::remove (std::size_t item)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
|
@ -35,7 +36,7 @@ namespace finalcut
|
||||||
FObject::FObjectIterator FListView::null_iter;
|
FObject::FObjectIterator FListView::null_iter;
|
||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
long firstNumberFromString (const FString&);
|
uInt64 firstNumberFromString (const FString&);
|
||||||
bool sortAscendingByName (const FObject*, const FObject*);
|
bool sortAscendingByName (const FObject*, const FObject*);
|
||||||
bool sortDescendingByName (const FObject*, const FObject*);
|
bool sortDescendingByName (const FObject*, const FObject*);
|
||||||
bool sortAscendingByNumber (const FObject*, const FObject*);
|
bool sortAscendingByNumber (const FObject*, const FObject*);
|
||||||
|
@ -43,13 +44,13 @@ bool sortDescendingByNumber (const FObject*, const FObject*);
|
||||||
|
|
||||||
// non-member functions
|
// non-member functions
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
long firstNumberFromString (const FString& str)
|
uInt64 firstNumberFromString (const FString& str)
|
||||||
{
|
{
|
||||||
auto last = str.end();
|
auto last = str.end();
|
||||||
auto iter = str.begin();
|
auto iter = str.begin();
|
||||||
std::size_t pos;
|
std::size_t pos;
|
||||||
std::size_t length;
|
std::size_t length;
|
||||||
long number;
|
uInt64 number;
|
||||||
|
|
||||||
while ( iter != last )
|
while ( iter != last )
|
||||||
{
|
{
|
||||||
|
@ -88,7 +89,7 @@ long firstNumberFromString (const FString& str)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
number = num_str.toLong();
|
number = uInt64(num_str.toLong());
|
||||||
}
|
}
|
||||||
catch (const std::exception&)
|
catch (const std::exception&)
|
||||||
{
|
{
|
||||||
|
@ -814,7 +815,7 @@ FObject::FObjectIterator FListView::insert ( const FStringList& cols
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FObject::FObjectIterator FListView::insert ( const std::vector<long>& cols
|
FObject::FObjectIterator FListView::insert ( const std::vector<uInt64>& cols
|
||||||
, FDataPtr d
|
, FDataPtr d
|
||||||
, FObjectIterator parent_iter )
|
, FObjectIterator parent_iter )
|
||||||
{
|
{
|
||||||
|
@ -1816,7 +1817,7 @@ inline void FListView::drawHeaderBorder (std::size_t length)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FListView::drawHeadlineLabel (headerItems::const_iterator& iter)
|
void FListView::drawHeadlineLabel (const headerItems::const_iterator& iter)
|
||||||
{
|
{
|
||||||
// Print lable text
|
// Print lable text
|
||||||
static constexpr std::size_t leading_space = 1;
|
static constexpr std::size_t leading_space = 1;
|
||||||
|
@ -1863,7 +1864,7 @@ void FListView::drawHeadlineLabel (headerItems::const_iterator& iter)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FListView::drawColumnEllipsis ( headerItems::const_iterator& iter
|
void FListView::drawColumnEllipsis ( const headerItems::const_iterator& iter
|
||||||
, const FString& text )
|
, const FString& text )
|
||||||
{
|
{
|
||||||
// Print lable ellipsis
|
// Print lable ellipsis
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
|
@ -657,7 +658,7 @@ inline void FMenuBar::drawMenuText (menuText& data)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FMenuBar::drawEllipsis (menuText& txtdata, std::size_t x)
|
inline void FMenuBar::drawEllipsis (const menuText& txtdata, std::size_t x)
|
||||||
{
|
{
|
||||||
if ( x > screenWidth + 1 )
|
if ( x > screenWidth + 1 )
|
||||||
{
|
{
|
||||||
|
@ -820,7 +821,7 @@ void FMenuBar::unselectMenuItem (FMenuItem* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenuBar::mouseDownOverList (FMouseEvent* ev)
|
void FMenuBar::mouseDownOverList (const FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
if ( item_list.empty() )
|
if ( item_list.empty() )
|
||||||
return;
|
return;
|
||||||
|
@ -868,7 +869,7 @@ void FMenuBar::mouseDownOverList (FMouseEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenuBar::mouseUpOverList (FMouseEvent* ev)
|
void FMenuBar::mouseUpOverList (const FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
if ( item_list.empty() )
|
if ( item_list.empty() )
|
||||||
return;
|
return;
|
||||||
|
@ -910,7 +911,7 @@ void FMenuBar::mouseUpOverList (FMouseEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenuBar::mouseMoveOverList (FMouseEvent* ev)
|
void FMenuBar::mouseMoveOverList (const FMouseEvent* ev)
|
||||||
{
|
{
|
||||||
if ( item_list.empty() )
|
if ( item_list.empty() )
|
||||||
return;
|
return;
|
||||||
|
@ -970,7 +971,7 @@ void FMenuBar::mouseMoveOverList (FMouseEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenuBar::passEventToMenu (FMouseEvent*& ev)
|
void FMenuBar::passEventToMenu (const FMouseEvent*& ev)
|
||||||
{
|
{
|
||||||
if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() )
|
if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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/fdialog.h"
|
#include "final/fdialog.h"
|
||||||
#include "final/fmenu.h"
|
#include "final/fmenu.h"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -69,19 +70,19 @@ inline void FMouse::clearEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FMouse::setMaxWidth (short x_max)
|
inline void FMouse::setMaxWidth (uInt16 x_max)
|
||||||
{
|
{
|
||||||
max_width = x_max;
|
max_width = x_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FMouse::setMaxHeight (short y_max)
|
inline void FMouse::setMaxHeight (uInt16 y_max)
|
||||||
{
|
{
|
||||||
max_height = y_max;
|
max_height = y_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FMouse::setDblclickInterval (const long timeout)
|
inline void FMouse::setDblclickInterval (const uInt64 timeout)
|
||||||
{
|
{
|
||||||
dblclick_interval = timeout;
|
dblclick_interval = timeout;
|
||||||
}
|
}
|
||||||
|
@ -716,7 +717,7 @@ void FMouseSGR::processEvent (struct timeval* time)
|
||||||
const auto& mouse_position = getPos();
|
const auto& mouse_position = getPos();
|
||||||
char* p;
|
char* p;
|
||||||
int btn;
|
int btn;
|
||||||
short x, y;
|
uInt16 x, y;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
|
@ -747,7 +748,7 @@ void FMouseSGR::processEvent (struct timeval* time)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = short(10 * x + (*p - '0'));
|
x = uInt16(10 * x + (*p - '0'));
|
||||||
}
|
}
|
||||||
|
|
||||||
while ( *p++ && *p != 'M' && *p != 'm' )
|
while ( *p++ && *p != 'M' && *p != 'm' )
|
||||||
|
@ -759,7 +760,7 @@ void FMouseSGR::processEvent (struct timeval* time)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
y = short(10 * y + (*p - '0'));
|
y = uInt16(10 * y + (*p - '0'));
|
||||||
}
|
}
|
||||||
|
|
||||||
new_mouse_position.setPoint (x, y);
|
new_mouse_position.setPoint (x, y);
|
||||||
|
@ -959,7 +960,7 @@ void FMouseUrxvt::processEvent (struct timeval* time)
|
||||||
bool x_neg;
|
bool x_neg;
|
||||||
bool y_neg;
|
bool y_neg;
|
||||||
int btn;
|
int btn;
|
||||||
short x, y;
|
uInt16 x, y;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
|
@ -998,7 +999,7 @@ void FMouseUrxvt::processEvent (struct timeval* time)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = short(10 * x + (*p - '0'));
|
x = uInt16(10 * x + (*p - '0'));
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,7 +1018,7 @@ void FMouseUrxvt::processEvent (struct timeval* time)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
y = short(10 * y + (*p - '0'));
|
y = uInt16(10 * y + (*p - '0'));
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1226,19 +1227,19 @@ void FMouseControl::setStdinNo (int)
|
||||||
#endif // F_HAVE_LIBGPM
|
#endif // F_HAVE_LIBGPM
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMouseControl::setMaxWidth (short x_max)
|
void FMouseControl::setMaxWidth (uInt16 x_max)
|
||||||
{
|
{
|
||||||
mouse_protocol[FMouse::urxvt]->setMaxWidth(x_max);
|
mouse_protocol[FMouse::urxvt]->setMaxWidth(x_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMouseControl::setMaxHeight (short y_max)
|
void FMouseControl::setMaxHeight (uInt16 y_max)
|
||||||
{
|
{
|
||||||
mouse_protocol[FMouse::urxvt]->setMaxHeight(y_max);
|
mouse_protocol[FMouse::urxvt]->setMaxHeight(y_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMouseControl::setDblclickInterval (const long timeout)
|
void FMouseControl::setDblclickInterval (const uInt64 timeout)
|
||||||
{
|
{
|
||||||
for (auto&& m : mouse_protocol)
|
for (auto&& m : mouse_protocol)
|
||||||
if ( m.second )
|
if ( m.second )
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "final/fobject.h"
|
#include "final/fobject.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
@ -216,11 +218,11 @@ void FObject::getCurrentTime (timeval* time)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FObject::isTimeout (timeval* time, long timeout)
|
bool FObject::isTimeout (timeval* time, uInt64 timeout)
|
||||||
{
|
{
|
||||||
// Checks whether the specified time span (timeout in µs) has elapse
|
// Checks whether the specified time span (timeout in µs) has elapse
|
||||||
|
|
||||||
long diff_usec;
|
uInt64 diff_usec;
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
struct timeval diff;
|
struct timeval diff;
|
||||||
|
|
||||||
|
@ -234,7 +236,7 @@ bool FObject::isTimeout (timeval* time, long timeout)
|
||||||
diff.tv_usec += 1000000;
|
diff.tv_usec += 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff_usec = (diff.tv_sec * 1000000) + diff.tv_usec;
|
diff_usec = uInt64((diff.tv_sec * 1000000) + diff.tv_usec);
|
||||||
return ( diff_usec > timeout );
|
return ( diff_usec > timeout );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "final/fscrollview.h"
|
#include "final/fscrollview.h"
|
||||||
#include "final/fwindow.h"
|
#include "final/fwindow.h"
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ void FTerm::redefineDefaultColors (bool enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::setDblclickInterval (const long timeout)
|
void FTerm::setDblclickInterval (const uInt64 timeout)
|
||||||
{
|
{
|
||||||
mouse->setDblclickInterval(timeout);
|
mouse->setDblclickInterval(timeout);
|
||||||
}
|
}
|
||||||
|
@ -941,7 +941,7 @@ void FTerm::init_alt_charset()
|
||||||
{
|
{
|
||||||
// Read the used VT100 pairs
|
// Read the used VT100 pairs
|
||||||
|
|
||||||
std::map <uChar,uChar> vt100_alt_char;
|
std::map<uChar, uChar> vt100_alt_char;
|
||||||
|
|
||||||
if ( TCAP(fc::t_acs_chars) )
|
if ( TCAP(fc::t_acs_chars) )
|
||||||
{
|
{
|
||||||
|
@ -1543,8 +1543,8 @@ void FTerm::enableMouse()
|
||||||
xterm_mouse = true;
|
xterm_mouse = true;
|
||||||
|
|
||||||
keyboard->enableMouseSequences();
|
keyboard->enableMouseSequences();
|
||||||
mouse->setMaxWidth (short(getColumnNumber()));
|
mouse->setMaxWidth (uInt16(getColumnNumber()));
|
||||||
mouse->setMaxHeight (short(getLineNumber()));
|
mouse->setMaxHeight (uInt16(getLineNumber()));
|
||||||
// Enable the linux general purpose mouse (gpm) server
|
// Enable the linux general purpose mouse (gpm) server
|
||||||
mouse->useGpmMouse (gpm_mouse);
|
mouse->useGpmMouse (gpm_mouse);
|
||||||
// Enable xterm mouse support
|
// Enable xterm mouse support
|
||||||
|
@ -2060,7 +2060,6 @@ void FTerm::signal_handler (int signum)
|
||||||
, strsignal(signum) );
|
, strsignal(signum) );
|
||||||
std::terminate();
|
std::terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FTerm non-member functions
|
// FTerm non-member functions
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/ftermcap.h"
|
#include "final/ftermcap.h"
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "final/ftermcapquirks.h"
|
#include "final/ftermcapquirks.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
|
|
@ -205,7 +205,7 @@ bool FTermios::setRawMode (bool enable)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
uInt FTermios::getBaudRate()
|
uInt FTermios::getBaudRate()
|
||||||
{
|
{
|
||||||
std::map<speed_t,uInt> outspeed;
|
std::map<speed_t, uInt> outspeed;
|
||||||
outspeed[B0] = 0; // hang up
|
outspeed[B0] = 0; // hang up
|
||||||
outspeed[B50] = 50; // 50 baud
|
outspeed[B50] = 50; // 50 baud
|
||||||
outspeed[B75] = 75; // 75 baud
|
outspeed[B75] = 75; // 75 baud
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "final/fdialog.h"
|
#include "final/fdialog.h"
|
||||||
#include "final/fstatusbar.h"
|
#include "final/fstatusbar.h"
|
||||||
#include "final/ftextview.h"
|
#include "final/ftextview.h"
|
||||||
|
|
|
@ -412,7 +412,7 @@ int FVTerm::print (term_area* area, const std::vector<charData>& term_string)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\t':
|
case '\t':
|
||||||
area->cursor_x = short ( uInt(area->cursor_x)
|
area->cursor_x = int ( uInt(area->cursor_x)
|
||||||
+ tabstop
|
+ tabstop
|
||||||
- uInt(area->cursor_x)
|
- uInt(area->cursor_x)
|
||||||
+ 1
|
+ 1
|
||||||
|
@ -539,10 +539,10 @@ int FVTerm::print (term_area* area, charData& term_char)
|
||||||
// copy character to area
|
// copy character to area
|
||||||
std::memcpy (ac, &nc, sizeof(*ac));
|
std::memcpy (ac, &nc, sizeof(*ac));
|
||||||
|
|
||||||
if ( ax < short(area->changes[ay].xmin) )
|
if ( ax < int(area->changes[ay].xmin) )
|
||||||
area->changes[ay].xmin = uInt(ax);
|
area->changes[ay].xmin = uInt(ax);
|
||||||
|
|
||||||
if ( ax > short(area->changes[ay].xmax) )
|
if ( ax > int(area->changes[ay].xmax) )
|
||||||
area->changes[ay].xmax = uInt(ax);
|
area->changes[ay].xmax = uInt(ax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -845,10 +845,10 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
|
||||||
std::memcpy (tc, &sc, sizeof(*tc));
|
std::memcpy (tc, &sc, sizeof(*tc));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( short(vterm->changes[ypos].xmin) > x )
|
if ( int(vterm->changes[ypos].xmin) > x )
|
||||||
vterm->changes[ypos].xmin = uInt(x);
|
vterm->changes[ypos].xmin = uInt(x);
|
||||||
|
|
||||||
if ( short(vterm->changes[ypos].xmax) < x + w - 1 )
|
if ( int(vterm->changes[ypos].xmax) < x + w - 1 )
|
||||||
vterm->changes[ypos].xmax = uInt(x + w - 1);
|
vterm->changes[ypos].xmax = uInt(x + w - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1230,13 +1230,13 @@ void FVTerm::updateVTerm (term_area* area)
|
||||||
_xmin = ax + line_xmin - ol;
|
_xmin = ax + line_xmin - ol;
|
||||||
_xmax = ax + line_xmax;
|
_xmax = ax + line_xmax;
|
||||||
|
|
||||||
if ( _xmin < short(vterm->changes[ay + y].xmin) )
|
if ( _xmin < int(vterm->changes[ay + y].xmin) )
|
||||||
vterm->changes[ay + y].xmin = uInt(_xmin);
|
vterm->changes[ay + y].xmin = uInt(_xmin);
|
||||||
|
|
||||||
if ( _xmax >= vterm->width )
|
if ( _xmax >= vterm->width )
|
||||||
_xmax = vterm->width - 1;
|
_xmax = vterm->width - 1;
|
||||||
|
|
||||||
if ( _xmax > short(vterm->changes[ay + y].xmax) )
|
if ( _xmax > int(vterm->changes[ay + y].xmax) )
|
||||||
vterm->changes[ay + y].xmax = uInt(_xmax);
|
vterm->changes[ay + y].xmax = uInt(_xmax);
|
||||||
|
|
||||||
area->changes[y].xmin = uInt(aw + rsh);
|
area->changes[y].xmin = uInt(aw + rsh);
|
||||||
|
@ -1358,10 +1358,10 @@ void FVTerm::getArea (int ax, int ay, term_area* area)
|
||||||
auto ac = &area->text[y * area->width]; // area character
|
auto ac = &area->text[y * area->width]; // area character
|
||||||
std::memcpy (ac, tc, sizeof(*ac) * unsigned(length));
|
std::memcpy (ac, tc, sizeof(*ac) * unsigned(length));
|
||||||
|
|
||||||
if ( short(area->changes[y].xmin) > 0 )
|
if ( int(area->changes[y].xmin) > 0 )
|
||||||
area->changes[y].xmin = 0;
|
area->changes[y].xmin = 0;
|
||||||
|
|
||||||
if ( short(area->changes[y].xmax) < length - 1 )
|
if ( int(area->changes[y].xmax) < length - 1 )
|
||||||
area->changes[y].xmax = uInt(length - 1);
|
area->changes[y].xmax = uInt(length - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1412,10 +1412,10 @@ void FVTerm::getArea (int x, int y, int w, int h, term_area* area)
|
||||||
auto ac = &area->text[(dy + _y) * line_len + dx]; // area character
|
auto ac = &area->text[(dy + _y) * line_len + dx]; // area character
|
||||||
std::memcpy (ac, tc, sizeof(*ac) * unsigned(length));
|
std::memcpy (ac, tc, sizeof(*ac) * unsigned(length));
|
||||||
|
|
||||||
if ( short(area->changes[dy + _y].xmin) > dx )
|
if ( int(area->changes[dy + _y].xmin) > dx )
|
||||||
area->changes[dy + _y].xmin = uInt(dx);
|
area->changes[dy + _y].xmin = uInt(dx);
|
||||||
|
|
||||||
if ( short(area->changes[dy + _y].xmax) < dx + length - 1 )
|
if ( int(area->changes[dy + _y].xmax) < dx + length - 1 )
|
||||||
area->changes[dy + _y].xmax = uInt(dx + length - 1);
|
area->changes[dy + _y].xmax = uInt(dx + length - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1502,10 +1502,10 @@ void FVTerm::putArea (int ax, int ay, term_area* area)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ax < short(vterm->changes[ay + y].xmin) )
|
if ( ax < int(vterm->changes[ay + y].xmin) )
|
||||||
vterm->changes[ay + y].xmin = uInt(ax);
|
vterm->changes[ay + y].xmin = uInt(ax);
|
||||||
|
|
||||||
if ( ax + length - 1 > short(vterm->changes[ay + y].xmax) )
|
if ( ax + length - 1 > int(vterm->changes[ay + y].xmax) )
|
||||||
vterm->changes[ay + y].xmax = uInt(ax + length - 1);
|
vterm->changes[ay + y].xmax = uInt(ax + length - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2507,7 +2507,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y)
|
||||||
charsetChanges (print_char);
|
charsetChanges (print_char);
|
||||||
appendAttributes (print_char);
|
appendAttributes (print_char);
|
||||||
appendOutputBuffer (tparm(rp, print_char->code, repetitions, 0, 0, 0, 0, 0, 0, 0));
|
appendOutputBuffer (tparm(rp, print_char->code, repetitions, 0, 0, 0, 0, 0, 0, 0));
|
||||||
term_pos->x_ref() += short(repetitions);
|
term_pos->x_ref() += int(repetitions);
|
||||||
x = x + repetitions - 1;
|
x = x + repetitions - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1734,7 +1734,7 @@ bool FWidget::focusPrevChild()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FWidget::event (FEvent* ev)
|
bool FWidget::event (FEvent* ev)
|
||||||
{
|
{
|
||||||
switch ( ev->type() )
|
switch ( uInt(ev->type()) )
|
||||||
{
|
{
|
||||||
case fc::KeyPress_Event:
|
case fc::KeyPress_Event:
|
||||||
KeyPressEvent (static_cast<FKeyEvent*>(ev));
|
KeyPressEvent (static_cast<FKeyEvent*>(ev));
|
||||||
|
|
|
@ -810,7 +810,7 @@ void FWindow::adjustSize()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FWindow::event (FEvent* ev)
|
bool FWindow::event (FEvent* ev)
|
||||||
{
|
{
|
||||||
switch ( ev->type() )
|
switch ( uInt(ev->type()) )
|
||||||
{
|
{
|
||||||
case fc::WindowActive_Event:
|
case fc::WindowActive_Event:
|
||||||
onWindowActive (ev);
|
onWindowActive (ev);
|
||||||
|
|
|
@ -127,13 +127,12 @@ class FApplication : public FWidget
|
||||||
void cb_exitApp (FWidget*, FDataPtr);
|
void cb_exitApp (FWidget*, FDataPtr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedefs and Enumerations
|
// Typedefs
|
||||||
typedef std::pair<const FObject*, std::shared_ptr<const FEvent> > eventPair;
|
typedef std::pair<const FObject*, std::shared_ptr<const FEvent> > eventPair;
|
||||||
typedef std::deque<eventPair> eventQueue;
|
typedef std::deque<eventPair> eventQueue;
|
||||||
typedef std::shared_ptr<eventQueue> eventQueuePtr;
|
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void init (long, long);
|
void init (uInt64, uInt64);
|
||||||
void cmd_options (const int&, char*[]);
|
void cmd_options (const int&, char*[]);
|
||||||
void findKeyboardWidget();
|
void findKeyboardWidget();
|
||||||
bool isKeyPressed();
|
bool isKeyPressed();
|
||||||
|
@ -178,10 +177,10 @@ class FApplication : public FWidget
|
||||||
// Data Members
|
// Data Members
|
||||||
int app_argc;
|
int app_argc;
|
||||||
char** app_argv;
|
char** app_argv;
|
||||||
long key_timeout{100000}; // 100 ms
|
uInt64 key_timeout{100000}; // 100 ms
|
||||||
long dblclick_interval{500000}; // 500 ms
|
uInt64 dblclick_interval{500000}; // 500 ms
|
||||||
static FMouseControl* mouse;
|
static FMouseControl* mouse;
|
||||||
static eventQueuePtr event_queue;
|
static eventQueue* event_queue;
|
||||||
static int quit_code;
|
static int quit_code;
|
||||||
static bool quit_now;
|
static bool quit_now;
|
||||||
static int loop_level;
|
static int loop_level;
|
||||||
|
|
|
@ -198,18 +198,18 @@ class FDialog : public FWindow
|
||||||
void selectFirstMenuItem();
|
void selectFirstMenuItem();
|
||||||
void setZoomItem();
|
void setZoomItem();
|
||||||
std::size_t getZoomButtonWidth();
|
std::size_t getZoomButtonWidth();
|
||||||
void activateZoomButton (mouseStates&);
|
void activateZoomButton (const mouseStates&);
|
||||||
void deactivateZoomButton();
|
void deactivateZoomButton();
|
||||||
void leaveZoomButton (mouseStates&);
|
void leaveZoomButton (const mouseStates&);
|
||||||
void pressZoomButton (mouseStates&);
|
void pressZoomButton (const mouseStates&);
|
||||||
bool isMouseOverMenu (const FPoint&);
|
bool isMouseOverMenu (const FPoint&);
|
||||||
void passEventToSubMenu (mouseStates&, FMouseEvent*);
|
void passEventToSubMenu (const mouseStates&, FMouseEvent*);
|
||||||
void moveSizeKey (FKeyEvent*);
|
void moveSizeKey (FKeyEvent*);
|
||||||
void raiseActivateDialog();
|
void raiseActivateDialog();
|
||||||
void lowerActivateDialog();
|
void lowerActivateDialog();
|
||||||
bool isLowerRightResizeCorner (mouseStates&);
|
bool isLowerRightResizeCorner (const mouseStates&);
|
||||||
void resizeMouseDown (mouseStates&);
|
void resizeMouseDown (const mouseStates&);
|
||||||
void resizeMouseUpMove (mouseStates&, bool = false);
|
void resizeMouseUpMove (const mouseStates&, bool = false);
|
||||||
void cancelMouseResize();
|
void cancelMouseResize();
|
||||||
void acceptMoveSize();
|
void acceptMoveSize();
|
||||||
void cancelMoveSize();
|
void cancelMoveSize();
|
||||||
|
|
|
@ -95,7 +95,6 @@ class FEvent // event base class
|
||||||
public:
|
public:
|
||||||
FEvent() = default;
|
FEvent() = default;
|
||||||
explicit FEvent(fc::events);
|
explicit FEvent(fc::events);
|
||||||
virtual ~FEvent();
|
|
||||||
fc::events type() const;
|
fc::events type() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -111,7 +111,7 @@ class FKeyboard
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setTermcapMap (fc::fkeymap*);
|
void setTermcapMap (fc::fkeymap*);
|
||||||
void setKeypressTimeout (const long);
|
void setKeypressTimeout (const uInt64);
|
||||||
void enableUTF8();
|
void enableUTF8();
|
||||||
void disableUTF8();
|
void disableUTF8();
|
||||||
void enableMouseSequences();
|
void enableMouseSequences();
|
||||||
|
@ -173,7 +173,7 @@ class FKeyboard
|
||||||
int fifo_offset{0};
|
int fifo_offset{0};
|
||||||
bool fifo_in_use{false};
|
bool fifo_in_use{false};
|
||||||
int stdin_status_flags{0};
|
int stdin_status_flags{0};
|
||||||
static long key_timeout;
|
static uInt64 key_timeout;
|
||||||
bool input_data_pending{false};
|
bool input_data_pending{false};
|
||||||
bool utf8_input{false};
|
bool utf8_input{false};
|
||||||
bool mouse_support{true};
|
bool mouse_support{true};
|
||||||
|
@ -210,7 +210,7 @@ inline timeval* FKeyboard::getKeyPressedTime()
|
||||||
{ return &time_keypressed; }
|
{ return &time_keypressed; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FKeyboard::setKeypressTimeout (const long timeout)
|
inline void FKeyboard::setKeypressTimeout (const uInt64 timeout)
|
||||||
{ key_timeout = timeout; }
|
{ key_timeout = timeout; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fscrollbar.h"
|
#include "final/fscrollbar.h"
|
||||||
|
@ -179,7 +180,9 @@ 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 (int, int, std::size_t, std::size_t, bool = true);
|
virtual void setGeometry ( int, int
|
||||||
|
, std::size_t, std::size_t
|
||||||
|
, bool = true );
|
||||||
void setMultiSelection (bool);
|
void setMultiSelection (bool);
|
||||||
void setMultiSelection ();
|
void setMultiSelection ();
|
||||||
void unsetMultiSelection ();
|
void unsetMultiSelection ();
|
||||||
|
@ -203,11 +206,8 @@ class FListBox : public FWidget
|
||||||
template <typename Container, typename LazyConverter>
|
template <typename Container, typename LazyConverter>
|
||||||
void insert (Container, LazyConverter);
|
void insert (Container, LazyConverter);
|
||||||
void insert (FListBoxItem);
|
void insert (FListBoxItem);
|
||||||
void insert ( const FString&
|
template <typename ItemT>
|
||||||
, fc::brackets_type = fc::NoBrackets
|
void insert ( const ItemT&
|
||||||
, bool = false
|
|
||||||
, FDataPtr = nullptr );
|
|
||||||
void insert ( long
|
|
||||||
, fc::brackets_type = fc::NoBrackets
|
, fc::brackets_type = fc::NoBrackets
|
||||||
, bool = false
|
, bool = false
|
||||||
, FDataPtr = nullptr );
|
, FDataPtr = nullptr );
|
||||||
|
@ -484,6 +484,19 @@ void FListBox::insert (Container container, LazyConverter convert)
|
||||||
recalculateVerticalBar(size);
|
recalculateVerticalBar(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
template <typename ItemT>
|
||||||
|
void FListBox::insert ( const ItemT& item
|
||||||
|
, fc::brackets_type b
|
||||||
|
, bool s
|
||||||
|
, FDataPtr d )
|
||||||
|
{
|
||||||
|
FListBoxItem listItem (FString() << item, d);
|
||||||
|
listItem.brackets = b;
|
||||||
|
listItem.selected = s;
|
||||||
|
insert (listItem);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FListBox::listBoxItems::iterator \
|
inline FListBox::listBoxItems::iterator \
|
||||||
FListBox::index2iterator (std::size_t index)
|
FListBox::index2iterator (std::size_t index)
|
||||||
|
|
|
@ -53,9 +53,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "final/fmessagebox.h"
|
|
||||||
#include "final/fscrollbar.h"
|
#include "final/fscrollbar.h"
|
||||||
#include "final/fstring.h"
|
#include "final/fstring.h"
|
||||||
#include "final/ftermbuffer.h"
|
#include "final/ftermbuffer.h"
|
||||||
|
@ -323,11 +324,11 @@ class FListView : public FWidget
|
||||||
FObjectIterator insert ( const FStringList&
|
FObjectIterator insert ( const FStringList&
|
||||||
, FDataPtr
|
, FDataPtr
|
||||||
, FObjectIterator );
|
, FObjectIterator );
|
||||||
FObjectIterator insert ( const std::vector<long>&
|
FObjectIterator insert ( const std::vector<uInt64>&
|
||||||
, FDataPtr = nullptr );
|
, FDataPtr = nullptr );
|
||||||
FObjectIterator insert ( const std::vector<long>&
|
FObjectIterator insert ( const std::vector<uInt64>&
|
||||||
, FObjectIterator );
|
, FObjectIterator );
|
||||||
FObjectIterator insert ( const std::vector<long>&
|
FObjectIterator insert ( const std::vector<uInt64>&
|
||||||
, FDataPtr
|
, FDataPtr
|
||||||
, FObjectIterator );
|
, FObjectIterator );
|
||||||
FObjectIterator beginOfList();
|
FObjectIterator beginOfList();
|
||||||
|
@ -378,9 +379,9 @@ class FListView : public FWidget
|
||||||
FString getCheckBox (const FListViewItem* item);
|
FString getCheckBox (const FListViewItem* item);
|
||||||
FString getLinePrefix (const FListViewItem*, std::size_t);
|
FString getLinePrefix (const FListViewItem*, std::size_t);
|
||||||
void drawSortIndicator (std::size_t&, std::size_t);
|
void drawSortIndicator (std::size_t&, std::size_t);
|
||||||
void drawHeadlineLabel (headerItems::const_iterator&);
|
void drawHeadlineLabel (const headerItems::const_iterator&);
|
||||||
void drawHeaderBorder (std::size_t);
|
void drawHeaderBorder (std::size_t);
|
||||||
void drawColumnEllipsis ( headerItems::const_iterator&
|
void drawColumnEllipsis ( const headerItems::const_iterator&
|
||||||
, const FString& );
|
, const FString& );
|
||||||
void updateDrawing (bool, bool);
|
void updateDrawing (bool, bool);
|
||||||
std::size_t determineLineWidth (FListViewItem*);
|
std::size_t determineLineWidth (FListViewItem*);
|
||||||
|
@ -537,12 +538,12 @@ inline FObject::FObjectIterator
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FObject::FObjectIterator
|
inline FObject::FObjectIterator
|
||||||
FListView::insert (const std::vector<long>& cols, FDataPtr d)
|
FListView::insert (const std::vector<uInt64>& cols, FDataPtr d)
|
||||||
{ return insert (cols, d, root); }
|
{ return insert (cols, d, root); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FObject::FObjectIterator
|
inline FObject::FObjectIterator
|
||||||
FListView::insert ( const std::vector<long>& cols
|
FListView::insert ( const std::vector<uInt64>& cols
|
||||||
, FObjectIterator parent_iter )
|
, FObjectIterator parent_iter )
|
||||||
{ return insert (cols, 0, parent_iter); }
|
{ return insert (cols, 0, parent_iter); }
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ class FMenuBar : public FWindow, public FMenuList
|
||||||
void drawItem (FMenuItem*, std::size_t&);
|
void drawItem (FMenuItem*, std::size_t&);
|
||||||
void setLineAttributes (FMenuItem*);
|
void setLineAttributes (FMenuItem*);
|
||||||
void drawMenuText (menuText&);
|
void drawMenuText (menuText&);
|
||||||
void drawEllipsis (menuText&, std::size_t);
|
void drawEllipsis (const menuText&, std::size_t);
|
||||||
void drawLeadingSpace (std::size_t&);
|
void drawLeadingSpace (std::size_t&);
|
||||||
void drawTrailingSpace (std::size_t&);
|
void drawTrailingSpace (std::size_t&);
|
||||||
void adjustItems();
|
void adjustItems();
|
||||||
|
@ -143,10 +143,10 @@ class FMenuBar : public FWindow, public FMenuList
|
||||||
bool clickItem (FMenuItem*);
|
bool clickItem (FMenuItem*);
|
||||||
void unselectMenuItem (FMenuItem*);
|
void unselectMenuItem (FMenuItem*);
|
||||||
void selectMenuItem (FMenuItem*);
|
void selectMenuItem (FMenuItem*);
|
||||||
void mouseDownOverList (FMouseEvent*);
|
void mouseDownOverList (const FMouseEvent*);
|
||||||
void mouseUpOverList (FMouseEvent*);
|
void mouseUpOverList (const FMouseEvent*);
|
||||||
void mouseMoveOverList (FMouseEvent*);
|
void mouseMoveOverList (const FMouseEvent*);
|
||||||
void passEventToMenu (FMouseEvent*&);
|
void passEventToMenu (const FMouseEvent*&);
|
||||||
void leaveMenuBar();
|
void leaveMenuBar();
|
||||||
|
|
||||||
// Friend classes
|
// Friend classes
|
||||||
|
|
|
@ -112,9 +112,9 @@ class FMouse
|
||||||
void clearEvent();
|
void clearEvent();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setMaxWidth (short);
|
void setMaxWidth (uInt16);
|
||||||
void setMaxHeight (short);
|
void setMaxHeight (uInt16);
|
||||||
void setDblclickInterval (const long);
|
void setDblclickInterval (const uInt64);
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
virtual bool hasData() = 0;
|
virtual bool hasData() = 0;
|
||||||
|
@ -173,9 +173,9 @@ class FMouse
|
||||||
button b_state{};
|
button b_state{};
|
||||||
bool mouse_event_occurred{false};
|
bool mouse_event_occurred{false};
|
||||||
bool input_data_pending{false};
|
bool input_data_pending{false};
|
||||||
long dblclick_interval{500000}; // 500 ms
|
uInt64 dblclick_interval{500000}; // 500 ms
|
||||||
short max_width{80};
|
uInt16 max_width{80};
|
||||||
short max_height{25};
|
uInt16 max_height{25};
|
||||||
struct timeval time_mousepressed{};
|
struct timeval time_mousepressed{};
|
||||||
FPoint zero_point{0, 0}; // zero point (x=0, y=0)
|
FPoint zero_point{0, 0}; // zero point (x=0, y=0)
|
||||||
FPoint mouse{0, 0}; // mouse click position
|
FPoint mouse{0, 0}; // mouse click position
|
||||||
|
@ -468,9 +468,9 @@ class FMouseControl
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setStdinNo (int);
|
void setStdinNo (int);
|
||||||
void setMaxWidth (short);
|
void setMaxWidth (uInt16);
|
||||||
void setMaxHeight (short);
|
void setMaxHeight (uInt16);
|
||||||
void setDblclickInterval (const long);
|
void setDblclickInterval (const uInt64);
|
||||||
void useGpmMouse (bool = true);
|
void useGpmMouse (bool = true);
|
||||||
void useXtermMouse (bool = true);
|
void useXtermMouse (bool = true);
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ class FObject
|
||||||
|
|
||||||
// Timer methods
|
// Timer methods
|
||||||
static void getCurrentTime (timeval*);
|
static void getCurrentTime (timeval*);
|
||||||
static bool isTimeout (timeval*, long);
|
static bool isTimeout (timeval*, uInt64);
|
||||||
int addTimer (int);
|
int addTimer (int);
|
||||||
bool delTimer (int);
|
bool delTimer (int);
|
||||||
bool delOwnTimer();
|
bool delOwnTimer();
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
#error "Only <final/final.h> can be included directly."
|
#error "Only <final/final.h> can be included directly."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "final/fscrollbar.h"
|
#include "final/fscrollbar.h"
|
||||||
#include "final/fwidget.h"
|
#include "final/fwidget.h"
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ class FTerm
|
||||||
static void setTermType (const char[]);
|
static void setTermType (const char[]);
|
||||||
static void setInsertCursor (bool);
|
static void setInsertCursor (bool);
|
||||||
static void redefineDefaultColors (bool);
|
static void redefineDefaultColors (bool);
|
||||||
static void setDblclickInterval (const long);
|
static void setDblclickInterval (const uInt64);
|
||||||
static bool setUTF8 (bool);
|
static bool setUTF8 (bool);
|
||||||
static bool setUTF8();
|
static bool setUTF8();
|
||||||
static bool unsetUTF8();
|
static bool unsetUTF8();
|
||||||
|
|
|
@ -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 <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "final/fapplication.h"
|
#include "final/fapplication.h"
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct is_negative
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct is_negative<T,false>
|
struct is_negative<T, false>
|
||||||
{
|
{
|
||||||
inline bool operator () (const T&)
|
inline bool operator () (const T&)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,12 +50,12 @@ class FMouse_protected : public finalcut::FMouse
|
||||||
virtual void processEvent (struct timeval*)
|
virtual void processEvent (struct timeval*)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
short getMaxWidth()
|
uInt16 getMaxWidth()
|
||||||
{
|
{
|
||||||
return max_width;
|
return max_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
short getMaxHeight()
|
uInt16 getMaxHeight()
|
||||||
{
|
{
|
||||||
return max_height;
|
return max_height;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class FMouse_protected : public finalcut::FMouse
|
||||||
return new_mouse_position;
|
return new_mouse_position;
|
||||||
}
|
}
|
||||||
|
|
||||||
long getDblclickInterval()
|
uInt64 getDblclickInterval()
|
||||||
{
|
{
|
||||||
return dblclick_interval;
|
return dblclick_interval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,7 +433,7 @@ void FObjectTest::iteratorTest()
|
||||||
void FObjectTest::timeTest()
|
void FObjectTest::timeTest()
|
||||||
{
|
{
|
||||||
struct timeval time1;
|
struct timeval time1;
|
||||||
long timeout = 750000; // 750 ms
|
uInt64 timeout = 750000; // 750 ms
|
||||||
finalcut::FObject::getCurrentTime(&time1);
|
finalcut::FObject::getCurrentTime(&time1);
|
||||||
CPPUNIT_ASSERT ( ! finalcut::FObject::isTimeout (&time1, timeout) );
|
CPPUNIT_ASSERT ( ! finalcut::FObject::isTimeout (&time1, timeout) );
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
Loading…
Reference in New Issue