Improved code alignment

This commit is contained in:
Markus Gans 2017-11-26 22:37:18 +01:00
parent 6ef36ac7f7
commit 6be608ba57
31 changed files with 444 additions and 441 deletions

View File

@ -1,6 +1,8 @@
2017-11-26 Markus Gans <guru.mail@muenster.de>
* Better code readability by splitting FOptiMove::moveCursor
into sub-functions
* Improved alignment of the code by changing the indentation
in Boolean expressions
2017-11-25 Markus Gans <guru.mail@muenster.de>
* Splitting quirks in serperate methods

View File

@ -687,7 +687,7 @@ void Calc::cb_buttonClicked (FWidget*, data_ptr data)
else
// Test if (x / 180) != 0 and x / 90 == 0
if ( std::fabs(std::fmod(*x, 180.0L)) > LDBL_EPSILON
&& std::fabs(std::fmod(*x, 90.0L)) < LDBL_EPSILON )
&& std::fabs(std::fmod(*x, 90.0L)) < LDBL_EPSILON )
error = true;
else if ( std::fabs(std::fmod(*x, 180.0L)) < LDBL_EPSILON ) // x / 180 == 0
*x = 0.0L;
@ -987,8 +987,8 @@ void Calc::cb_buttonClicked (FWidget*, data_ptr data)
{
// remove trailing zeros
while ( ! input.includes(L'e')
&& input.includes(L'.')
&& input.back() == L'0' )
&& input.includes(L'.')
&& input.back() == L'0' )
input = input.left(input.getLength() - 1);
}
}

View File

@ -223,11 +223,11 @@ void Menu::defaultCallback (FMenuList* mb)
FMenuItem* item = mb->getItem(int(i));
if ( item
&& item->isEnabled()
&& item->acceptFocus()
&& item->isVisible()
&& ! item->isSeparator()
&& item->getText() != "&Quit" )
&& item->isEnabled()
&& item->acceptFocus()
&& item->isVisible()
&& ! item->isSeparator()
&& item->getText() != "&Quit" )
{
// Add the callback function
item->addCallback

View File

@ -494,9 +494,9 @@ void Window::cb_next (FWidget*, data_ptr)
next = static_cast<FDialog*>(*next_element);
} while ( ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
|| ! next->isWindowWidget() );
|| ! next->acceptFocus()
|| ! next->isVisible()
|| ! next->isWindowWidget() );
activateWindow(next);
break;
@ -520,7 +520,7 @@ void Window::cb_previous (FWidget*, data_ptr)
--iter;
if ( (*iter)->isDialogWidget()
&& static_cast<FWindow*>(*iter)->isWindowActive() )
&& static_cast<FWindow*>(*iter)->isWindowActive() )
{
FDialog* prev;
widgetList::const_iterator prev_element;
@ -534,9 +534,9 @@ void Window::cb_previous (FWidget*, data_ptr)
--prev_element;
prev = static_cast<FDialog*>(*prev_element);
} while ( ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| ! prev->isWindowWidget() );
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| ! prev->isWindowWidget() );
activateWindow(prev);
break;

View File

@ -298,9 +298,9 @@ class FOptiAttr
inline bool operator == ( const FOptiAttr::char_data& lhs,
const FOptiAttr::char_data& rhs )
{
return lhs.code == rhs.code
&& lhs.fg_color == rhs.fg_color
&& lhs.bg_color == rhs.bg_color
return lhs.code == rhs.code
&& lhs.fg_color == rhs.fg_color
&& lhs.bg_color == rhs.bg_color
&& lhs.attr.byte[0] == rhs.attr.byte[0]
&& lhs.attr.byte[1] == rhs.attr.byte[1];
}

View File

@ -77,7 +77,7 @@ FApplication::FApplication ( const int& _argc
, new_mouse_position()
{
assert ( ! rootObj
&& "FApplication: There should be only one application object" );
&& "FApplication: There should be only one application object" );
rootObj = this;
if ( ! (_argc && _argv) )
@ -204,8 +204,8 @@ bool FApplication::sendEvent ( const FObject* receiver
// block events for widgets in non modal windows
if ( window
&& (window->getFlags() & fc::modal) == 0
&& ! window->isMenuWidget() )
&& (window->getFlags() & fc::modal) == 0
&& ! window->isMenuWidget() )
{
switch ( event->type() )
{
@ -230,8 +230,8 @@ bool FApplication::sendEvent ( const FObject* receiver
// Throw away mouse events for disabled widgets
if ( event->type() >= fc::MouseDown_Event
&& event->type() <= fc::MouseMove_Event
&& ! widget->isEnabled() )
&& event->type() <= fc::MouseMove_Event
&& ! widget->isEnabled() )
return false;
// For access to a protected base class member
@ -313,7 +313,7 @@ bool FApplication::removeQueuedEvent (const FObject* receiver)
FWidget* FApplication::processParameters (const int& argc, char* argv[])
{
if ( argc > 0 && argv[1] && ( std::strcmp(argv[1], "--help") == 0
|| std::strcmp(argv[1], "-h") == 0 ) )
|| std::strcmp(argv[1], "-h") == 0 ) )
{
showParameterUsage();
}
@ -615,8 +615,8 @@ void FApplication::processKeyboardEvent()
// read the rest from the fifo buffer
while ( ! widget->isKeyTimeout(&time_keypressed, key_timeout)
&& fifo_offset > 0
&& key != NEED_MORE_DATA )
&& fifo_offset > 0
&& key != NEED_MORE_DATA )
{
key = FTerm::parseKeyString(fifo_buf, fifo_buf_size, &time_keypressed);
@ -726,8 +726,8 @@ void FApplication::processKeyboardEvent()
sendEvent (widget, &k_press_ev);
if ( ! open_menu
&& ! k_press_ev.isAccepted()
&& ! k_down_ev.isAccepted() )
&& ! k_press_ev.isAccepted()
&& ! k_down_ev.isAccepted() )
{
// switch to a specific dialog with Meta + 1..9
bool accpt = processDialogSwitchAccelerator();
@ -769,10 +769,10 @@ void FApplication::processKeyboardEvent()
// special case: Esc key
if ( fifo_in_use
&& fifo_offset == 1
&& fifo_buf[0] == 0x1b
&& fifo_buf[1] == 0x00
&& isKeyTimeout(&time_keypressed, key_timeout) )
&& fifo_offset == 1
&& fifo_buf[0] == 0x1b
&& fifo_buf[1] == 0x00
&& isKeyTimeout(&time_keypressed, key_timeout) )
{
FKeyEvent k_press_ev (fc::KeyPress_Event, fc::Fkey_escape);
sendEvent (widget, &k_press_ev);
@ -1095,8 +1095,8 @@ bool FApplication::processAccelerator (const FWidget*& widget)
bool accpt = false;
if ( widget
&& widget->accelerator_list
&& ! widget->accelerator_list->empty() )
&& widget->accelerator_list
&& ! widget->accelerator_list->empty() )
{
FWidget::Accelerators::const_iterator iter, last;
iter = widget->accelerator_list->begin();
@ -1161,8 +1161,8 @@ void FApplication::getX11ButtonState (int button)
case button1_pressed:
case button1_pressed_move:
if ( mouse_position == new_mouse_position
&& x11_button_state == all_buttons_released
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
&& x11_button_state == all_buttons_released
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
{
time_mousepressed.tv_sec = 0;
time_mousepressed.tv_usec = 0;
@ -1269,8 +1269,8 @@ bool FApplication::parseX11Mouse()
b_state.control_button = Pressed;
if ( (x11_mouse[0] & button_mask) >= button1_pressed_move
&& (x11_mouse[0] & button_mask) <= button3_pressed_move
&& mouse_position != *zero_point )
&& (x11_mouse[0] & button_mask) <= button3_pressed_move
&& mouse_position != *zero_point )
{
b_state.mouse_moved = true;
}
@ -1278,10 +1278,10 @@ bool FApplication::parseX11Mouse()
getX11ButtonState (x11_mouse[0] & button_mask);
if ( uChar(x11_mouse[1]) == mouse_position.getX() + 0x20
&& uChar(x11_mouse[2]) == mouse_position.getY() + 0x20
&& b_state.wheel_up != Pressed
&& b_state.wheel_down != Pressed
&& uChar(x11_mouse[0]) == x11_button_state )
&& uChar(x11_mouse[2]) == mouse_position.getY() + 0x20
&& b_state.wheel_up != Pressed
&& b_state.wheel_down != Pressed
&& uChar(x11_mouse[0]) == x11_button_state )
{
return false;
}
@ -1364,8 +1364,8 @@ bool FApplication::parseSGRMouse()
b_state.control_button = Pressed;
if ( (button & button_mask) >= button1_move
&& (button & button_mask) <= button3_move
&& mouse_position != *zero_point )
&& (button & button_mask) <= button3_move
&& mouse_position != *zero_point )
{
b_state.mouse_moved = true;
}
@ -1377,8 +1377,8 @@ bool FApplication::parseSGRMouse()
case button1:
case button1_move:
if ( mouse_position == new_mouse_position
&& (((x11_button_state & 0x80) >> 2) + 'M') == released
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
&& (((x11_button_state & 0x80) >> 2) + 'M') == released
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
{
time_mousepressed.tv_sec = 0;
time_mousepressed.tv_usec = 0;
@ -1446,9 +1446,9 @@ bool FApplication::parseSGRMouse()
}
if ( mouse_position == new_mouse_position
&& b_state.wheel_up != Pressed
&& b_state.wheel_down != Pressed
&& x11_button_state == uChar(((*p & 0x20) << 2) + button) )
&& b_state.wheel_up != Pressed
&& b_state.wheel_down != Pressed
&& x11_button_state == uChar(((*p & 0x20) << 2) + button) )
{
return false;
}
@ -1562,8 +1562,8 @@ bool FApplication::parseUrxvtMouse()
b_state.control_button = Pressed;
if ( (button & button_mask) >= button1_pressed_move
&& (button & button_mask) <= button3_pressed_move
&& mouse_position != *zero_point )
&& (button & button_mask) <= button3_pressed_move
&& mouse_position != *zero_point )
{
b_state.mouse_moved = true;
}
@ -1571,9 +1571,9 @@ bool FApplication::parseUrxvtMouse()
getX11ButtonState (button & button_mask);
if ( mouse_position == new_mouse_position
&& b_state.wheel_up != Pressed
&& b_state.wheel_down != Pressed
&& x11_button_state == uChar(button) )
&& b_state.wheel_up != Pressed
&& b_state.wheel_down != Pressed
&& x11_button_state == uChar(button) )
{
return false;
}
@ -1678,16 +1678,16 @@ void FApplication::processMouseEvent()
#ifdef F_HAVE_LIBGPM
if ( ! gpmMouseEvent
&& x11_mouse[0] == '\0'
&& sgr_mouse[0] == '\0'
&& urxvt_mouse[0] == '\0' )
&& x11_mouse[0] == '\0'
&& sgr_mouse[0] == '\0'
&& urxvt_mouse[0] == '\0' )
{
return;
}
#else
if ( x11_mouse[0] == '\0'
&& sgr_mouse[0] == '\0'
&& urxvt_mouse[0] == '\0' )
&& sgr_mouse[0] == '\0'
&& urxvt_mouse[0] == '\0' )
{
return;
}
@ -1713,12 +1713,12 @@ void FApplication::processMouseEvent()
const FPoint& mouse_position = getMousePos();
if ( ! clicked_widget
&& ( b_state.left_button == Pressed
|| b_state.left_button == DoubleClick
|| b_state.right_button == Pressed
|| b_state.middle_button == Pressed
|| b_state.wheel_up == Pressed
|| b_state.wheel_down == Pressed ) )
&& ( b_state.left_button == Pressed
|| b_state.left_button == DoubleClick
|| b_state.right_button == Pressed
|| b_state.middle_button == Pressed
|| b_state.wheel_up == Pressed
|| b_state.wheel_down == Pressed ) )
{
// determine the window object on the current click position
FWidget* window = FWindow::getWindowWidgetAt (mouse_position);
@ -1773,8 +1773,8 @@ void FApplication::processMouseEvent()
// unselected menu bar item
if ( ! open_menu && getMenuBar()
&& getMenuBar()->hasSelectedItem()
&& ! b_state.mouse_moved )
&& getMenuBar()->hasSelectedItem()
&& ! b_state.mouse_moved )
{
if ( ! getMenuBar()->getTermGeometry().contains(mouse_position) )
{
@ -1868,7 +1868,7 @@ void FApplication::processMouseEvent()
FWidget* released_widget = clicked_widget;
if ( b_state.right_button != Pressed
&& b_state.middle_button != Pressed )
&& b_state.middle_button != Pressed )
clicked_widget = 0;
sendEvent (released_widget, &m_up_ev);
@ -1891,7 +1891,7 @@ void FApplication::processMouseEvent()
FWidget* released_widget = clicked_widget;
if ( b_state.left_button != Pressed
&& b_state.middle_button != Pressed )
&& b_state.middle_button != Pressed )
clicked_widget = 0;
sendEvent (released_widget, &m_up_ev);
@ -1918,7 +1918,7 @@ void FApplication::processMouseEvent()
FWidget* released_widget = clicked_widget;
if ( b_state.right_button != Pressed
&& b_state.left_button != Pressed )
&& b_state.left_button != Pressed )
{
clicked_widget = 0;
}
@ -1993,8 +1993,8 @@ int FApplication::processTimerEvent()
while ( iter != last )
{
if ( ! (*iter).id
|| ! (*iter).object
|| currentTime < (*iter).timeout ) // no timer expired
|| ! (*iter).object
|| currentTime < (*iter).timeout ) // no timer expired
break;
(*iter).timeout += (*iter).interval;

