FVTerm code cleanup
This commit is contained in:
parent
e0cc130074
commit
61eb8b8166
|
@ -653,9 +653,9 @@ inline void FApplication::findKeyboardWidget() const
|
||||||
inline bool FApplication::isKeyPressed() const
|
inline bool FApplication::isKeyPressed() const
|
||||||
{
|
{
|
||||||
if ( mouse && mouse->isGpmMouseEnabled() )
|
if ( mouse && mouse->isGpmMouseEnabled() )
|
||||||
return mouse->getGpmKeyPressed(keyboard->unprocessedInput());
|
return mouse->getGpmKeyPressed(keyboard->hasUnprocessedInput());
|
||||||
|
|
||||||
return keyboard->isKeyPressed();
|
return (keyboard->isKeyPressed() || keyboard->hasPendingInput());
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -690,7 +690,7 @@ inline void FApplication::performKeyboardAction()
|
||||||
{
|
{
|
||||||
FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
||||||
mouse->setRawData (FMouse::x11, buffer);
|
mouse->setRawData (FMouse::x11, buffer);
|
||||||
keyboard->unprocessedInput() = mouse->isInputDataPending();
|
keyboard->hasUnprocessedInput() = mouse->hasUnprocessedInput();
|
||||||
processMouseEvent();
|
processMouseEvent();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -700,7 +700,7 @@ inline void FApplication::performKeyboardAction()
|
||||||
{
|
{
|
||||||
FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
||||||
mouse->setRawData (FMouse::sgr, buffer);
|
mouse->setRawData (FMouse::sgr, buffer);
|
||||||
keyboard->unprocessedInput() = mouse->isInputDataPending();
|
keyboard->hasUnprocessedInput() = mouse->hasUnprocessedInput();
|
||||||
processMouseEvent();
|
processMouseEvent();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -710,7 +710,7 @@ inline void FApplication::performKeyboardAction()
|
||||||
{
|
{
|
||||||
FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
FKeyboard::keybuffer& buffer = keyboard->getKeyBuffer();
|
||||||
mouse->setRawData (FMouse::urxvt, buffer);
|
mouse->setRawData (FMouse::urxvt, buffer);
|
||||||
keyboard->unprocessedInput() = mouse->isInputDataPending();
|
keyboard->hasUnprocessedInput() = mouse->hasUnprocessedInput();
|
||||||
processMouseEvent();
|
processMouseEvent();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -875,7 +875,7 @@ bool FApplication::getMouseEvent() const
|
||||||
{
|
{
|
||||||
struct timeval* time_keypressed = keyboard->getKeyPressedTime();
|
struct timeval* time_keypressed = keyboard->getKeyPressedTime();
|
||||||
mouse->processEvent (time_keypressed);
|
mouse->processEvent (time_keypressed);
|
||||||
keyboard->unprocessedInput() = mouse->isInputDataPending();
|
keyboard->hasUnprocessedInput() = mouse->hasUnprocessedInput();
|
||||||
mouse_event_occurred = mouse->hasEvent();
|
mouse_event_occurred = mouse->hasEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,15 +142,15 @@ void FKeyboard::init()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool& FKeyboard::unprocessedInput()
|
bool& FKeyboard::hasUnprocessedInput()
|
||||||
{
|
{
|
||||||
return input_data_pending;
|
return unprocessed_buffer_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FKeyboard::isKeyPressed() const
|
bool FKeyboard::isKeyPressed ( uInt64 blocking_time)
|
||||||
{
|
{
|
||||||
if ( ! isIntervalTimeout() )
|
if ( has_pending_input || ! isIntervalTimeout() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
fd_set ifds{};
|
fd_set ifds{};
|
||||||
|
@ -160,14 +160,15 @@ bool FKeyboard::isKeyPressed() const
|
||||||
FD_ZERO(&ifds);
|
FD_ZERO(&ifds);
|
||||||
FD_SET(stdin_no, &ifds);
|
FD_SET(stdin_no, &ifds);
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = suseconds_t(read_blocking_time); // preset to 100 ms
|
tv.tv_usec = suseconds_t(blocking_time); // preset to 100 ms
|
||||||
FObject::getCurrentTime (&time_last_request);
|
FObject::getCurrentTime (&time_last_request);
|
||||||
const int result = select (stdin_no + 1, &ifds, nullptr, nullptr, &tv);
|
const int result = select (stdin_no + 1, &ifds, nullptr, nullptr, &tv);
|
||||||
|
has_pending_input = bool( result > 0 );
|
||||||
|
|
||||||
if ( result > 0 && FD_ISSET(stdin_no, &ifds) )
|
if ( has_pending_input && FD_ISSET(stdin_no, &ifds) )
|
||||||
FD_CLR (stdin_no, &ifds);
|
FD_CLR (stdin_no, &ifds);
|
||||||
|
|
||||||
return ( result > 0 );
|
return has_pending_input;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -205,7 +206,7 @@ void FKeyboard::escapeKeyHandling()
|
||||||
fifo_offset = 0;
|
fifo_offset = 0;
|
||||||
fifo_buf[0] = 0x00;
|
fifo_buf[0] = 0x00;
|
||||||
fifo_in_use = false;
|
fifo_in_use = false;
|
||||||
input_data_pending = false;
|
unprocessed_buffer_data = false;
|
||||||
escapeKeyPressed();
|
escapeKeyPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +269,7 @@ inline FKey FKeyboard::getTermcapKey()
|
||||||
for (n = n - len; n < FIFO_BUF_SIZE; n++) // Fill rest with '\0'
|
for (n = n - len; n < FIFO_BUF_SIZE; n++) // Fill rest with '\0'
|
||||||
fifo_buf[n] = '\0';
|
fifo_buf[n] = '\0';
|
||||||
|
|
||||||
input_data_pending = bool(fifo_buf[0] != '\0');
|
unprocessed_buffer_data = bool(fifo_buf[0] != '\0');
|
||||||
return entry.num;
|
return entry.num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +308,7 @@ inline FKey FKeyboard::getMetaKey()
|
||||||
for (n = n - len; n < FIFO_BUF_SIZE; n++) // Fill rest with '\0'
|
for (n = n - len; n < FIFO_BUF_SIZE; n++) // Fill rest with '\0'
|
||||||
fifo_buf[n] = '\0';
|
fifo_buf[n] = '\0';
|
||||||
|
|
||||||
input_data_pending = bool(fifo_buf[0] != '\0');
|
unprocessed_buffer_data = bool(fifo_buf[0] != '\0');
|
||||||
return entry.num;
|
return entry.num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,7 +356,7 @@ inline FKey FKeyboard::getSingleKey()
|
||||||
for (n = n - len; n < FIFO_BUF_SIZE; n++) // Fill the rest with '\0' bytes
|
for (n = n - len; n < FIFO_BUF_SIZE; n++) // Fill the rest with '\0' bytes
|
||||||
fifo_buf[n] = '\0';
|
fifo_buf[n] = '\0';
|
||||||
|
|
||||||
input_data_pending = bool(fifo_buf[0] != '\0');
|
unprocessed_buffer_data = bool(fifo_buf[0] != '\0');
|
||||||
|
|
||||||
if ( keycode == 0 ) // Ctrl+Space or Ctrl+@
|
if ( keycode == 0 ) // Ctrl+Space or Ctrl+@
|
||||||
keycode = fc::Fckey_space;
|
keycode = fc::Fckey_space;
|
||||||
|
@ -441,6 +442,8 @@ void FKeyboard::parseKeyBuffer()
|
||||||
|
|
||||||
while ( (bytesread = readKey()) > 0 )
|
while ( (bytesread = readKey()) > 0 )
|
||||||
{
|
{
|
||||||
|
has_pending_input = false;
|
||||||
|
|
||||||
if ( bytesread + fifo_offset <= int(FIFO_BUF_SIZE) )
|
if ( bytesread + fifo_offset <= int(FIFO_BUF_SIZE) )
|
||||||
{
|
{
|
||||||
fifo_buf[fifo_offset] = char(read_character);
|
fifo_buf[fifo_offset] = char(read_character);
|
||||||
|
@ -539,7 +542,7 @@ void FKeyboard::substringKeyHandling()
|
||||||
fifo_offset = 0;
|
fifo_offset = 0;
|
||||||
fifo_buf[0] = 0x00;
|
fifo_buf[0] = 0x00;
|
||||||
fifo_in_use = false;
|
fifo_in_use = false;
|
||||||
input_data_pending = false;
|
unprocessed_buffer_data = false;
|
||||||
|
|
||||||
if ( fifo_buf[1] == 'O' )
|
if ( fifo_buf[1] == 'O' )
|
||||||
key = fc::Fmkey_O;
|
key = fc::Fmkey_O;
|
||||||
|
|
|
@ -173,9 +173,9 @@ inline bool FMouse::isMoved()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FMouse::isInputDataPending() const
|
inline bool FMouse::hasUnprocessedInput() const
|
||||||
{
|
{
|
||||||
return input_data_pending;
|
return unprocessed_buffer_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -238,7 +238,7 @@ void FMouse::setNewPos (int x, int y)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMouse::setPending (bool is_pending)
|
void FMouse::setPending (bool is_pending)
|
||||||
{
|
{
|
||||||
input_data_pending = is_pending;
|
unprocessed_buffer_data = is_pending;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1434,14 +1434,14 @@ bool FMouseControl::isMoved()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FMouseControl::isInputDataPending()
|
bool FMouseControl::hasUnprocessedInput()
|
||||||
{
|
{
|
||||||
return std::any_of ( std::begin(mouse_protocol)
|
return std::any_of ( std::begin(mouse_protocol)
|
||||||
, std::end(mouse_protocol)
|
, std::end(mouse_protocol)
|
||||||
, [] (FMouseProtocol::const_reference m)
|
, [] (FMouseProtocol::const_reference m)
|
||||||
{
|
{
|
||||||
return m.second
|
return m.second
|
||||||
&& m.second->isInputDataPending();
|
&& m.second->hasUnprocessedInput();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,18 +277,25 @@ void FVTerm::updateTerminal() const
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (keyboard->isInputDataPending() || keyboard->isKeyPressed())
|
skipped_terminal_update = 0;
|
||||||
|
std::size_t changedlines = 0;
|
||||||
|
static constexpr int check_interval = 5;
|
||||||
|
|
||||||
|
for (uInt y{0}; y < uInt(vterm->height); y++)
|
||||||
|
{
|
||||||
|
if ( updateTerminalLine(y) )
|
||||||
|
changedlines++;
|
||||||
|
|
||||||
|
if ( changedlines % check_interval == 0
|
||||||
|
&& (keyboard->hasUnprocessedInput() || keyboard->isKeyPressed(0))
|
||||||
&& skipped_terminal_update <= max_skip )
|
&& skipped_terminal_update <= max_skip )
|
||||||
{
|
{
|
||||||
// Skipping terminal updates if there is unprocessed inputs
|
// Skipping terminal updates if there is unprocessed inputs
|
||||||
skipped_terminal_update++;
|
skipped_terminal_update++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
skipped_terminal_update = 0;
|
|
||||||
|
|
||||||
for (uInt y{0}; y < uInt(vterm->height); y++)
|
|
||||||
updateTerminalLine (y);
|
|
||||||
|
|
||||||
vterm->has_changes = false;
|
vterm->has_changes = false;
|
||||||
|
|
||||||
|
@ -1124,7 +1131,7 @@ void FVTerm::scrollAreaForward (FTermArea* area) const
|
||||||
|
|
||||||
// insert a new line below
|
// insert a new line below
|
||||||
FChar nc{}; // next character
|
FChar nc{}; // next character
|
||||||
std::size_t bottom_right = (y_max * total_width) - area->right_shadow - 1;
|
auto bottom_right = std::size_t((y_max * total_width) - area->right_shadow - 1);
|
||||||
const auto& lc = area->data[bottom_right]; // last character
|
const auto& lc = area->data[bottom_right]; // last character
|
||||||
std::memcpy (&nc, &lc, sizeof(nc));
|
std::memcpy (&nc, &lc, sizeof(nc));
|
||||||
nc.ch = ' ';
|
nc.ch = ' ';
|
||||||
|
@ -1438,8 +1445,8 @@ FVTerm::covered_state FVTerm::isCovered ( const FPoint& pos
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateOverlappedColor ( const FChar& area_char
|
inline void FVTerm::updateOverlappedColor ( const FChar& area_char
|
||||||
, FChar&& over_char
|
, const FChar& over_char
|
||||||
, FChar& vterm_char )
|
, FChar& vterm_char )
|
||||||
{
|
{
|
||||||
// Add the overlapping color to this character
|
// Add the overlapping color to this character
|
||||||
|
@ -1465,7 +1472,7 @@ void FVTerm::updateOverlappedColor ( const FChar& area_char
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateOverlappedCharacter ( FChar&& cover_char
|
inline void FVTerm::updateOverlappedCharacter ( FChar& cover_char
|
||||||
, FChar& vterm_char )
|
, FChar& vterm_char )
|
||||||
{
|
{
|
||||||
// Restore one character on vterm
|
// Restore one character on vterm
|
||||||
|
@ -1476,8 +1483,8 @@ void FVTerm::updateOverlappedCharacter ( FChar&& cover_char
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateShadedCharacter ( const FChar& area_char
|
inline void FVTerm::updateShadedCharacter ( const FChar& area_char
|
||||||
, FChar&& cover_char
|
, FChar& cover_char
|
||||||
, FChar& vterm_char )
|
, FChar& vterm_char )
|
||||||
{
|
{
|
||||||
// Get covered character + add the current color
|
// Get covered character + add the current color
|
||||||
|
@ -1501,8 +1508,8 @@ void FVTerm::updateShadedCharacter ( const FChar& area_char
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateInheritBackground ( const FChar& area_char
|
inline void FVTerm::updateInheritBackground ( const FChar& area_char
|
||||||
, FChar&& cover_char
|
, const FChar& cover_char
|
||||||
, FChar& vterm_char )
|
, FChar& vterm_char )
|
||||||
{
|
{
|
||||||
// Add the covered background to this character
|
// Add the covered background to this character
|
||||||
|
@ -1517,7 +1524,7 @@ void FVTerm::updateInheritBackground ( const FChar& area_char
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateCharacter (const FChar& area_char, FChar& vterm_char)
|
inline void FVTerm::updateCharacter (const FChar& area_char, FChar& vterm_char)
|
||||||
{
|
{
|
||||||
// Copy a area character to the virtual terminal
|
// Copy a area character to the virtual terminal
|
||||||
|
|
||||||
|
@ -1553,13 +1560,13 @@ bool FVTerm::updateVTermCharacter ( const FTermArea* area
|
||||||
{
|
{
|
||||||
// Overlapped character
|
// Overlapped character
|
||||||
auto oc = getOverlappedCharacter (terminal_pos, area);
|
auto oc = getOverlappedCharacter (terminal_pos, area);
|
||||||
updateOverlappedColor (ac, std::move(oc), tc);
|
updateOverlappedColor (ac, oc, tc);
|
||||||
}
|
}
|
||||||
else if ( ac.attr.bit.transparent ) // Transparent
|
else if ( ac.attr.bit.transparent ) // Transparent
|
||||||
{
|
{
|
||||||
// Covered character
|
// Covered character
|
||||||
auto cc = getCoveredCharacter (terminal_pos, area);
|
auto cc = getCoveredCharacter (terminal_pos, area);
|
||||||
updateOverlappedCharacter (std::move(cc), tc);
|
updateOverlappedCharacter (cc, tc);
|
||||||
}
|
}
|
||||||
else // Not transparent
|
else // Not transparent
|
||||||
{
|
{
|
||||||
|
@ -1567,13 +1574,13 @@ bool FVTerm::updateVTermCharacter ( const FTermArea* area
|
||||||
{
|
{
|
||||||
// Covered character
|
// Covered character
|
||||||
auto cc = getCoveredCharacter (terminal_pos, area);
|
auto cc = getCoveredCharacter (terminal_pos, area);
|
||||||
updateShadedCharacter (ac, std::move(cc), tc);
|
updateShadedCharacter (ac, cc, tc);
|
||||||
}
|
}
|
||||||
else if ( ac.attr.bit.inherit_background )
|
else if ( ac.attr.bit.inherit_background )
|
||||||
{
|
{
|
||||||
// Covered character
|
// Covered character
|
||||||
auto cc = getCoveredCharacter (terminal_pos, area);
|
auto cc = getCoveredCharacter (terminal_pos, area);
|
||||||
updateInheritBackground (ac, std::move(cc), tc);
|
updateInheritBackground (ac, cc, tc);
|
||||||
}
|
}
|
||||||
else // Default
|
else // Default
|
||||||
{
|
{
|
||||||
|
@ -1775,9 +1782,8 @@ FChar FVTerm::getCharacter ( character_type char_type
|
||||||
if ( ! area || ! FWidget::getWindowList() || FWidget::getWindowList()->empty() )
|
if ( ! area || ! FWidget::getWindowList() || FWidget::getWindowList()->empty() )
|
||||||
return *cc;
|
return *cc;
|
||||||
|
|
||||||
// Get the window layer of this object
|
// Get the window layer of this widget object
|
||||||
const auto& w = static_cast<FWidget*>(area->widget);
|
const int layer = FWindow::getWindowLayer(area->widget);
|
||||||
const int layer = FWindow::getWindowLayer(w);
|
|
||||||
|
|
||||||
for (auto&& win_obj : *FWidget::getWindowList())
|
for (auto&& win_obj : *FWidget::getWindowList())
|
||||||
{
|
{
|
||||||
|
@ -1813,14 +1819,14 @@ FChar FVTerm::getCharacter ( character_type char_type
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FChar FVTerm::getCoveredCharacter (const FPoint& pos, const FTermArea* area)
|
inline FChar FVTerm::getCoveredCharacter (const FPoint& pos, const FTermArea* area)
|
||||||
{
|
{
|
||||||
// Gets the covered character for a given position
|
// Gets the covered character for a given position
|
||||||
return getCharacter (covered_character, pos, area);
|
return getCharacter (covered_character, pos, area);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FChar FVTerm::getOverlappedCharacter (const FPoint& pos, const FTermArea* area)
|
inline FChar FVTerm::getOverlappedCharacter (const FPoint& pos, const FTermArea* area)
|
||||||
{
|
{
|
||||||
// Gets the overlapped character for a given position
|
// Gets the overlapped character for a given position
|
||||||
return getCharacter (overlapped_character, pos, area);
|
return getCharacter (overlapped_character, pos, area);
|
||||||
|
@ -2310,13 +2316,13 @@ inline void FVTerm::replaceNonPrintableFullwidth ( uInt x
|
||||||
// Replace non-printable full-width characters that are truncated
|
// Replace non-printable full-width characters that are truncated
|
||||||
// from the right or left terminal side
|
// from the right or left terminal side
|
||||||
|
|
||||||
if ( x == 0 && isFullWidthPaddingChar(print_char) )
|
if ( x == 0 && isFullWidthPaddingChar(*print_char) )
|
||||||
{
|
{
|
||||||
print_char->ch = fc::SingleLeftAngleQuotationMark; // ‹
|
print_char->ch = fc::SingleLeftAngleQuotationMark; // ‹
|
||||||
print_char->attr.bit.fullwidth_padding = false;
|
print_char->attr.bit.fullwidth_padding = false;
|
||||||
}
|
}
|
||||||
else if ( x == uInt(vterm->width - 1)
|
else if ( x == uInt(vterm->width - 1)
|
||||||
&& isFullWidthChar(print_char) )
|
&& isFullWidthChar(*print_char) )
|
||||||
{
|
{
|
||||||
print_char->ch = fc::SingleRightAngleQuotationMark; // ›
|
print_char->ch = fc::SingleRightAngleQuotationMark; // ›
|
||||||
print_char->attr.bit.char_width = 1;
|
print_char->attr.bit.char_width = 1;
|
||||||
|
@ -2329,12 +2335,12 @@ void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max
|
||||||
{
|
{
|
||||||
// General character output on terminal
|
// General character output on terminal
|
||||||
|
|
||||||
if ( x < uInt(vterm->width - 1) && isFullWidthChar(print_char) )
|
if ( x < uInt(vterm->width - 1) && isFullWidthChar(*print_char) )
|
||||||
{
|
{
|
||||||
printFullWidthCharacter (x, y, print_char);
|
printFullWidthCharacter (x, y, print_char);
|
||||||
}
|
}
|
||||||
else if ( x > 0 && x < uInt(vterm->width - 1)
|
else if ( x > 0 && x < uInt(vterm->width - 1)
|
||||||
&& isFullWidthPaddingChar(print_char) )
|
&& isFullWidthPaddingChar(*print_char) )
|
||||||
{
|
{
|
||||||
printFullWidthPaddingCharacter (x, y, print_char);
|
printFullWidthPaddingCharacter (x, y, print_char);
|
||||||
}
|
}
|
||||||
|
@ -2361,8 +2367,8 @@ void FVTerm::printFullWidthCharacter ( uInt& x, uInt y
|
||||||
&& print_char->attr.byte[1] == next_char->attr.byte[1]
|
&& print_char->attr.byte[1] == next_char->attr.byte[1]
|
||||||
&& print_char->fg_color == next_char->fg_color
|
&& print_char->fg_color == next_char->fg_color
|
||||||
&& print_char->bg_color == next_char->bg_color
|
&& print_char->bg_color == next_char->bg_color
|
||||||
&& isFullWidthChar(print_char)
|
&& isFullWidthChar(*print_char)
|
||||||
&& isFullWidthPaddingChar(next_char) )
|
&& isFullWidthPaddingChar(*next_char) )
|
||||||
{
|
{
|
||||||
// Print a full-width character
|
// Print a full-width character
|
||||||
appendCharacter (print_char);
|
appendCharacter (print_char);
|
||||||
|
@ -2377,7 +2383,7 @@ void FVTerm::printFullWidthCharacter ( uInt& x, uInt y
|
||||||
term_pos->x_ref()++;
|
term_pos->x_ref()++;
|
||||||
markAsPrinted (x, y);
|
markAsPrinted (x, y);
|
||||||
|
|
||||||
if ( isFullWidthPaddingChar(next_char) )
|
if ( isFullWidthPaddingChar(*next_char) )
|
||||||
{
|
{
|
||||||
// Print ellipses for the 2nd full-width character column
|
// Print ellipses for the 2nd full-width character column
|
||||||
x++;
|
x++;
|
||||||
|
@ -2400,8 +2406,8 @@ void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y
|
||||||
&& print_char->attr.byte[1] == prev_char->attr.byte[1]
|
&& print_char->attr.byte[1] == prev_char->attr.byte[1]
|
||||||
&& print_char->fg_color == prev_char->fg_color
|
&& print_char->fg_color == prev_char->fg_color
|
||||||
&& print_char->bg_color == prev_char->bg_color
|
&& print_char->bg_color == prev_char->bg_color
|
||||||
&& isFullWidthChar(prev_char)
|
&& isFullWidthChar(*prev_char)
|
||||||
&& isFullWidthPaddingChar(print_char) )
|
&& isFullWidthPaddingChar(*print_char) )
|
||||||
{
|
{
|
||||||
// Move cursor one character to the left
|
// Move cursor one character to the left
|
||||||
const auto& le = TCAP(fc::t_cursor_left);
|
const auto& le = TCAP(fc::t_cursor_left);
|
||||||
|
@ -2441,7 +2447,7 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y
|
||||||
const auto vt = vterm;
|
const auto vt = vterm;
|
||||||
auto prev_char = &vt->data[y * uInt(vt->width) + x - 1];
|
auto prev_char = &vt->data[y * uInt(vt->width) + x - 1];
|
||||||
|
|
||||||
if ( isFullWidthChar(prev_char) && ! isFullWidthPaddingChar(print_char) )
|
if ( isFullWidthChar(*prev_char) && ! isFullWidthPaddingChar(*print_char) )
|
||||||
{
|
{
|
||||||
// Move cursor one character to the left
|
// Move cursor one character to the left
|
||||||
const auto& le = TCAP(fc::t_cursor_left);
|
const auto& le = TCAP(fc::t_cursor_left);
|
||||||
|
@ -2474,7 +2480,7 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y
|
||||||
inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y
|
inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y
|
||||||
, const FChar* const& print_char ) const
|
, const FChar* const& print_char ) const
|
||||||
{
|
{
|
||||||
if ( isFullWidthChar(print_char) ) // full-width character
|
if ( isFullWidthChar(*print_char) ) // full-width character
|
||||||
{
|
{
|
||||||
x++; // Skip the following padding character
|
x++; // Skip the following padding character
|
||||||
term_pos->x_ref()++;
|
term_pos->x_ref()++;
|
||||||
|
@ -2565,9 +2571,9 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const
|
||||||
|
|
||||||
for (uInt i = x + 1; i <= xmax; i++)
|
for (uInt i = x + 1; i <= xmax; i++)
|
||||||
{
|
{
|
||||||
auto ch = &vt->data[y * uInt(vt->width) + i];
|
const auto& ch = vt->data[y * uInt(vt->width) + i];
|
||||||
|
|
||||||
if ( *print_char == *ch )
|
if ( *print_char == ch )
|
||||||
repetitions++;
|
repetitions++;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
@ -2610,15 +2616,15 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FVTerm::isFullWidthChar (const FChar* const& ch) const
|
inline bool FVTerm::isFullWidthChar (const FChar& ch) const
|
||||||
{
|
{
|
||||||
return bool(ch->attr.bit.char_width == 2);
|
return bool(ch.attr.bit.char_width == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FVTerm::isFullWidthPaddingChar (const FChar* const& ch) const
|
inline bool FVTerm::isFullWidthPaddingChar (const FChar& ch) const
|
||||||
{
|
{
|
||||||
return ch->attr.bit.fullwidth_padding;
|
return ch.attr.bit.fullwidth_padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -2747,16 +2753,18 @@ void FVTerm::printPaddingCharacter (FTermArea* area, const FChar& term_char)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::updateTerminalLine (uInt y) const
|
bool FVTerm::updateTerminalLine (uInt y) const
|
||||||
{
|
{
|
||||||
// Updates pending changes from line y to the terminal
|
// Updates pending changes from line y to the terminal
|
||||||
|
|
||||||
|
bool ret{};
|
||||||
const auto& vt = vterm;
|
const auto& vt = vterm;
|
||||||
uInt& xmin = vt->changes[y].xmin;
|
uInt& xmin = vt->changes[y].xmin;
|
||||||
uInt& xmax = vt->changes[y].xmax;
|
uInt& xmax = vt->changes[y].xmax;
|
||||||
|
|
||||||
if ( xmin <= xmax ) // Line has changes
|
if ( xmin <= xmax ) // Line has changes
|
||||||
{
|
{
|
||||||
|
ret = true;
|
||||||
bool draw_leading_ws = false;
|
bool draw_leading_ws = false;
|
||||||
bool draw_trailing_ws = false;
|
bool draw_trailing_ws = false;
|
||||||
const auto& ce = TCAP(fc::t_clr_eol);
|
const auto& ce = TCAP(fc::t_clr_eol);
|
||||||
|
@ -2808,8 +2816,11 @@ void FVTerm::updateTerminalLine (uInt y) const
|
||||||
xmin = uInt(vt->width);
|
xmin = uInt(vt->width);
|
||||||
xmax = 0;
|
xmax = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ret = false;
|
||||||
|
|
||||||
cursorWrap();
|
cursorWrap();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -507,10 +507,7 @@ int FWindow::getWindowLayer (FWidget* obj)
|
||||||
|
|
||||||
const FWidget* window;
|
const FWidget* window;
|
||||||
|
|
||||||
if ( ! getWindowList() )
|
if ( ! getWindowList() || getWindowList()->empty() )
|
||||||
return -1;
|
|
||||||
|
|
||||||
if ( getWindowList()->empty() )
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ( ! obj->isWindowWidget() )
|
if ( ! obj->isWindowWidget() )
|
||||||
|
|
|
@ -129,12 +129,12 @@ class FKeyboard final
|
||||||
void setEscPressedCommand (const FKeyboardCommand&);
|
void setEscPressedCommand (const FKeyboardCommand&);
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
bool isInputDataPending() const;
|
bool hasPendingInput() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
static void init();
|
static void init();
|
||||||
bool& unprocessedInput();
|
bool& hasUnprocessedInput();
|
||||||
bool isKeyPressed() const;
|
bool isKeyPressed (uInt64 = read_blocking_time);
|
||||||
void clearKeyBuffer();
|
void clearKeyBuffer();
|
||||||
void clearKeyBufferOnTimeout();
|
void clearKeyBufferOnTimeout();
|
||||||
void fetchKeyCode();
|
void fetchKeyCode();
|
||||||
|
@ -189,8 +189,9 @@ class FKeyboard final
|
||||||
char fifo_buf[FIFO_BUF_SIZE]{'\0'};
|
char fifo_buf[FIFO_BUF_SIZE]{'\0'};
|
||||||
int fifo_offset{0};
|
int fifo_offset{0};
|
||||||
int stdin_status_flags{0};
|
int stdin_status_flags{0};
|
||||||
|
bool has_pending_input{false};
|
||||||
bool fifo_in_use{false};
|
bool fifo_in_use{false};
|
||||||
bool input_data_pending{false};
|
bool unprocessed_buffer_data{false};
|
||||||
bool utf8_input{false};
|
bool utf8_input{false};
|
||||||
bool mouse_support{true};
|
bool mouse_support{true};
|
||||||
bool non_blocking_stdin{false};
|
bool non_blocking_stdin{false};
|
||||||
|
@ -243,8 +244,8 @@ inline bool FKeyboard::unsetNonBlockingInput()
|
||||||
{ return setNonBlockingInput(false); }
|
{ return setNonBlockingInput(false); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FKeyboard::isInputDataPending() const
|
inline bool FKeyboard::hasPendingInput() const
|
||||||
{ return input_data_pending; }
|
{ return has_pending_input; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FKeyboard::enableUTF8()
|
inline void FKeyboard::enableUTF8()
|
||||||
|
|
|
@ -127,7 +127,7 @@ class FMouse
|
||||||
bool isWheelUp();
|
bool isWheelUp();
|
||||||
bool isWheelDown();
|
bool isWheelDown();
|
||||||
bool isMoved();
|
bool isMoved();
|
||||||
bool isInputDataPending() const;
|
bool hasUnprocessedInput() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
template <typename ClassT>
|
template <typename ClassT>
|
||||||
|
@ -183,7 +183,7 @@ class FMouse
|
||||||
// Data members
|
// Data members
|
||||||
FMouseButton b_state{};
|
FMouseButton b_state{};
|
||||||
bool mouse_event_occurred{false};
|
bool mouse_event_occurred{false};
|
||||||
bool input_data_pending{false};
|
bool unprocessed_buffer_data{false};
|
||||||
uInt16 max_width{80};
|
uInt16 max_width{80};
|
||||||
uInt16 max_height{25};
|
uInt16 max_height{25};
|
||||||
uInt64 dblclick_interval{500000}; // 500 ms
|
uInt64 dblclick_interval{500000}; // 500 ms
|
||||||
|
@ -494,7 +494,7 @@ class FMouseControl
|
||||||
bool isWheelUp();
|
bool isWheelUp();
|
||||||
bool isWheelDown();
|
bool isWheelDown();
|
||||||
bool isMoved();
|
bool isMoved();
|
||||||
bool isInputDataPending();
|
bool hasUnprocessedInput();
|
||||||
bool isGpmMouseEnabled();
|
bool isGpmMouseEnabled();
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
|
|
@ -352,10 +352,10 @@ class FVTerm
|
||||||
static bool reallocateTextArea ( FTermArea*
|
static bool reallocateTextArea ( FTermArea*
|
||||||
, std::size_t );
|
, std::size_t );
|
||||||
static covered_state isCovered (const FPoint&, const FTermArea*);
|
static covered_state isCovered (const FPoint&, const FTermArea*);
|
||||||
static void updateOverlappedColor (const FChar&, FChar&&, FChar&);
|
static void updateOverlappedColor (const FChar&, const FChar&, FChar&);
|
||||||
static void updateOverlappedCharacter (FChar&&, FChar&);
|
static void updateOverlappedCharacter (FChar&, FChar&);
|
||||||
static void updateShadedCharacter (const FChar&, FChar&&, FChar&);
|
static void updateShadedCharacter (const FChar&, FChar&, FChar&);
|
||||||
static void updateInheritBackground (const FChar&, FChar&&, FChar&);
|
static void updateInheritBackground (const FChar&, const FChar&, FChar&);
|
||||||
static void updateCharacter (const FChar&, FChar&);
|
static void updateCharacter (const FChar&, FChar&);
|
||||||
static bool updateVTermCharacter ( const FTermArea*
|
static bool updateVTermCharacter ( const FTermArea*
|
||||||
, const FPoint&
|
, const FPoint&
|
||||||
|
@ -395,8 +395,8 @@ class FVTerm
|
||||||
void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const;
|
void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const;
|
||||||
exit_state eraseCharacters (uInt&, uInt, uInt, bool) const;
|
exit_state eraseCharacters (uInt&, uInt, uInt, bool) const;
|
||||||
exit_state repeatCharacter (uInt&, uInt, uInt) const;
|
exit_state repeatCharacter (uInt&, uInt, uInt) const;
|
||||||
bool isFullWidthChar (const FChar* const&) const;
|
bool isFullWidthChar (const FChar&) const;
|
||||||
bool isFullWidthPaddingChar (const FChar* const&) const;
|
bool isFullWidthPaddingChar (const FChar&) const;
|
||||||
static void cursorWrap();
|
static void cursorWrap();
|
||||||
bool printWrap (FTermArea*) const;
|
bool printWrap (FTermArea*) const;
|
||||||
void printCharacterOnCoordinate ( FTermArea*
|
void printCharacterOnCoordinate ( FTermArea*
|
||||||
|
@ -404,7 +404,7 @@ class FVTerm
|
||||||
, const int&
|
, const int&
|
||||||
, const FChar&) const;
|
, const FChar&) const;
|
||||||
void printPaddingCharacter (FTermArea*, const FChar&);
|
void printPaddingCharacter (FTermArea*, const FChar&);
|
||||||
void updateTerminalLine (uInt) const;
|
bool updateTerminalLine (uInt) const;
|
||||||
bool updateTerminalCursor() const;
|
bool updateTerminalCursor() const;
|
||||||
bool isInsideTerminal (const FPoint&) const;
|
bool isInsideTerminal (const FPoint&) const;
|
||||||
bool isTermSizeChanged() const;
|
bool isTermSizeChanged() const;
|
||||||
|
|
|
@ -359,8 +359,7 @@ void FKeyboardTest::noArgumentTest()
|
||||||
CPPUNIT_ASSERT ( time->tv_sec == 0);
|
CPPUNIT_ASSERT ( time->tv_sec == 0);
|
||||||
CPPUNIT_ASSERT ( time->tv_usec == 0);
|
CPPUNIT_ASSERT ( time->tv_usec == 0);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( ! keyboard->isInputDataPending() );
|
CPPUNIT_ASSERT ( ! keyboard->hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! keyboard->unprocessedInput() );
|
|
||||||
CPPUNIT_ASSERT ( ! keyboard->isKeyPressed() );
|
CPPUNIT_ASSERT ( ! keyboard->isKeyPressed() );
|
||||||
|
|
||||||
keyboard->clearKeyBufferOnTimeout();
|
keyboard->clearKeyBufferOnTimeout();
|
||||||
|
|
|
@ -172,7 +172,7 @@ void FMouseTest::noArgumentTest()
|
||||||
CPPUNIT_ASSERT ( ! mouse.isWheelUp() );
|
CPPUNIT_ASSERT ( ! mouse.isWheelUp() );
|
||||||
CPPUNIT_ASSERT ( ! mouse.isWheelDown() );
|
CPPUNIT_ASSERT ( ! mouse.isWheelDown() );
|
||||||
CPPUNIT_ASSERT ( ! mouse.isMoved() );
|
CPPUNIT_ASSERT ( ! mouse.isMoved() );
|
||||||
CPPUNIT_ASSERT ( ! mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! mouse.hasUnprocessedInput() );
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
#ifdef F_HAVE_LIBGPM
|
||||||
finalcut::FMouseGPM gpm_mouse;
|
finalcut::FMouseGPM gpm_mouse;
|
||||||
|
@ -263,7 +263,7 @@ void FMouseTest::x11MouseTest()
|
||||||
{ 0x1b, '[', 'M', 0x23, 0x50, 0x32, 0x40, 0x40 };
|
{ 0x1b, '[', 'M', 0x23, 0x50, 0x32, 0x40, 0x40 };
|
||||||
x11_mouse.setRawData (rawdata1);
|
x11_mouse.setRawData (rawdata1);
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 );
|
||||||
|
|
||||||
timeval tv;
|
timeval tv;
|
||||||
|
@ -298,7 +298,7 @@ void FMouseTest::x11MouseTest()
|
||||||
{ 0x1b, '[', 'M', 0x20, 0x21, 0x21 };
|
{ 0x1b, '[', 'M', 0x20, 0x21, 0x21 };
|
||||||
x11_mouse.setRawData (rawdata2);
|
x11_mouse.setRawData (rawdata2);
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() );
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) );
|
CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) );
|
||||||
|
@ -323,7 +323,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata3);
|
x11_mouse.setRawData (rawdata3);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() );
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) );
|
CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) );
|
||||||
|
@ -348,7 +348,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata4);
|
x11_mouse.setRawData (rawdata4);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
|
@ -376,7 +376,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata5);
|
x11_mouse.setRawData (rawdata5);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
|
@ -398,7 +398,7 @@ void FMouseTest::x11MouseTest()
|
||||||
|
|
||||||
x11_mouse.setRawData (rawdata5);
|
x11_mouse.setRawData (rawdata5);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isMiddleButtonPressed() );
|
CPPUNIT_ASSERT ( ! x11_mouse.isMiddleButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isMiddleButtonReleased() );
|
CPPUNIT_ASSERT ( x11_mouse.isMiddleButtonReleased() );
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata6);
|
x11_mouse.setRawData (rawdata6);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
|
@ -431,7 +431,7 @@ void FMouseTest::x11MouseTest()
|
||||||
|
|
||||||
x11_mouse.setRawData (rawdata6);
|
x11_mouse.setRawData (rawdata6);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isRightButtonPressed() );
|
CPPUNIT_ASSERT ( ! x11_mouse.isRightButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isRightButtonReleased() );
|
CPPUNIT_ASSERT ( x11_mouse.isRightButtonReleased() );
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata7);
|
x11_mouse.setRawData (rawdata7);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
|
@ -464,7 +464,7 @@ void FMouseTest::x11MouseTest()
|
||||||
|
|
||||||
x11_mouse.setRawData (rawdata7);
|
x11_mouse.setRawData (rawdata7);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isWheelDown() );
|
CPPUNIT_ASSERT ( x11_mouse.isWheelDown() );
|
||||||
|
|
||||||
// Mouse move
|
// Mouse move
|
||||||
|
@ -475,7 +475,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata8);
|
x11_mouse.setRawData (rawdata8);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
|
@ -514,7 +514,7 @@ void FMouseTest::x11MouseTest()
|
||||||
x11_mouse.setRawData (rawdata9);
|
x11_mouse.setRawData (rawdata9);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( x11_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
x11_mouse.processEvent (&tv);
|
x11_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! x11_mouse.hasData() );
|
||||||
|
@ -578,7 +578,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
, '3', ';', '4', 'M', '@', '@' };
|
, '3', ';', '4', 'M', '@', '@' };
|
||||||
sgr_mouse.setRawData (rawdata1);
|
sgr_mouse.setRawData (rawdata1);
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 );
|
||||||
|
|
||||||
timeval tv;
|
timeval tv;
|
||||||
|
@ -614,7 +614,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata2);
|
sgr_mouse.setRawData (rawdata2);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() );
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(73, 4) );
|
CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(73, 4) );
|
||||||
|
@ -639,7 +639,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata4);
|
sgr_mouse.setRawData (rawdata4);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
|
@ -666,7 +666,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata5);
|
sgr_mouse.setRawData (rawdata5);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
|
@ -688,7 +688,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
|
|
||||||
sgr_mouse.setRawData (rawdata5);
|
sgr_mouse.setRawData (rawdata5);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isMiddleButtonPressed() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.isMiddleButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isMiddleButtonReleased() );
|
CPPUNIT_ASSERT ( sgr_mouse.isMiddleButtonReleased() );
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata6);
|
sgr_mouse.setRawData (rawdata6);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
|
@ -722,7 +722,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata6);
|
sgr_mouse.setRawData (rawdata6);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(3, 4) );
|
CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(3, 4) );
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isRightButtonPressed() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.isRightButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isRightButtonReleased() );
|
CPPUNIT_ASSERT ( sgr_mouse.isRightButtonReleased() );
|
||||||
|
|
||||||
|
@ -733,7 +733,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata7);
|
sgr_mouse.setRawData (rawdata7);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
|
@ -755,7 +755,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
|
|
||||||
sgr_mouse.setRawData (rawdata7);
|
sgr_mouse.setRawData (rawdata7);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isWheelDown() );
|
CPPUNIT_ASSERT ( sgr_mouse.isWheelDown() );
|
||||||
|
|
||||||
// Mouse move
|
// Mouse move
|
||||||
|
@ -766,7 +766,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata8);
|
sgr_mouse.setRawData (rawdata8);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
|
@ -805,7 +805,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.setRawData (rawdata9);
|
sgr_mouse.setRawData (rawdata9);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasData() );
|
||||||
|
@ -876,7 +876,7 @@ void FMouseTest::sgrMouseTest()
|
||||||
sgr_mouse.processEvent (&tv);
|
sgr_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! sgr_mouse.hasEvent() );
|
CPPUNIT_ASSERT ( ! sgr_mouse.hasEvent() );
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( std::strcmp(rawdata11, "@") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(rawdata11, "@") == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -892,7 +892,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
, '9', ';', '6', 'M', '@', '@' };
|
, '9', ';', '6', 'M', '@', '@' };
|
||||||
urxvt_mouse.setRawData (rawdata1);
|
urxvt_mouse.setRawData (rawdata1);
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 );
|
||||||
|
|
||||||
timeval tv;
|
timeval tv;
|
||||||
|
@ -927,7 +927,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata2);
|
urxvt_mouse.setRawData (rawdata2);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() );
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(49, 6) );
|
CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(49, 6) );
|
||||||
|
@ -952,7 +952,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata4);
|
urxvt_mouse.setRawData (rawdata4);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
|
@ -979,7 +979,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata5);
|
urxvt_mouse.setRawData (rawdata5);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
|
@ -1001,7 +1001,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
|
|
||||||
urxvt_mouse.setRawData (rawdata5);
|
urxvt_mouse.setRawData (rawdata5);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isMiddleButtonPressed() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.isMiddleButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isMiddleButtonReleased() );
|
CPPUNIT_ASSERT ( urxvt_mouse.isMiddleButtonReleased() );
|
||||||
|
|
||||||
|
@ -1012,7 +1012,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata6);
|
urxvt_mouse.setRawData (rawdata6);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
|
@ -1035,7 +1035,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata6);
|
urxvt_mouse.setRawData (rawdata6);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(3, 4) );
|
CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(3, 4) );
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isRightButtonPressed() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.isRightButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isRightButtonReleased() );
|
CPPUNIT_ASSERT ( urxvt_mouse.isRightButtonReleased() );
|
||||||
|
|
||||||
|
@ -1046,7 +1046,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata7);
|
urxvt_mouse.setRawData (rawdata7);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
|
@ -1068,7 +1068,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
|
|
||||||
urxvt_mouse.setRawData (rawdata7);
|
urxvt_mouse.setRawData (rawdata7);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isWheelDown() );
|
CPPUNIT_ASSERT ( urxvt_mouse.isWheelDown() );
|
||||||
|
|
||||||
// Mouse move
|
// Mouse move
|
||||||
|
@ -1079,7 +1079,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata8);
|
urxvt_mouse.setRawData (rawdata8);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
|
@ -1118,7 +1118,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.setRawData (rawdata9);
|
urxvt_mouse.setRawData (rawdata9);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
|
@ -1189,7 +1189,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasEvent() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasEvent() );
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( std::strcmp(rawdata11, "@") == 0 );
|
CPPUNIT_ASSERT ( std::strcmp(rawdata11, "@") == 0 );
|
||||||
|
|
||||||
// Negative values
|
// Negative values
|
||||||
|
@ -1198,7 +1198,7 @@ void FMouseTest::urxvtMouseTest()
|
||||||
, 0x1b, '[', '3', '2', ';', '3', ';', '-', '3', 'M' };
|
, 0x1b, '[', '3', '2', ';', '3', ';', '-', '3', 'M' };
|
||||||
urxvt_mouse.setRawData (rawdata12);
|
urxvt_mouse.setRawData (rawdata12);
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() );
|
CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() );
|
||||||
urxvt_mouse.processEvent (&tv);
|
urxvt_mouse.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() );
|
||||||
CPPUNIT_ASSERT ( urxvt_mouse.getPos() != finalcut::FPoint(-5, 5) );
|
CPPUNIT_ASSERT ( urxvt_mouse.getPos() != finalcut::FPoint(-5, 5) );
|
||||||
|
@ -1255,7 +1255,7 @@ void FMouseTest::mouseControlTest()
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() );
|
CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() );
|
CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isMoved() );
|
CPPUNIT_ASSERT ( ! mouse_control.isMoved() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() );
|
||||||
|
|
||||||
if ( mouse_control.isGpmMouseEnabled() )
|
if ( mouse_control.isGpmMouseEnabled() )
|
||||||
{
|
{
|
||||||
|
@ -1270,7 +1270,7 @@ void FMouseTest::mouseControlTest()
|
||||||
mouse_control.setRawData (finalcut::FMouse::x11, rawdata1);
|
mouse_control.setRawData (finalcut::FMouse::x11, rawdata1);
|
||||||
|
|
||||||
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() );
|
||||||
timeval tv;
|
timeval tv;
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
|
@ -1290,11 +1290,11 @@ void FMouseTest::mouseControlTest()
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() );
|
CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() );
|
CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isMoved() );
|
CPPUNIT_ASSERT ( ! mouse_control.isMoved() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() );
|
||||||
|
|
||||||
mouse_control.setRawData (finalcut::FMouse::x11, rawdata1);
|
mouse_control.setRawData (finalcut::FMouse::x11, rawdata1);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() );
|
CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isLeftButtonReleased() );
|
CPPUNIT_ASSERT ( mouse_control.isLeftButtonReleased() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonDoubleClick() );
|
CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonDoubleClick() );
|
||||||
|
@ -1305,7 +1305,7 @@ void FMouseTest::mouseControlTest()
|
||||||
, 0x1b, '[', '<', '1', ';', '1', ';', '1', 'm' };
|
, 0x1b, '[', '<', '1', ';', '1', ';', '1', 'm' };
|
||||||
mouse_control.setRawData (finalcut::FMouse::sgr, rawdata2);
|
mouse_control.setRawData (finalcut::FMouse::sgr, rawdata2);
|
||||||
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
||||||
|
@ -1327,7 +1327,7 @@ void FMouseTest::mouseControlTest()
|
||||||
|
|
||||||
mouse_control.setRawData (finalcut::FMouse::sgr, rawdata2);
|
mouse_control.setRawData (finalcut::FMouse::sgr, rawdata2);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isMiddleButtonPressed() );
|
CPPUNIT_ASSERT ( ! mouse_control.isMiddleButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isMiddleButtonReleased() );
|
CPPUNIT_ASSERT ( mouse_control.isMiddleButtonReleased() );
|
||||||
|
|
||||||
|
@ -1336,7 +1336,7 @@ void FMouseTest::mouseControlTest()
|
||||||
, 0x1b, '[', '3', '5', ';', '3', ';', '4', 'M' };
|
, 0x1b, '[', '3', '5', ';', '3', ';', '4', 'M' };
|
||||||
mouse_control.setRawData (finalcut::FMouse::urxvt, rawdata3);
|
mouse_control.setRawData (finalcut::FMouse::urxvt, rawdata3);
|
||||||
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
||||||
|
@ -1359,7 +1359,7 @@ void FMouseTest::mouseControlTest()
|
||||||
mouse_control.setRawData (finalcut::FMouse::urxvt, rawdata3);
|
mouse_control.setRawData (finalcut::FMouse::urxvt, rawdata3);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(3, 4) );
|
CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(3, 4) );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isRightButtonPressed() );
|
CPPUNIT_ASSERT ( ! mouse_control.isRightButtonPressed() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isRightButtonReleased() );
|
CPPUNIT_ASSERT ( mouse_control.isRightButtonReleased() );
|
||||||
|
|
||||||
|
@ -1369,7 +1369,7 @@ void FMouseTest::mouseControlTest()
|
||||||
, 0x1b, '[', 'M', 0x61, 0x70, 0x39 };
|
, 0x1b, '[', 'M', 0x61, 0x70, 0x39 };
|
||||||
mouse_control.setRawData (finalcut::FMouse::x11, rawdata4);
|
mouse_control.setRawData (finalcut::FMouse::x11, rawdata4);
|
||||||
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
||||||
|
@ -1391,7 +1391,7 @@ void FMouseTest::mouseControlTest()
|
||||||
|
|
||||||
mouse_control.setRawData (finalcut::FMouse::x11, rawdata4);
|
mouse_control.setRawData (finalcut::FMouse::x11, rawdata4);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isWheelDown() );
|
CPPUNIT_ASSERT ( mouse_control.isWheelDown() );
|
||||||
|
|
||||||
// Mouse move on an SGR mouse
|
// Mouse move on an SGR mouse
|
||||||
|
@ -1401,7 +1401,7 @@ void FMouseTest::mouseControlTest()
|
||||||
, 0x1b, '[', '<', '0', ';', '3', ';', '4', 'm' };
|
, 0x1b, '[', '<', '0', ';', '3', ';', '4', 'm' };
|
||||||
mouse_control.setRawData (finalcut::FMouse::sgr, rawdata5);
|
mouse_control.setRawData (finalcut::FMouse::sgr, rawdata5);
|
||||||
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
CPPUNIT_ASSERT ( mouse_control.hasData() );
|
||||||
CPPUNIT_ASSERT ( mouse_control.isInputDataPending() );
|
CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() );
|
||||||
finalcut::FObject::getCurrentTime(&tv);
|
finalcut::FObject::getCurrentTime(&tv);
|
||||||
mouse_control.processEvent (&tv);
|
mouse_control.processEvent (&tv);
|
||||||
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
CPPUNIT_ASSERT ( ! mouse_control.hasData() );
|
||||||
|
|
Loading…
Reference in New Issue