View File

@ -206,8 +206,8 @@ bool FButton::setFlat (bool on)
bool FButton::setShadow (bool on)
{
if ( on
&& term_encoding != fc::VT100
&& term_encoding != fc::ASCII )
&& term_encoding != fc::VT100
&& term_encoding != fc::ASCII )
{
flags |= fc::shadow;
setShadowSize(1,1);
@ -650,8 +650,8 @@ void FButton::draw()
drawFlatBorder();
if ( ! button_down
&& ! isNewFont()
&& (is_Flat || ! hasShadow() || isMonochron()) )
&& ! isNewFont()
&& (is_Flat || ! hasShadow() || isMonochron()) )
{
// clear the right █ from button down
if ( parent_widget )

View File

@ -425,8 +425,8 @@ void FButtonGroup::cb_buttonToggled (FWidget* widget, data_ptr)
FToggleButton* toggle_button = static_cast<FToggleButton*>(*iter);
if ( toggle_button != button
&& toggle_button->isChecked()
&& isRadioButton(toggle_button) )
&& toggle_button->isChecked()
&& isRadioButton(toggle_button) )
{
toggle_button->unsetChecked();

View File

@ -290,8 +290,8 @@ void FDialog::setPos (int x, int y, bool)
FWidget* focus_widget = FWidget::getFocusWidget();
if ( focus_widget
&& focus_widget->isVisible()
&& focus_widget->hasVisibleCursor() )
&& focus_widget->isVisible()
&& focus_widget->hasVisibleCursor() )
{
FPoint cursor_pos = focus_widget->getCursorPos();
focus_widget->setCursorPos(cursor_pos);
@ -372,8 +372,8 @@ void FDialog::setSize (int w, int h, bool adjust)
// set the cursor to the focus widget
FWidget* focus_widget = FWidget::getFocusWidget();
if ( focus_widget
&& focus_widget->isVisible()
&& focus_widget->hasVisibleCursor() )
&& focus_widget->isVisible()
&& focus_widget->hasVisibleCursor() )
{
FPoint cursor_pos = focus_widget->getCursorPos();
focus_widget->setCursorPos(cursor_pos);
@ -426,8 +426,8 @@ void FDialog::onKeyPress (FKeyEvent* ev)
updateTerminal();
}
if ( ev->key() == fc::Fckey_caret // Ctrl+^ (Ctrl+6)
|| ev->key() == fc::Fkey_f22 ) // Shift+F10
if ( ev->key() == fc::Fckey_caret // Ctrl+^ (Ctrl+6)
|| ev->key() == fc::Fkey_f22 ) // Shift+F10
{
ev->accept();
// open the titlebar menu
@ -534,7 +534,7 @@ void FDialog::onKeyPress (FKeyEvent* ev)
return;
if ( ev->key() == fc::Fkey_escape
|| ev->key() == fc::Fkey_escape_mintty )
|| ev->key() == fc::Fkey_escape_mintty )
{
ev->accept();
@ -596,9 +596,9 @@ void FDialog::onMouseDown (FMouseEvent* ev)
// click on the lower right resize corner
if ( isResizeable()
&& ( (mouse_x == getWidth() && mouse_y == getHeight())
|| (mouse_x == getWidth() - 1 && mouse_y == getHeight())
|| (mouse_x == getWidth() && mouse_y == getHeight() - 1) ) )
&& ( (mouse_x == getWidth() && mouse_y == getHeight())
|| (mouse_x == getWidth() - 1 && mouse_y == getHeight())
|| (mouse_x == getWidth() && mouse_y == getHeight() - 1) ) )
{
resize_click_pos = ev->getTermPos();
FPoint lower_right_pos = getTermGeometry().getLowerRightPos();
@ -676,9 +676,9 @@ void FDialog::onMouseUp (FMouseEvent* ev)
, titlebar_y = titlebar_click_pos.getY();
if ( ! titlebar_click_pos.isNull()
&& titlebar_x > getTermX() + 3
&& titlebar_x < getTermX() + getWidth()
&& titlebar_y == getTermY() )
&& titlebar_x > getTermX() + 3
&& titlebar_x < getTermX() + getWidth()
&& titlebar_y == getTermY() )
{
FPoint deltaPos = ev->getTermPos() - titlebar_click_pos;
move (deltaPos);
@ -687,16 +687,16 @@ void FDialog::onMouseUp (FMouseEvent* ev)
// click on titlebar menu button
if ( mouse_x < 4
&& mouse_y == 1
&& dialog_menu->isVisible()
&& ! dialog_menu->hasSelectedItem() )
&& mouse_y == 1
&& dialog_menu->isVisible()
&& ! dialog_menu->hasSelectedItem() )
{
// Sets focus to the first item
selectFirstMenuItem();
}
else if ( mouse_x > getWidth() - zoom_btn
&& mouse_y == 1
&& zoom_button_pressed )
&& mouse_y == 1
&& zoom_button_pressed )
{
// zoom to maximum or restore the window size
zoomWindow();
@ -784,7 +784,7 @@ void FDialog::onMouseMove (FMouseEvent* ev)
const FRect& menu_geometry = dialog_menu->getTermGeometry();
if ( dialog_menu->getCount() > 0
&& menu_geometry.contains(ev->getTermPos()) )
&& menu_geometry.contains(ev->getTermPos()) )
{
const FPoint& g = ev->getTermPos();
const FPoint& p = dialog_menu->termToWidgetPos(g);
@ -815,7 +815,7 @@ void FDialog::onMouseMove (FMouseEvent* ev)
// resize the dialog
if ( isResizeable() && ! resize_click_pos.isNull()
&& ev->getTermPos() != getTermGeometry().getLowerRightPos() )
&& ev->getTermPos() != getTermGeometry().getLowerRightPos() )
{
FWidget* r = getRootWidget();
resize_click_pos = ev->getTermPos();
@ -896,9 +896,9 @@ void FDialog::onMouseDoubleClick (FMouseEvent* ev)
close();
}
else if ( isResizeable()
&& mouse_x >= 4
&& mouse_x <= getWidth() - zoom_btn
&& mouse_y == 1 )
&& mouse_x >= 4
&& mouse_x <= getWidth() - zoom_btn
&& mouse_y == 1 )
{
// double click on titlebar
zoomWindow(); // window zoom/unzoom
@ -932,8 +932,8 @@ void FDialog::onWindowActive (FEvent*)
FWidget* win_focus = getWindowFocusWidget();
if ( win_focus
&& win_focus->isVisible()
&& win_focus->isShown() )
&& win_focus->isVisible()
&& win_focus->isShown() )
{
win_focus->setFocus();
win_focus->redraw();
@ -1189,7 +1189,7 @@ void FDialog::drawBorder()
, y2 = 1 + getHeight() - 1;
if ( (getMoveSizeWidget() == this || ! resize_click_pos.isNull() )
&& ! isZoomed() )
&& ! isZoomed() )
setColor (wc.dialog_resize_fg, getBackgroundColor());
else
setColor();

View File

@ -281,15 +281,15 @@ int FFileDialog::readDir()
continue;
if ( ! show_hidden
&& next->d_name[0] == '.'
&& next->d_name[1] != '\0'
&& next->d_name[1] != '.' )
&& next->d_name[0] == '.'
&& next->d_name[1] != '\0'
&& next->d_name[1] != '.' )
{
continue;
}
if ( dir[0] == '/' && dir[1] == '\0'
&& std::strcmp(next->d_name, "..") == 0 )
&& std::strcmp(next->d_name, "..") == 0 )
continue;
dir_entry entry;
@ -775,7 +775,7 @@ const FString FFileDialog::getHomeDir()
void FFileDialog::cb_processActivate (FWidget*, data_ptr)
{
if ( filename->getText().includes('*')
|| filename->getText().includes('?') )
|| filename->getText().includes('?') )
{
setFilter(filename->getText());
readDir();
@ -788,8 +788,8 @@ void FFileDialog::cb_processActivate (FWidget*, data_ptr)
filebrowser->redraw();
}
else if ( filename->getText().trim() == FString("..")
|| filename->getText().includes('/')
|| filename->getText().includes('~') )
|| filename->getText().includes('/')
|| filename->getText().includes('~') )
{
changeDir(filename->getText().trim());
}
@ -807,8 +807,8 @@ void FFileDialog::cb_processActivate (FWidget*, data_ptr)
while ( iter != last )
{
if ( (*iter).name && input && ! input.isNull()
&& std::strcmp((*iter).name, input) == 0
&& (*iter).type == DT_DIR )
&& std::strcmp((*iter).name, input) == 0
&& (*iter).type == DT_DIR )
{
found = true;
changeDir(input);

View File

@ -180,8 +180,8 @@ void FLabel::setAccelWidget (FWidget* widget)
void FLabel::setAlignment (fc::text_alignment align)
{
if ( align != fc::alignLeft
&& align != fc::alignCenter
&& align != fc::alignRight )
&& align != fc::alignCenter
&& align != fc::alignRight )
alignment = fc::alignLeft;
else
alignment = align;
@ -513,11 +513,12 @@ void FLabel::printLine ( wchar_t*& line
if ( ! std::iswprint(wint_t(line[z])) )
{
if ( ! isNewFont() && ( int(line[z]) < fc::NF_rev_left_arrow2
|| int(line[z]) > fc::NF_check_mark ) )
|| int(line[z]) > fc::NF_check_mark ) )
{
line[z] = L' ';
}
}
if ( (z == hotkeypos) && isActive )
{
setColor (wc.label_hotkey_fg, wc.label_hotkey_bg);

View File

@ -234,8 +234,8 @@ bool FLineEdit::setFocus (bool on)
bool FLineEdit::setShadow (bool on)
{
if ( on
&& term_encoding != fc::VT100
&& term_encoding != fc::ASCII )
&& term_encoding != fc::VT100
&& term_encoding != fc::ASCII )
{
flags |= fc::shadow;
setShadowSize(1,1);
@ -364,7 +364,7 @@ void FLineEdit::onKeyPress (FKeyEvent* ev)
cursor_pos = len;
if ( cursor_pos - text_offset >= getWidth() - 2
&& text_offset <= len - getWidth() + 1 )
&& text_offset <= len - getWidth() + 1 )
text_offset++;
ev->accept();
@ -473,8 +473,8 @@ void FLineEdit::onKeyPress (FKeyEvent* ev)
// end of switch
if ( ev->isAccepted()
&& key != fc::Fkey_return
&& key != fc::Fkey_enter )
&& key != fc::Fkey_return
&& key != fc::Fkey_enter )
{
drawInputField();
updateTerminal();
@ -730,7 +730,7 @@ void FLineEdit::adjustLabel()
label_length--;
assert ( label_orientation == label_above
|| label_orientation == label_left );
|| label_orientation == label_left );
switch ( label_orientation )
{

View File

@ -580,8 +580,8 @@ void FListBox::onKeyPress (FKeyEvent* ev)
while ( iter != itemlist.end() )
{
if ( ! inc_found
&& inc_search.toLower()
== iter->getText().left(inc_len + 1).toLower() )
&& inc_search.toLower()
== iter->getText().left(inc_len + 1).toLower() )
{
setCurrentItem(iter);
inc_found = true;
@ -671,8 +671,8 @@ void FListBox::onKeyPress (FKeyEvent* ev)
while ( iter != itemlist.end() )
{
if ( ! inc_found
&& inc_search.toLower()
== iter->getText().left(inc_len).toLower() )
&& inc_search.toLower()
== iter->getText().left(inc_len).toLower() )
{
setCurrentItem(iter);
inc_found = true;
@ -734,7 +734,7 @@ void FListBox::onMouseDown (FMouseEvent* ev)
, mouse_y;
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::RightButton )
&& ev->getButton() != fc::RightButton )
{
return;
}
@ -761,7 +761,7 @@ void FListBox::onMouseDown (FMouseEvent* ev)
mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
current = yoffset + mouse_y - 1;
@ -819,7 +819,7 @@ void FListBox::onMouseUp (FMouseEvent* ev)
int mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
processChanged();
@ -838,7 +838,7 @@ void FListBox::onMouseMove (FMouseEvent* ev)
, mouse_y;
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::RightButton )
&& ev->getButton() != fc::RightButton )
{
return;
}
@ -852,7 +852,7 @@ void FListBox::onMouseMove (FMouseEvent* ev)
mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
current = yoffset + mouse_y - 1;
@ -863,8 +863,8 @@ void FListBox::onMouseMove (FMouseEvent* ev)
// handle multiple selections
if ( ev->getButton() == fc::RightButton
&& isMultiSelection()
&& current_before != current )
&& isMultiSelection()
&& current_before != current )
{
int from, to;
@ -912,7 +912,7 @@ void FListBox::onMouseMove (FMouseEvent* ev)
{
// drag up
if ( drag_scroll != fc::noScroll
&& scroll_distance < getClientHeight() )
&& scroll_distance < getClientHeight() )
scroll_distance++;
if ( ! scroll_timer && current > 1 )
@ -936,7 +936,7 @@ void FListBox::onMouseMove (FMouseEvent* ev)
{
// drag down
if ( drag_scroll != fc::noScroll
&& scroll_distance < getClientHeight() )
&& scroll_distance < getClientHeight() )
scroll_distance++;
if ( ! scroll_timer && current < int(getCount()) )
@ -978,7 +978,7 @@ void FListBox::onMouseDoubleClick (FMouseEvent* ev)
mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
if ( yoffset + mouse_y - 1 > int(getCount()) )
return;
@ -1047,7 +1047,7 @@ void FListBox::onTimer (FTimerEvent*)
// handle multiple selections
if ( drag_scroll == fc::scrollUpSelect
|| drag_scroll == fc::scrollDownSelect )
|| drag_scroll == fc::scrollDownSelect )
{
if ( isMultiSelection() && current_before != current )
{
@ -1419,8 +1419,8 @@ void FListBox::drawList()
num = getCount();
if ( last_yoffset >= 0
&& last_yoffset == yoffset
&& last_current != current )
&& last_yoffset == yoffset
&& last_current != current )
{
// speed up: redraw only the changed rows
uInt last_pos = uInt(current - yoffset) - 1;
@ -1584,7 +1584,7 @@ void FListBox::drawList()
full_length = int(getString(iter).getLength());
if ( b + i < uInt(getWidth() - nf_offset - 4 )
&& xoffset <= full_length + 1 )
&& xoffset <= full_length + 1 )
{
if ( serach_mark && i == inc_len )
setColor ( wc.current_element_focus_fg
@ -1812,7 +1812,7 @@ void FListBox::cb_VBarChange (FWidget*, data_ptr)
drawList();
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollPageForward )
&& scrollType <= FScrollbar::scrollPageForward )
{
vbar->setValue (yoffset);
@ -1913,7 +1913,7 @@ void FListBox::cb_HBarChange (FWidget*, data_ptr)
}
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollWheelDown )
&& scrollType <= FScrollbar::scrollWheelDown )
{
hbar->setValue (xoffset);

View File

@ -100,8 +100,8 @@ FListViewItem::~FListViewItem() // destructor
FString FListViewItem::getText (int column) const
{
if ( column < 1
|| column_list.empty()
|| column > int(column_list.size()) )
|| column_list.empty()
|| column > int(column_list.size()) )
return *fc::empty_string;
column--; // Convert column position to address offset (index)
@ -126,8 +126,8 @@ uInt FListViewItem::getDepth() const
void FListViewItem::setText (int column, const FString& text)
{
if ( column < 1
|| column_list.empty()
|| column > int(column_list.size()) )
|| column_list.empty()
|| column > int(column_list.size()) )
return;
FObject* parent = getParent();
@ -916,7 +916,7 @@ void FListView::onMouseDown (FMouseEvent* ev)
, mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
int new_pos = first_visible_line.getPosition() + mouse_y - 2;
@ -938,7 +938,7 @@ void FListView::onMouseDown (FMouseEvent* ev)
vbar->setValue (first_visible_line.getPosition());
if ( vbar->isVisible()
&& first_line_position_before != first_visible_line.getPosition() )
&& first_line_position_before != first_visible_line.getPosition() )
vbar->drawBar();
updateTerminal();
@ -963,7 +963,7 @@ void FListView::onMouseUp (FMouseEvent* ev)
int mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
if ( tree_view )
{
@ -1004,7 +1004,7 @@ void FListView::onMouseMove (FMouseEvent* ev)
, mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
int new_pos = first_visible_line.getPosition() + mouse_y - 2;
@ -1017,7 +1017,7 @@ void FListView::onMouseMove (FMouseEvent* ev)
vbar->setValue (first_visible_line.getPosition());
if ( vbar->isVisible()
&& first_line_position_before != first_visible_line.getPosition() )
&& first_line_position_before != first_visible_line.getPosition() )
vbar->drawBar();
updateTerminal();
@ -1029,7 +1029,7 @@ void FListView::onMouseMove (FMouseEvent* ev)
{
// drag up
if ( drag_scroll != fc::noScroll
&& scroll_distance < getClientHeight() )
&& scroll_distance < getClientHeight() )
scroll_distance++;
if ( ! scroll_timer && current_iter.getPosition() > 0 )
@ -1053,7 +1053,7 @@ void FListView::onMouseMove (FMouseEvent* ev)
{
// drag down
if ( drag_scroll != fc::noScroll
&& scroll_distance < getClientHeight() )
&& scroll_distance < getClientHeight() )
scroll_distance++;
if ( ! scroll_timer && current_iter.getPosition() <= int(getCount()) )
@ -1095,7 +1095,7 @@ void FListView::onMouseDoubleClick (FMouseEvent* ev)
mouse_y = ev->getY();
if ( mouse_x > 1 && mouse_x < getWidth()
&& mouse_y > 1 && mouse_y < getHeight() )
&& mouse_y > 1 && mouse_y < getHeight() )
{
if ( first_visible_line.getPosition() + mouse_y - 1 > int(getCount()) )
return;
@ -1164,7 +1164,8 @@ void FListView::onTimer (FTimerEvent*)
vbar->setValue (first_visible_line.getPosition());
if ( vbar->isVisible() && first_line_position_before != first_visible_line.getPosition() )
if ( vbar->isVisible()
&& first_line_position_before != first_visible_line.getPosition() )
vbar->drawBar();
updateTerminal();
@ -1496,9 +1497,9 @@ void FListView::drawColumnLabels()
uInt txt_length;
if ( header.empty()
|| getHeight() <= 2
|| getWidth() <= 4
|| max_line_width < 1 )
|| getHeight() <= 2
|| getWidth() <= 4
|| max_line_width < 1 )
return;
iter = header.begin();
@ -1825,7 +1826,7 @@ void FListView::stepForward()
void FListView::stepBackward()
{
if ( current_iter == first_visible_line
&& current_iter != itemlist.begin() )
&& current_iter != itemlist.begin() )
{
--first_visible_line;
--last_visible_line;
@ -2007,12 +2008,12 @@ void FListView::cb_VBarChange (FWidget*, data_ptr)
drawList();
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollPageForward )
&& scrollType <= FScrollbar::scrollPageForward )
{
vbar->setValue (first_visible_line.getPosition());
if ( vbar->isVisible()
&& first_line_position_before != first_visible_line.getPosition() )
&& first_line_position_before != first_visible_line.getPosition() )
vbar->drawBar();
updateTerminal();
@ -2098,7 +2099,7 @@ void FListView::cb_HBarChange (FWidget*, data_ptr)
}
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollWheelDown )
&& scrollType <= FScrollbar::scrollWheelDown )
{
hbar->setValue (xoffset);

View File

@ -331,16 +331,16 @@ void FMenu::onMouseDown (FMouseEvent* ev)
, mouse_y = mouse_pos.getY();
if ( mouse_x >= x1
&& mouse_x < x2
&& mouse_y == y )
&& mouse_x < x2
&& mouse_y == y )
{
// Mouse pointer over item
if ( hasSelectedItem() )
{
FMenuItem* sel_item = getSelectedItem();
if ( sel_item
&& sel_item->hasMenu()
&& sel_item->getMenu() == open_sub_menu )
&& sel_item->hasMenu()
&& sel_item->getMenu() == open_sub_menu )
{
if ( sel_item != *iter )
hideSubMenus();
@ -438,8 +438,8 @@ void FMenu::onMouseUp (FMouseEvent* ev)
int mouse_y = mouse_pos.getY();
if ( mouse_x >= x1
&& mouse_x < x2
&& mouse_y == y )
&& mouse_x < x2
&& mouse_y == y )
{
// Mouse pointer over item
if ( (*iter)->hasMenu() )
@ -532,8 +532,8 @@ void FMenu::onMouseMove (FMouseEvent* ev)
}
if ( getMenuBar()
&& isMenuBar(getMenuBar())
&& getMenuBar()->getTermGeometry().contains(ev->getTermPos()) )
&& isMenuBar(getMenuBar())
&& getMenuBar()->getTermGeometry().contains(ev->getTermPos()) )
{
mouse_over_menubar = true;
}
@ -547,12 +547,12 @@ void FMenu::onMouseMove (FMouseEvent* ev)
, mouse_y = mouse_pos.getY();
if ( mouse_x >= x1
&& mouse_x < x2
&& mouse_y == y )
&& mouse_x < x2
&& mouse_y == y )
{
if ( (*iter)->isEnabled()
&& ! (*iter)->isSelected()
&& ! (*iter)->isSeparator() )
&& ! (*iter)->isSelected()
&& ! (*iter)->isSeparator() )
{
// Mouse pointer over item
FWidget* focused_widget = getFocusWidget();
@ -585,9 +585,9 @@ void FMenu::onMouseMove (FMouseEvent* ev)
else
{
if ( mouse_over_menu
&& (*iter)->isEnabled()
&& (*iter)->isSelected()
&& ! mouse_over_submenu )
&& (*iter)->isEnabled()
&& (*iter)->isSelected()
&& ! mouse_over_submenu )
{
// Unselect selected item without mouse focus
(*iter)->unsetSelected();
@ -743,8 +743,8 @@ void FMenu::cb_menuitem_toggled (FWidget* widget, data_ptr)
while ( iter != last )
{
if ( (*iter) != menuitem
&& (*iter)->isChecked()
&& isRadioMenuItem(*iter) )
&& (*iter)->isChecked()
&& isRadioMenuItem(*iter) )
{
(*iter)->unsetChecked();
}
@ -1067,10 +1067,10 @@ bool FMenu::selectNextItem()
next_element = item_list.begin();
next = static_cast<FMenuItem*>(*next_element);
}
while ( ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
|| next->isSeparator() );
while ( ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
|| next->isSeparator() );
if ( next == *iter )
return false;
@ -1119,10 +1119,10 @@ bool FMenu::selectPrevItem()
--prev_element;
prev = static_cast<FMenuItem*>(*prev_element);
}
while ( ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| prev->isSeparator() );
while ( ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| prev->isSeparator() );
if ( prev == *iter )
return false;
@ -1406,9 +1406,9 @@ void FMenu::drawItems()
if ( ! std::iswprint(wint_t(item_text[z])) )
{
if ( ! isNewFont()
&& ( int(item_text[z]) < fc::NF_rev_left_arrow2
|| int(item_text[z]) > fc::NF_check_mark )
&& ! charEncodable(uInt(item_text[z])) )
&& ( int(item_text[z]) < fc::NF_rev_left_arrow2
|| int(item_text[z]) > fc::NF_check_mark )
&& ! charEncodable(uInt(item_text[z])) )
{
item_text[z] = L' ';
}

View File

@ -129,7 +129,7 @@ void FMenuBar::onKeyPress (FKeyEvent* ev)
drop_down = true;
}
else if ( ev->key() == fc::Fkey_return
|| ev->key() == fc::Fkey_enter )
|| ev->key() == fc::Fkey_enter )
{
unselectItem();
redraw();
@ -377,8 +377,8 @@ void FMenuBar::onMouseMove (FMouseEvent* ev)
x2 = (*iter)->getX() + (*iter)->getWidth();
if ( mouse_x >= x1
&& mouse_x < x2
&& mouse_y == 1 )
&& mouse_x < x2
&& mouse_y == 1 )
{
// Mouse pointer over item
if ( (*iter)->isEnabled() && ! (*iter)->isSelected() )
@ -414,8 +414,8 @@ void FMenuBar::onMouseMove (FMouseEvent* ev)
else
{
if ( mouse_over_menubar
&& (*iter)->isEnabled()
&& (*iter)->isSelected() )
&& (*iter)->isEnabled()
&& (*iter)->isSelected() )
{
// Unselect selected item without mouse focus
(*iter)->unsetSelected();
@ -433,7 +433,7 @@ void FMenuBar::onMouseMove (FMouseEvent* ev)
const FRect& menu_geometry = menu->getTermGeometry();
if ( menu->getCount() > 0
&& menu_geometry.contains(ev->getTermPos()) )
&& menu_geometry.contains(ev->getTermPos()) )
{
const FPoint& t = ev->getTermPos();
const FPoint& p = menu->termToWidgetPos(t);
@ -572,9 +572,9 @@ bool FMenuBar::selectNextItem()
next = static_cast<FMenuItem*>(*next_element);
} while ( ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
|| next->isSeparator() );
|| ! next->acceptFocus()
|| ! next->isVisible()
|| next->isSeparator() );
if ( next == *iter )
return false;
@ -639,9 +639,9 @@ bool FMenuBar::selectPrevItem()
prev = static_cast<FMenuItem*>(*prev_element);
}
while ( ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| prev->isSeparator() );
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| prev->isSeparator() );
if ( prev == *iter )
return false;
@ -879,8 +879,8 @@ void FMenuBar::drawItems()
if ( ! std::iswprint(wint_t(item_text[z])) )
{
if ( ! isNewFont()
&& ( int(item_text[z]) < fc::NF_rev_left_arrow2
|| int(item_text[z]) > fc::NF_check_mark ) )
&& ( int(item_text[z]) < fc::NF_rev_left_arrow2
|| int(item_text[z]) > fc::NF_check_mark ) )
{
item_text[z] = L' ';
}

View File

@ -248,8 +248,8 @@ void FMenuItem::delAccelerator (FWidget* obj)
FWidget* root = getRootWidget();
if ( root
&& root->accelerator_list
&& ! root->accelerator_list->empty() )
&& root->accelerator_list
&& ! root->accelerator_list->empty() )
{
FWidget::Accelerators::iterator iter;
iter = root->accelerator_list->begin();

View File

@ -1184,8 +1184,8 @@ inline bool FOptiAttr::colorChange (char_data*& term, char_data*& next)
if ( term && next )
{
return bool ( fake_reverse
|| term->fg_color != next->fg_color
|| term->bg_color != next->bg_color );
|| term->fg_color != next->fg_color
|| term->bg_color != next->bg_color );
}
return false;
@ -1320,7 +1320,7 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next)
if ( ansi_default_color )
{
if ( fg == Default && term->fg_color != Default
&& bg == Default && term->bg_color != Default )
&& bg == Default && term->bg_color != Default )
{
setTermDefaultColor(term);
}
@ -1369,21 +1369,21 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next)
short ansi_bg = vga2ansi(bg);
if ( term->fg_color != fg
&& (color_str = tparm(AF, ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0)) )
&& (color_str = tparm(AF, ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0)) )
append_sequence (color_str);
if ( term->bg_color != bg
&& (color_str = tparm(AB, ansi_bg, 0, 0, 0, 0, 0, 0, 0, 0)) )
&& (color_str = tparm(AB, ansi_bg, 0, 0, 0, 0, 0, 0, 0, 0)) )
append_sequence (color_str);
}
else if ( Sf && Sb )
{
if ( term->fg_color != fg
&& (color_str = tparm(Sf, fg, 0, 0, 0, 0, 0, 0, 0, 0)) )
&& (color_str = tparm(Sf, fg, 0, 0, 0, 0, 0, 0, 0, 0)) )
append_sequence (color_str);
if ( term->bg_color != bg
&& (color_str = tparm(Sb, bg, 0, 0, 0, 0, 0, 0, 0, 0)) )
&& (color_str = tparm(Sb, bg, 0, 0, 0, 0, 0, 0, 0, 0)) )
append_sequence (color_str);
}
else if ( sp )

View File

@ -495,8 +495,8 @@ char* FOptiMove::moveCursor (int xold, int yold, int xnew, int ynew)
if ( isMethod0Faster(move_time, xnew, ynew) )
{
if ( xold < 0
|| yold < 0
|| isWideMove (xold, yold, xnew, ynew) )
|| yold < 0
|| isWideMove (xold, yold, xnew, ynew) )
{
return ( move_time < LONG_DURATION ) ? move_buf : 0;
}
@ -878,9 +878,9 @@ inline bool FOptiMove::isWideMove ( int xold, int yold
, int xnew, int ynew )
{
return bool ( xnew > MOVE_LIMIT
&& xnew < screen_width - 1 - MOVE_LIMIT
&& std::abs(xnew - xold) + std::abs(ynew - yold)
> MOVE_LIMIT );
&& xnew < screen_width - 1 - MOVE_LIMIT
&& std::abs(xnew - xold) + std::abs(ynew - yold)
> MOVE_LIMIT );
}
//----------------------------------------------------------------------
@ -938,7 +938,7 @@ inline bool FOptiMove::isMethod2Faster ( int& move_time
int new_time = relativeMove (null_ptr, 0, yold, xnew, ynew);
if ( new_time < LONG_DURATION
&& F_carriage_return.duration + new_time < move_time )
&& F_carriage_return.duration + new_time < move_time )
{
move_time = F_carriage_return.duration + new_time;
return true;
@ -961,7 +961,7 @@ inline bool FOptiMove::isMethod3Faster ( int& move_time
int new_time = relativeMove (null_ptr, 0, 0, xnew, ynew);
if ( new_time < LONG_DURATION
&& F_cursor_home.duration + new_time < move_time )
&& F_cursor_home.duration + new_time < move_time )
{
move_time = F_cursor_home.duration + new_time;
return true;
@ -985,7 +985,7 @@ inline bool FOptiMove::isMethod4Faster ( int& move_time
, xnew, ynew );
if ( new_time < LONG_DURATION
&& F_cursor_to_ll.duration + new_time < move_time )
&& F_cursor_to_ll.duration + new_time < move_time )
{
move_time = F_cursor_to_ll.duration + new_time;
return true;
@ -1002,9 +1002,9 @@ inline bool FOptiMove::isMethod5Faster ( int& move_time
{
// Test method 5: left margin for wrap to right-hand side
if ( automatic_left_margin
&& ! eat_nl_glitch
&& yold > 0
&& F_cursor_left.cap )
&& ! eat_nl_glitch
&& yold > 0
&& F_cursor_left.cap )
{
char null_result[sizeof(move_buf)];
char* null_ptr = null_result;
@ -1013,9 +1013,9 @@ inline bool FOptiMove::isMethod5Faster ( int& move_time
, xnew, ynew );
if ( new_time < LONG_DURATION
&& F_carriage_return.cap
&& F_carriage_return.duration
+ F_cursor_left.duration + new_time < move_time )
&& F_carriage_return.cap
&& F_carriage_return.duration
+ F_cursor_left.duration + new_time < move_time )
{
move_time = F_carriage_return.duration
+ F_cursor_left.duration + new_time;

View File

@ -79,8 +79,8 @@ void FProgressbar::setGeometry (int x, int y, int w, int h, bool adjust)
bool FProgressbar::setShadow (bool on)
{
if ( on
&& term_encoding != fc::VT100
&& term_encoding != fc::ASCII )
&& term_encoding != fc::VT100
&& term_encoding != fc::ASCII )
{
flags |= fc::shadow;
setShadowSize(1,1);
@ -219,8 +219,7 @@ void FProgressbar::drawBar()
if ( percentage > 0.0f && trunc(length) < bar_length )
{
if ( round(length) > trunc(length)
|| getMaxColor() < 16 )
if ( round(length) > trunc(length) || getMaxColor() < 16 )
{
if ( isMonochron() )
{

View File

@ -203,7 +203,7 @@ bool FRect::contains (const FRect& r) const
bool FRect::overlap (const FRect &r) const
{
return ( std::max(X1, r.X1) <= std::min(X2, r.X2)
&& std::max(Y1, r.Y1) <= std::min(Y2, r.Y2) );
&& std::max(Y1, r.Y1) <= std::min(Y2, r.Y2) );
}
//----------------------------------------------------------------------

View File

@ -416,7 +416,7 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
int mouse_x, mouse_y;
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::MiddleButton )
&& ev->getButton() != fc::MiddleButton )
return;
if ( min == max )
@ -439,7 +439,7 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
if ( bar_orientation == fc::vertical )
{
if ( mouse_y > slider_pos + 1
&& mouse_y <= slider_pos + slider_length + 1 )
&& mouse_y <= slider_pos + slider_length + 1 )
slider_click_pos = mouse_y; // on slider
}
else // horizontal
@ -447,13 +447,13 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
if ( isNewFont() )
{
if ( mouse_x > slider_pos + 2
&& mouse_x <= slider_pos + slider_length + 2 )
&& mouse_x <= slider_pos + slider_length + 2 )
slider_click_pos = mouse_x; // on slider
}
else
{
if ( mouse_x > slider_pos + 1
&& mouse_x <= slider_pos + slider_length + 1 )
&& mouse_x <= slider_pos + slider_length + 1 )
slider_click_pos = mouse_x; // on slider
}
}
@ -463,7 +463,7 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
}
if ( scroll_type == FScrollbar::scrollPageBackward
|| scroll_type == FScrollbar::scrollPageForward )
|| scroll_type == FScrollbar::scrollPageForward )
{
if ( bar_orientation == fc::vertical )
slider_click_stop_pos = mouse_y - 2;
@ -477,7 +477,7 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
slider_click_stop_pos = -1;
if ( scroll_type >= FScrollbar::scrollStepBackward
&& scroll_type <= FScrollbar::scrollPageForward )
&& scroll_type <= FScrollbar::scrollPageForward )
{
processScroll();
threshold_reached = false;
@ -489,7 +489,7 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
void FScrollbar::onMouseUp (FMouseEvent* ev)
{
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::MiddleButton )
&& ev->getButton() != fc::MiddleButton )
return;
slider_click_pos = -1;
@ -507,7 +507,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev)
int mouse_x, mouse_y, new_scroll_type;
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::MiddleButton )
&& ev->getButton() != fc::MiddleButton )
return;
mouse_x = ev->getX();
@ -551,7 +551,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev)
}
if ( mouse_x < 1 || mouse_x > getWidth()
|| mouse_y < 1 || mouse_y > getHeight() )
|| mouse_y < 1 || mouse_y > getHeight() )
{
delOwnTimer();
}
@ -599,13 +599,13 @@ void FScrollbar::onTimer (FTimerEvent*)
}
if ( ( scroll_type == FScrollbar::scrollPageBackward
&& slider_pos < slider_click_stop_pos )
|| ( scroll_type == FScrollbar::scrollPageForward
&& slider_pos + slider_length > slider_click_stop_pos ) )
&& slider_pos < slider_click_stop_pos )
|| ( scroll_type == FScrollbar::scrollPageForward
&& slider_pos + slider_length > slider_click_stop_pos ) )
{
// Scroll to the end
if ( scroll_type == FScrollbar::scrollPageForward
&& slider_pos + slider_length > slider_click_stop_pos )
&& slider_pos + slider_length > slider_click_stop_pos )
{
setValue(max);
processScroll();
@ -724,7 +724,7 @@ void FScrollbar::processMiddleButton (int x, int y)
if ( y >1 && y < getHeight() )
{
new_val = int( round ( double(max - min) * (y - 2.0 - (slider_length/2))
/ double(bar_length - slider_length) ) );
/ double(bar_length - slider_length) ) );
}
else
return;
@ -736,7 +736,7 @@ void FScrollbar::processMiddleButton (int x, int y)
if ( x > 1 + nf && x < getWidth() - nf )
{
new_val = int( round ( double(max - min) * (x - 2.0 - nf - (slider_length/2))
/ double(bar_length - slider_length) ) );
/ double(bar_length - slider_length) ) );
}
else
return;

View File

@ -240,7 +240,7 @@ void FScrollView::setSize (int w, int h, bool adjust)
calculateScrollbarPos();
if ( getScrollWidth() < getViewportWidth()
|| getScrollHeight() < getViewportHeight() )
|| getScrollHeight() < getViewportHeight() )
setScrollSize (getViewportWidth(), getViewportHeight());
}
@ -257,7 +257,7 @@ void FScrollView::setGeometry (int x, int y, int w, int h, bool adjust)
calculateScrollbarPos();
if ( getScrollWidth() < getViewportWidth()
|| getScrollHeight() < getViewportHeight() )
|| getScrollHeight() < getViewportHeight() )
{
setScrollSize (getViewportWidth(), getViewportHeight());
}
@ -486,7 +486,7 @@ void FScrollView::onKeyPress (FKeyEvent* ev)
bool hasChanges = false;
if ( isVisible() && viewport
&& (xoffset_before != xoffset || yoffset_before != yoffset) )
&& (xoffset_before != xoffset || yoffset_before != yoffset) )
{
viewport_geometry.setWidth(save_width);
viewport_geometry.setHeight(save_height);
@ -933,7 +933,7 @@ void FScrollView::setViewportCursor()
print_area->input_cursor_y = window_cursor_pos.getY();
if ( viewport->input_cursor_visible
&& viewport_geometry.contains(cursor_pos) )
&& viewport_geometry.contains(cursor_pos) )
print_area->input_cursor_visible = true;
else
print_area->input_cursor_visible = false;
@ -1033,8 +1033,8 @@ void FScrollView::cb_VBarChange (FWidget*, data_ptr)
}
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollWheelDown
&& hasChanges )
&& scrollType <= FScrollbar::scrollWheelDown
&& hasChanges )
{
vbar->setValue (yoffset);
drawVBar();
@ -1138,8 +1138,8 @@ void FScrollView::cb_HBarChange (FWidget*, data_ptr)
}
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollWheelDown
&& hasChanges )
&& scrollType <= FScrollbar::scrollWheelDown
&& hasChanges )
{
hbar->setValue (xoffset);
drawHBar();

View File

@ -243,7 +243,7 @@ void FStatusBar::drawMessage()
{
std::vector<FStatusKey*>::const_iterator iter = key_list.end();
isLastActiveFocus = bool ( (*(iter - 1))->isActivated()
|| (*(iter - 1))->hasMouseFocus() );
|| (*(iter - 1))->hasMouseFocus() );
}
else
isLastActiveFocus = false;
@ -404,9 +404,9 @@ void FStatusBar::onMouseDown (FMouseEvent* ev)
, mouse_y = ev->getY();
if ( mouse_x >= x1
&& mouse_x <= x2
&& mouse_y == 1
&& ! (*iter)->hasMouseFocus() )
&& mouse_x <= x2
&& mouse_y == 1
&& ! (*iter)->hasMouseFocus() )
{
(*iter)->setMouseFocus();
redraw();
@ -494,8 +494,8 @@ void FStatusBar::onMouseMove (FMouseEvent* ev)
, mouse_y = ev->getY();
if ( mouse_x >= x1
&& mouse_x <= x2
&& mouse_y == 1 )
&& mouse_x <= x2
&& mouse_y == 1 )
{
if ( ! (*iter)->hasMouseFocus() )
{
@ -663,9 +663,9 @@ void FStatusBar::drawKeys()
}
if ( iter + 1 != key_list.end()
&& ( (*(iter + 1))->isActivated() || (*(iter + 1))->hasMouseFocus() )
&& x + int(getKeyName((*(iter + 1))->getKey()).getLength()) + 3
< screenWidth )
&& ( (*(iter + 1))->isActivated() || (*(iter + 1))->hasMouseFocus() )
&& x + int(getKeyName((*(iter + 1))->getKey()).getLength()) + 3
< screenWidth )
{
// next element is active
if ( isMonochron() )

View File

@ -918,7 +918,7 @@ long FString::toLong() const
register uChar d = uChar((*p) - L'0');
if ( num > tenth_limit
|| (num == tenth_limit && d > tenth_limit_digit) )
|| (num == tenth_limit && d > tenth_limit_digit) )
{
throw std::overflow_error ("overflow");
}
@ -967,7 +967,7 @@ uLong FString::toULong() const
register uChar d = uChar((*p) - L'0');
if ( num > tenth_limit
|| (num == tenth_limit && d > tenth_limit_digit) )
|| (num == tenth_limit && d > tenth_limit_digit) )
{
throw std::overflow_error ("overflow");
}

View File

@ -472,13 +472,13 @@ int FTerm::parseKeyString ( char buffer[]
// SGR mouse tracking
if ( buffer[1] == '[' && buffer[2] == '<' && buf_len >= 9
&& (buffer[buf_len - 1] == 'M' || buffer[buf_len - 1] == 'm') )
&& (buffer[buf_len - 1] == 'M' || buffer[buf_len - 1] == 'm') )
return fc::Fkey_extended_mouse;
// urxvt mouse tracking
if ( buffer[1] == '[' && buffer[2] >= '1' && buffer[2] <= '9'
&& buffer[3] >= '0' && buffer[3] <= '9' && buf_len >= 9
&& buffer[buf_len - 1] == 'M' )
&& buffer[3] >= '0' && buffer[3] <= '9' && buf_len >= 9
&& buffer[buf_len - 1] == 'M' )
return fc::Fkey_urxvt_mouse;
// look for termcap keys
@ -511,8 +511,8 @@ int FTerm::parseKeyString ( char buffer[]
if ( std::strncmp(kmeta, buffer, uInt(len)) == 0 ) // found
{
if ( len == 2 && ( buffer[1] == 'O'
|| buffer[1] == '['
|| buffer[1] == ']' ) )
|| buffer[1] == '['
|| buffer[1] == ']' ) )
{
if ( ! isKeyTimeout(time_keypressed, key_timeout) )
return NEED_MORE_DATA;
@ -586,11 +586,11 @@ bool FTerm::setVGAFont()
return VGAFont;
if ( gnome_terminal
|| kde_konsole
|| putty_terminal
|| tera_terminal
|| cygwin_terminal
|| mintty_terminal )
|| kde_konsole
|| putty_terminal
|| tera_terminal
|| cygwin_terminal
|| mintty_terminal )
return false;
VGAFont = true;
@ -658,15 +658,15 @@ bool FTerm::setNewFont()
return true;
if ( gnome_terminal
|| kde_konsole
|| putty_terminal
|| tera_terminal
|| cygwin_terminal
|| mintty_terminal )
|| kde_konsole
|| putty_terminal
|| tera_terminal
|| cygwin_terminal
|| mintty_terminal )
return false;
if ( xterm_terminal || screen_terminal
|| urxvt_terminal || FTermcap::osc_support )
|| urxvt_terminal || FTermcap::osc_support )
{
NewFont = true;
// Set font in xterm to 8x16graph
@ -735,7 +735,7 @@ bool FTerm::setOldFont()
VGAFont = false;
if ( xterm_terminal || screen_terminal
|| urxvt_terminal || FTermcap::osc_support )
|| urxvt_terminal || FTermcap::osc_support )
{
if ( xterm_font && xterm_font->getLength() > 2 )
{
@ -1066,8 +1066,8 @@ void FTerm::setXTermTitle (const FString& title)
{
// Set the xterm title
if ( xterm_terminal || screen_terminal
|| mintty_terminal || putty_terminal
|| FTermcap::osc_support )
|| mintty_terminal || putty_terminal
|| FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "0;%s" BEL, title.c_str());
@ -1081,8 +1081,8 @@ void FTerm::setXTermForeground (const FString& fg)
{
// Set the VT100 text foreground color
if ( xterm_terminal || screen_terminal
|| mintty_terminal || mlterm_terminal
|| FTermcap::osc_support )
|| mintty_terminal || mlterm_terminal
|| FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "10;%s" BEL, fg.c_str());
@ -1096,8 +1096,8 @@ void FTerm::setXTermBackground (const FString& bg)
{
// Set the VT100 text background color
if ( xterm_terminal || screen_terminal
|| mintty_terminal || mlterm_terminal
|| FTermcap::osc_support )
|| mintty_terminal || mlterm_terminal
|| FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "11;%s" BEL, bg.c_str());
@ -1111,8 +1111,8 @@ void FTerm::setXTermCursorColor (const FString& cc)
{
// Set the text cursor color
if ( xterm_terminal || screen_terminal
|| mintty_terminal || urxvt_terminal
|| FTermcap::osc_support )
|| mintty_terminal || urxvt_terminal
|| FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "12;%s" BEL, cc.c_str());
@ -1126,7 +1126,7 @@ void FTerm::setXTermMouseForeground (const FString& mfg)
{
// Set the mouse foreground color
if ( xterm_terminal || screen_terminal
|| urxvt_terminal || FTermcap::osc_support )
|| urxvt_terminal || FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "13;%s" BEL, mfg.c_str());
@ -1153,7 +1153,7 @@ void FTerm::setXTermHighlightBackground (const FString& hbg)
{
// Set the highlight background color
if ( xterm_terminal || screen_terminal
|| urxvt_terminal || FTermcap::osc_support )
|| urxvt_terminal || FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "17;%s" BEL, hbg.c_str());
@ -1175,7 +1175,7 @@ void FTerm::setXTermDefaults()
setXTermCursorColor("rgb:ffff/ffff/ffff");
if ( xterm_default_colors
&& ! (mintty_terminal || rxvt_terminal || screen_terminal) )
&& ! (mintty_terminal || rxvt_terminal || screen_terminal) )
{
// mintty and rxvt can't reset these settings
setXTermBackground("rgb:8080/a4a4/ecec");
@ -1295,7 +1295,7 @@ void FTerm::resetXTermHighlightBackground()
return;
if ( xterm_terminal || screen_terminal
|| urxvt_terminal || FTermcap::osc_support )
|| urxvt_terminal || FTermcap::osc_support )
{
oscPrefix();
putstringf (OSC "117" BEL);
@ -1393,8 +1393,8 @@ void FTerm::setPalette (short index, int r, int g, int b)
{
/* // direct vga-register set
if ( r>=0 && r<256
&& g>=0 && g<256
&& b>=0 && b<256 )
&& g>=0 && g<256
&& b>=0 && b<256 )
{
map.d[index].red = r;
map.d[index].green = g;
@ -1458,9 +1458,9 @@ void FTerm::setEncoding (fc::encoding enc)
term_encoding = enc;
assert ( term_encoding == fc::UTF8
|| term_encoding == fc::VT100
|| term_encoding == fc::PC
|| term_encoding == fc::ASCII );
|| term_encoding == fc::VT100
|| term_encoding == fc::PC
|| term_encoding == fc::ASCII );
// set the new Fputchar function pointer
switch ( term_encoding )
@ -1740,8 +1740,8 @@ void FTerm::initLinuxConsoleCharMap()
c3 = fc::FullBlock;
if ( charEncode(c1, fc::PC) == charEncode(c1, fc::ASCII)
|| charEncode(c2, fc::PC) == charEncode(c2, fc::ASCII)
|| charEncode(c3, fc::PC) == charEncode(c3, fc::ASCII) )
|| charEncode(c2, fc::PC) == charEncode(c2, fc::ASCII)
|| charEncode(c3, fc::PC) == charEncode(c3, fc::ASCII) )
{
no_shadow_character = true;
}
@ -1750,7 +1750,7 @@ void FTerm::initLinuxConsoleCharMap()
c5 = fc::LeftHalfBlock;
if ( charEncode(c4, fc::PC) == charEncode(c4, fc::ASCII)
|| charEncode(c5, fc::PC) == charEncode(c5, fc::ASCII) )
|| charEncode(c5, fc::PC) == charEncode(c5, fc::ASCII) )
{
no_half_block_character = true;
}
@ -1923,8 +1923,8 @@ int FTerm::isLinuxConsole()
char arg = 0;
// get keyboard type an compare
return ( isatty (fd_tty)
&& ioctl(fd_tty, KDGKBTYPE, &arg) == 0
&& ((arg == KB_101) || (arg == KB_84)) );
&& ioctl(fd_tty, KDGKBTYPE, &arg) == 0
&& ((arg == KB_101) || (arg == KB_84)) );
}
#endif
@ -2081,7 +2081,7 @@ int FTerm::getFramebuffer_bpp ()
}
if ( ! ioctl(fd, FBIOGET_VSCREENINFO, &fb_var)
&& ! ioctl(fd, FBIOGET_FSCREENINFO, &fb_fix) )
&& ! ioctl(fd, FBIOGET_FSCREENINFO, &fb_fix) )
{
::close(fd);
return int(fb_var.bits_per_pixel);
@ -2713,9 +2713,9 @@ void FTerm::detectTerminal()
new_termtype = determineMaxColor(new_termtype);
if ( cygwin_terminal
|| putty_terminal
|| tera_terminal
|| rxvt_terminal )
|| putty_terminal
|| tera_terminal
|| rxvt_terminal )
{
FTermcap::max_color = 16;
}
@ -2730,7 +2730,7 @@ void FTerm::detectTerminal()
// Test if the terminal is a xterm
if ( std::strncmp(termtype, const_cast<char*>("xterm"), 5) == 0
|| std::strncmp(termtype, const_cast<char*>("Eterm"), 5) == 0 )
|| std::strncmp(termtype, const_cast<char*>("Eterm"), 5) == 0 )
{
xterm_terminal = true;
@ -2771,7 +2771,7 @@ void FTerm::termtypeAnalysis()
// Linux console
if ( std::strncmp(termtype, const_cast<char*>("linux"), 5) == 0
|| std::strncmp(termtype, const_cast<char*>("con"), 3) == 0 )
|| std::strncmp(termtype, const_cast<char*>("con"), 3) == 0 )
linux_terminal = true;
else
linux_terminal = false;
@ -2841,8 +2841,8 @@ char* FTerm::init_256colorTerminal()
}
if ( std::strncmp(termtype, "rxvt", 4) != 0
&& s1
&& std::strncmp(s1, "rxvt-xpm", 8) == 0 )
&& s1
&& std::strncmp(s1, "rxvt-xpm", 8) == 0 )
{
new_termtype = const_cast<char*>("rxvt-256color");
rxvt_terminal = true;
@ -2885,11 +2885,11 @@ char* FTerm::determineMaxColor (char*& current_termtype)
char* new_termtype = current_termtype;
if ( ! color256
&& ! cygwin_terminal
&& ! tera_terminal
&& ! linux_terminal
&& ! netbsd_terminal
&& ! getXTermColorName(0).isEmpty() )
&& ! cygwin_terminal
&& ! tera_terminal
&& ! linux_terminal
&& ! netbsd_terminal
&& ! getXTermColorName(0).isEmpty() )
{
if ( ! getXTermColorName(256).isEmpty() )
{
@ -3098,7 +3098,7 @@ char* FTerm::parseSecDA (char*& current_termtype)
force_vt100 = true; // this rxvt terminal support on utf-8
if ( std::strncmp(termtype, "rxvt-", 5) != 0
&& std::strncmp(termtype, "rxvt-cygwin-native", 18) == 0 )
&& std::strncmp(termtype, "rxvt-cygwin-native", 18) == 0 )
new_termtype = const_cast<char*>("rxvt-16color");
break;
@ -3270,9 +3270,9 @@ void FTerm::init_cygwin_charmap()
for (int i = 0; i <= lastCharItem; i++ )
{
if ( character[i][fc::UTF8] == fc::BlackUpPointingTriangle // ▲
|| character[i][fc::UTF8] == fc::BlackDownPointingTriangle // ▼
|| character[i][fc::UTF8] == fc::SquareRoot ) // SquareRoot √
if ( character[i][fc::UTF8] == fc::BlackUpPointingTriangle // ▲
|| character[i][fc::UTF8] == fc::BlackDownPointingTriangle // ▼
|| character[i][fc::UTF8] == fc::SquareRoot ) // SquareRoot √
character[i][fc::PC] = character[i][fc::ASCII];
}
}
@ -3823,7 +3823,7 @@ void FTerm::init_termcaps_general_quirks()
// Test for standard ECMA-48 (ANSI X3.64) terminal
if ( TCAP(fc::t_exit_underline_mode)
&& std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) == 0 )
&& std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) == 0 )
{
// Seems to be a ECMA-48 (ANSI X3.64) compatible terminal
TCAP(fc::t_enter_dbl_underline_mode) = \
@ -3897,8 +3897,8 @@ void FTerm::init_termcaps_keys (char*& buffer)
char* key_up_string = tgetstr(const_cast<char*>("ku"), &buffer);
if ( (key_up_string && (std::strcmp(key_up_string, CSI "A") == 0))
|| ( TCAP(fc::t_cursor_up)
&& (std::strcmp(TCAP(fc::t_cursor_up), CSI "A") == 0) ) )
|| ( TCAP(fc::t_cursor_up)
&& (std::strcmp(TCAP(fc::t_cursor_up), CSI "A") == 0) ) )
{
for (int i = 0; Fkey[i].tname[0] != 0; i++)
{
@ -4087,7 +4087,7 @@ void FTerm::init_encoding()
(*encoding_set)["ASCII"] = fc::ASCII;
if ( isatty(stdout_no)
&& ! std::strcmp(nl_langinfo(CODESET), "UTF-8") )
&& ! std::strcmp(nl_langinfo(CODESET), "UTF-8") )
{
utf8_console = true;
term_encoding = fc::UTF8;
@ -4097,8 +4097,8 @@ void FTerm::init_encoding()
setUTF8(true);
}
else if ( isatty(stdout_no)
&& (std::strlen(termtype) > 0)
&& (TCAP(fc::t_exit_alt_charset_mode) != 0) )
&& (std::strlen(termtype) > 0)
&& (TCAP(fc::t_exit_alt_charset_mode) != 0) )
{
vt100_console = true;
term_encoding = fc::VT100;
@ -4114,10 +4114,10 @@ void FTerm::init_encoding()
init_pc_charset();
if ( linux_terminal
|| cygwin_terminal
|| NewFont
|| (putty_terminal && ! utf8_state)
|| (tera_terminal && ! utf8_state) )
|| cygwin_terminal
|| NewFont
|| (putty_terminal && ! utf8_state)
|| (tera_terminal && ! utf8_state) )
{
pc_charset_console = true;
term_encoding = fc::PC;
@ -4155,9 +4155,9 @@ void FTerm::init_encoding()
void FTerm::redefineColorPalette()
{
if ( ! cygwin_terminal
&& ! kde_konsole
&& ! tera_terminal
&& ! ansi_terminal )
&& ! kde_konsole
&& ! tera_terminal
&& ! ansi_terminal )
{
resetColorMap();
saveColorMap();

View File

@ -452,8 +452,8 @@ void FTextView::onMouseDown (FMouseEvent* ev)
dialog = static_cast<FDialog*>(parent);
if ( parent->isDialogWidget()
&& dialog->isResizeable()
&& ! dialog->isZoomed() )
&& dialog->isResizeable()
&& ! dialog->isZoomed() )
{
int b = ev->getButton();
const FPoint& tp = ev->getTermPos();
@ -716,12 +716,12 @@ void FTextView::draw()
setReverse(true);
if ( parent
&& parent->isDialogWidget()
&& isPaddingIgnored()
&& getGeometry() == FRect ( 1
, 2
, parent->getWidth()
, parent->getHeight() - 1) )
&& parent->isDialogWidget()
&& isPaddingIgnored()
&& getGeometry() == FRect ( 1
, 2
, parent->getWidth()
, parent->getHeight() - 1) )
{
is_text_dialog = true;
}
@ -795,7 +795,7 @@ void FTextView::drawText()
// only printable and 1 column per character
if ( ( (utf8 && std::iswprint(wint_t(ch)))
|| (!utf8 && ch < 256 && std::isprint(ch)) )
|| (!utf8 && ch < 256 && std::isprint(ch)) )
&& wcwidth(ch) == 1 )
{
print (ch);
@ -898,7 +898,7 @@ void FTextView::cb_VBarChange (FWidget*, data_ptr)
}
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollPageForward )
&& scrollType <= FScrollbar::scrollPageForward )
{
vbar->setValue (yoffset);
@ -996,7 +996,7 @@ void FTextView::cb_HBarChange (FWidget*, data_ptr)
}
if ( scrollType >= FScrollbar::scrollStepBackward
&& scrollType <= FScrollbar::scrollWheelDown )
&& scrollType <= FScrollbar::scrollWheelDown )
{
hbar->setValue (xoffset);

View File

@ -398,14 +398,14 @@ void FToggleButton::onFocusOut (FFocusEvent* out_ev)
redraw();
}
else if ( this == getGroup()->getLastButton()
&& out_ev->getFocusType() == fc::FocusNextWidget )
&& out_ev->getFocusType() == fc::FocusNextWidget )
{
out_ev->ignore();
getGroup()->focusNextChild();
redraw();
}
else if ( this == getGroup()->getFirstButton()
&& out_ev->getFocusType() == fc::FocusPreviousWidget )
&& out_ev->getFocusType() == fc::FocusPreviousWidget )
{
out_ev->ignore();
getGroup()->focusPrevChild();

View File

@ -244,7 +244,7 @@ void FVTerm::updateTerminal()
// Updates pending changes to the terminal
if ( stop_terminal_updates
|| static_cast<FApplication*>(init_object)->isQuit() )
|| static_cast<FApplication*>(init_object)->isQuit() )
return;
if ( ! force_terminal_update )
@ -638,9 +638,9 @@ int FVTerm::print (term_area* area, char_data& term_char)
ay = area->cursor_y - 1;
if ( area->cursor_x > 0
&& area->cursor_y > 0
&& ax < area->width + area->right_shadow
&& ay < area->height + area->bottom_shadow )
&& area->cursor_y > 0
&& ax < area->width + area->right_shadow
&& ay < area->height + area->bottom_shadow )
{
char_data* ac; // area character
int line_len = area->width + area->right_shadow;
@ -648,17 +648,17 @@ int FVTerm::print (term_area* area, char_data& term_char)
if ( *ac != nc ) // compare with an overloaded operator
{
if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->attr.bit.trans_shadow && nc.attr.bit.trans_shadow )
|| ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
if ( ( ! ac->attr.bit.transparent && nc.attr.bit.transparent )
|| ( ! ac->attr.bit.trans_shadow && nc.attr.bit.trans_shadow )
|| ( ! ac->attr.bit.inherit_bg && nc.attr.bit.inherit_bg ) )
{
// add one transparent character form line
area->changes[ay].trans_count++;
}
if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->attr.bit.trans_shadow && ! nc.attr.bit.trans_shadow )
|| ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
if ( ( ac->attr.bit.transparent && ! nc.attr.bit.transparent )
|| ( ac->attr.bit.trans_shadow && ! nc.attr.bit.trans_shadow )
|| ( ac->attr.bit.inherit_bg && ! nc.attr.bit.inherit_bg ) )
{
// remove one transparent character from line
area->changes[ay].trans_count--;
@ -830,9 +830,9 @@ void FVTerm::resizeArea ( int offset_left, int offset_top
return;
if ( width == area->width
&& height == area->height
&& rsw == area->right_shadow
&& bsh == area->bottom_shadow )
&& height == area->height
&& rsw == area->right_shadow
&& bsh == area->bottom_shadow )
{
if ( offset_left != area->offset_left )
area->offset_left = offset_left;
@ -1023,11 +1023,11 @@ void FVTerm::restoreVTerm (int x, int y, int w, int h)
s_ch.attr.bit.standout = false;
if ( s_ch.code == fc::LowerHalfBlock
|| s_ch.code == fc::UpperHalfBlock
|| s_ch.code == fc::LeftHalfBlock
|| s_ch.code == fc::RightHalfBlock
|| s_ch.code == fc::MediumShade
|| s_ch.code == fc::FullBlock )
|| s_ch.code == fc::UpperHalfBlock
|| s_ch.code == fc::LeftHalfBlock
|| s_ch.code == fc::RightHalfBlock
|| s_ch.code == fc::MediumShade
|| s_ch.code == fc::FullBlock )
s_ch.code = ' ';
sc = &s_ch;
@ -1172,7 +1172,7 @@ void FVTerm::updateVTerm()
while ( iter2 != end2 )
{
if ( iter2->instance->child_print_area
&& iter2->instance->child_print_area->has_changes )
&& iter2->instance->child_print_area->has_changes )
{
updateVTerm(win);
iter2->instance->child_print_area->has_changes = false;
@ -1284,11 +1284,11 @@ void FVTerm::updateVTerm (term_area* area)
ch.attr.bit.standout = false;
if ( ch.code == fc::LowerHalfBlock
|| ch.code == fc::UpperHalfBlock
|| ch.code == fc::LeftHalfBlock
|| ch.code == fc::RightHalfBlock
|| ch.code == fc::MediumShade
|| ch.code == fc::FullBlock )
|| ch.code == fc::UpperHalfBlock
|| ch.code == fc::LeftHalfBlock
|| ch.code == fc::RightHalfBlock
|| ch.code == fc::MediumShade
|| ch.code == fc::FullBlock )
ch.code = ' ';
ch.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == ch);
@ -1315,11 +1315,11 @@ void FVTerm::updateVTerm (term_area* area)
ch.attr.bit.standout = false;
if ( ch.code == fc::LowerHalfBlock
|| ch.code == fc::UpperHalfBlock
|| ch.code == fc::LeftHalfBlock
|| ch.code == fc::RightHalfBlock
|| ch.code == fc::MediumShade
|| ch.code == fc::FullBlock )
|| ch.code == fc::UpperHalfBlock
|| ch.code == fc::LeftHalfBlock
|| ch.code == fc::RightHalfBlock
|| ch.code == fc::MediumShade
|| ch.code == fc::FullBlock )
ch.code = ' ';
ch.attr.bit.no_changes = bool(tc->attr.bit.printed && *tc == ch);
@ -1402,8 +1402,8 @@ bool FVTerm::updateVTermCursor (term_area* area)
y = ay + cy;
if ( isInsideArea(cx, cy, area)
&& isInsideTerminal(x, y)
&& isCovered(x, y, area) == non_covered )
&& isInsideTerminal(x, y)
&& isCovered(x, y, area) == non_covered )
{
vterm->input_cursor_x = x;
vterm->input_cursor_y = y;
@ -1651,11 +1651,11 @@ void FVTerm::putArea (int ax, int ay, term_area* area)
ch.attr.bit.standout = false;
if ( ch.code == fc::LowerHalfBlock
|| ch.code == fc::UpperHalfBlock
|| ch.code == fc::LeftHalfBlock
|| ch.code == fc::RightHalfBlock
|| ch.code == fc::MediumShade
|| ch.code == fc::FullBlock )
|| ch.code == fc::UpperHalfBlock
|| ch.code == fc::LeftHalfBlock
|| ch.code == fc::RightHalfBlock
|| ch.code == fc::MediumShade
|| ch.code == fc::FullBlock )
ch.code = ' ';
std::memcpy (tc, &ch, sizeof(char_data));
@ -1878,8 +1878,8 @@ void FVTerm::clearArea (term_area* area, int fillchar)
area->changes[i].xmax = w - 1;
if ( nc.attr.bit.transparent
|| nc.attr.bit.trans_shadow
|| nc.attr.bit.inherit_bg )
|| nc.attr.bit.trans_shadow
|| nc.attr.bit.inherit_bg )
area->changes[i].trans_count = w;
else if ( area->right_shadow != 0 )
area->changes[i].trans_count = uInt(area->right_shadow);
@ -2210,7 +2210,7 @@ bool FVTerm::clearTerm (int fillchar)
appendAttributes(next);
if ( ! ( (cl || cd || cb) && (normal || ut) )
|| fillchar != ' ' )
|| fillchar != ' ' )
{
return false;
}
@ -2282,8 +2282,8 @@ void FVTerm::updateTerminalLine (uInt y)
}
if ( beginning_whitespace == uInt(vt->width) - xmin
&& (ut || normal)
&& clr_eol_length < int(beginning_whitespace) )
&& (ut || normal)
&& clr_eol_length < int(beginning_whitespace) )
is_eol_clean = true;
}
@ -2306,8 +2306,8 @@ void FVTerm::updateTerminalLine (uInt y)
}
if ( leading_whitespace > xmin
&& (ut || normal)
&& clr_bol_length < int(leading_whitespace) )
&& (ut || normal)
&& clr_bol_length < int(leading_whitespace) )
{
draw_leading_ws = true;
xmin = leading_whitespace - 1;
@ -2331,8 +2331,8 @@ void FVTerm::updateTerminalLine (uInt y)
}
if ( tailing_whitespace > uInt(vt->width) - xmax
&& (ut || normal)
&& clr_bol_length < int(tailing_whitespace) )
&& (ut || normal)
&& clr_bol_length < int(tailing_whitespace) )
{
draw_tailing_ws = true;
xmax = uInt(vt->width) - tailing_whitespace;
@ -2414,7 +2414,7 @@ void FVTerm::updateTerminalLine (uInt y)
uInt start_pos = x;
if ( whitespace > uInt(erase_ch_length) + uInt(cursor_addres_lengths)
&& (ut || normal) )
&& (ut || normal) )
{
appendAttributes (print_char);
appendOutputBuffer (tparm(ec, whitespace, 0, 0, 0, 0, 0, 0, 0, 0));
@ -2461,7 +2461,7 @@ void FVTerm::updateTerminalLine (uInt y)
uInt start_pos = x;
if ( repetitions > uInt(repeat_char_length)
&& print_char->code < 128 )
&& print_char->code < 128 )
{
newFontChanges (print_char);
charsetChanges (print_char);
@ -2661,7 +2661,7 @@ inline void FVTerm::appendCharacter (char_data*& next_char)
int term_height = vterm->height - 1;
if ( term_pos->getX() == term_width
&& term_pos->getY() == term_height )
&& term_pos->getY() == term_height )
appendLowerRight (next_char);
else
appendChar (next_char);

View File

@ -91,7 +91,7 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
if ( ! parent )
{
assert ( ! rootObject
&& "FTerm: There should be only one root object" );
&& "FTerm: There should be only one root object" );
rootObject = this;
show_root_widget = 0;
@ -292,9 +292,9 @@ FPoint FWidget::getPrintPos()
std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
{
assert ( side == fc::top
|| side == fc::right
|| side == fc::bottom
|| side == fc::left );
|| side == fc::right
|| side == fc::bottom
|| side == fc::left );
switch ( side )
{
@ -390,7 +390,7 @@ bool FWidget::setFocus (bool on)
last_focus->unsetFocus();
if ( (!isDialogWidget() && focusable_children == 0)
|| (isDialogWidget() && focusable_children == 1) )
|| (isDialogWidget() && focusable_children == 1) )
{
FWidget::setFocusWidget(this);
}
@ -458,7 +458,7 @@ void FWidget::setY (int y, bool adjust)
void FWidget::setPos (int x, int y, bool adjust)
{
if ( getX() == x && wsize.getX() == x
&& getY() == y && wsize.getY() == y )
&& getY() == y && wsize.getY() == y )
{
return;
}
@ -532,7 +532,7 @@ void FWidget::setSize (int width, int height, bool adjust)
height = std::max (height, size_hints.min_height);
if ( getWidth() == width && wsize.getWidth() == width
&& getHeight() == height && wsize.getHeight() == height )
&& getHeight() == height && wsize.getHeight() == height )
return;
if ( width < 1 )
@ -777,9 +777,9 @@ void FWidget::setDoubleFlatLine (fc::sides side, bool bit)
uLong length;
assert ( side == fc::top
|| side == fc::right
|| side == fc::bottom
|| side == fc::left );
|| side == fc::right
|| side == fc::bottom
|| side == fc::left );
switch ( side )
{
@ -811,9 +811,9 @@ void FWidget::setDoubleFlatLine (fc::sides side, int pos, bool bit)
uLong length, index;
assert ( side == fc::top
|| side == fc::right
|| side == fc::bottom
|| side == fc::left );
|| side == fc::right
|| side == fc::bottom
|| side == fc::left );
assert ( pos >= 1 );
@ -875,9 +875,9 @@ FWidget* FWidget::childWidgetAt (FWidget* p, int x, int y)
FWidget* widget = static_cast<FWidget*>(*iter);
if ( widget->isEnabled()
&& widget->isVisible()
&& ! widget->isWindowWidget()
&& widget->getTermGeometry().contains(x, y) )
&& widget->isVisible()
&& ! widget->isWindowWidget()
&& widget->getTermGeometry().contains(x, y) )
{
FWidget* child = childWidgetAt(widget, x, y);
return ( child != 0 ) ? child : widget;
@ -1079,8 +1079,8 @@ void FWidget::delAccelerator (FWidget* obj)
widget = getRootWidget();
if ( widget
&& widget->accelerator_list
&& ! widget->accelerator_list->empty() )
&& widget->accelerator_list
&& ! widget->accelerator_list->empty() )
{
FWidget::Accelerators::iterator iter;
iter = widget->accelerator_list->begin();
@ -1282,8 +1282,8 @@ void FWidget::hide()
shown = false;
if ( ! isDialogWidget()
&& FWidget::getFocusWidget() == this
&& ! focusPrevChild() )
&& FWidget::getFocusWidget() == this
&& ! focusPrevChild() )
{
if ( FWidget::getFocusWidget() )
FWidget::getFocusWidget()->unsetFocus();
@ -1318,8 +1318,8 @@ bool FWidget::focusFirstChild()
FWidget* widget = static_cast<FWidget*>(*iter);
if ( widget->isEnabled()
&& widget->acceptFocus()
&& ! widget->isMenuWidget() )
&& widget->acceptFocus()
&& ! widget->isMenuWidget() )
{
widget->setFocus();
@ -1361,8 +1361,8 @@ bool FWidget::focusLastChild()
FWidget* widget = static_cast<FWidget*>(*iter);
if ( widget->isEnabled()
&& widget->acceptFocus()
&& ! widget->isMenuWidget() )
&& widget->acceptFocus()
&& ! widget->isMenuWidget() )
{
widget->setFocus();
@ -1412,7 +1412,7 @@ void FWidget::drawShadow()
return;
if ( (term_encoding == fc::VT100 && ! trans_shadow)
|| (term_encoding == fc::ASCII && ! trans_shadow) )
|| (term_encoding == fc::ASCII && ! trans_shadow) )
{
clearShadow();
return;
@ -1817,8 +1817,8 @@ bool FWidget::isChildPrintArea() const
FWidget* p_obj = static_cast<FWidget*>(getParent());
if ( p_obj
&& p_obj->child_print_area
&& p_obj->child_print_area == print_area )
&& p_obj->child_print_area
&& p_obj->child_print_area == print_area )
return true;
else
return false;
@ -1974,10 +1974,10 @@ bool FWidget::focusNextChild()
next = static_cast<FWidget*>(*next_element);
} while ( ! next
|| ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
|| next->isWindowWidget() );
|| ! next->isEnabled()
|| ! next->acceptFocus()
|| ! next->isVisible()
|| next->isWindowWidget() );
FFocusEvent out (fc::FocusOut_Event);
out.setFocusType(fc::FocusNextWidget);
@ -2066,10 +2066,10 @@ bool FWidget::focusPrevChild()
--prev_element;
prev = static_cast<FWidget*>(*prev_element);
} while ( ! prev
|| ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| prev->isWindowWidget() );
|| ! prev->isEnabled()
|| ! prev->acceptFocus()
|| ! prev->isVisible()
|| prev->isWindowWidget() );
FFocusEvent out (fc::FocusOut_Event);
out.setFocusType(fc::FocusPreviousWidget);
@ -2142,10 +2142,10 @@ bool FWidget::event (FEvent* ev)
if ( ! kev->isAccepted() )
{
if ( kev->key() == fc::Fkey_right
|| kev->key() == fc::Fkey_down )
|| kev->key() == fc::Fkey_down )
accpt_focus = focusNextChild();
else if ( kev->key() == fc::Fkey_left
|| kev->key() == fc::Fkey_up )
|| kev->key() == fc::Fkey_up )
accpt_focus = focusPrevChild();
if ( accpt_focus )

View File

@ -404,7 +404,7 @@ void FWindow::setSize (int w, int h, bool adjust)
FWidget::setSize (w, h, adjust);
if ( isVirtualWindow()
&& (getWidth() != old_width || getHeight() != old_height) )
&& (getWidth() != old_width || getHeight() != old_height) )
{
FRect geometry = getTermGeometry();
geometry.move(-1, -1);
@ -476,7 +476,7 @@ FWindow* FWindow::getWindowWidgetAt (int x, int y)
FWindow* w = static_cast<FWindow*>(*iter);
if ( ! w->isWindowHidden()
&& w->getTermGeometry().contains(x, y) )
&& w->getTermGeometry().contains(x, y) )
return w;
}
}
@ -627,7 +627,7 @@ bool FWindow::raiseWindow (FWidget* obj)
return false;
if ( (window_list->back()->getFlags() & fc::modal) != 0
&& ! obj->isMenuWidget() )
&& ! obj->isMenuWidget() )
return false;
iter = window_list->begin();
@ -737,10 +737,10 @@ void FWindow::switchToPrevWindow()
FWindow* w = static_cast<FWindow*>(*iter);
if ( w
&& w != active_window
&& ! (w->isWindowHidden() || w->isWindowActive())
&& w != static_cast<FWindow*>(getStatusBar())
&& w != static_cast<FWindow*>(getMenuBar()) )
&& w != active_window
&& ! (w->isWindowHidden() || w->isWindowActive())
&& w != static_cast<FWindow*>(getStatusBar())
&& w != static_cast<FWindow*>(getMenuBar()) )
{
setActiveWindow(w);
break;
@ -800,7 +800,7 @@ void FWindow::setShadowSize (int right, int bottom)
, new_bottom = getShadow().getY();
if ( isVirtualWindow()
&& (new_right != old_right || new_bottom != old_bottom) )
&& (new_right != old_right || new_bottom != old_bottom) )
{
FRect geometry = getTermGeometry();
geometry.move(-1, -1);