Reduces in the code the number of friend classes
This commit is contained in:
parent
560e8c9811
commit
cae1a742ea
|
@ -1,3 +1,6 @@
|
||||||
|
2016-10-13 Markus Gans <guru.mail@muenster.de>
|
||||||
|
* Reduces in the code the number of friend classes
|
||||||
|
|
||||||
2016-10-11 Markus Gans <guru.mail@muenster.de>
|
2016-10-11 Markus Gans <guru.mail@muenster.de>
|
||||||
* Separate the virtual terminal into a own class vterm
|
* Separate the virtual terminal into a own class vterm
|
||||||
|
|
||||||
|
|
94
src/fapp.cpp
94
src/fapp.cpp
|
@ -21,6 +21,7 @@ FWidget* FApplication::clicked_widget = 0; // is focused by click
|
||||||
FWidget* FApplication::open_menu = 0; // currently open menu
|
FWidget* FApplication::open_menu = 0; // currently open menu
|
||||||
FWidget* FApplication::move_size_widget = 0; // move/size by keyboard
|
FWidget* FApplication::move_size_widget = 0; // move/size by keyboard
|
||||||
FPoint* FApplication::zero_point = 0; // zero point (x=0, y=0)
|
FPoint* FApplication::zero_point = 0; // zero point (x=0, y=0)
|
||||||
|
uChar FApplication::x11_button_state = 0x03;
|
||||||
int FApplication::quit_code = 0;
|
int FApplication::quit_code = 0;
|
||||||
bool FApplication::quit_now = false;
|
bool FApplication::quit_now = false;
|
||||||
|
|
||||||
|
@ -278,7 +279,7 @@ void FApplication::processKeyboardEvent()
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
#ifdef F_HAVE_LIBGPM
|
||||||
|
|
||||||
if ( gpm_mouse_enabled )
|
if ( isGpmMouseEnabled() )
|
||||||
{
|
{
|
||||||
gpmMouseEvent = false;
|
gpmMouseEvent = false;
|
||||||
int type = gpmEvent();
|
int type = gpmEvent();
|
||||||
|
@ -496,8 +497,7 @@ void FApplication::processKeyboardEvent()
|
||||||
int FApplication::modifierKeyCorrection (int& key_id)
|
int FApplication::modifierKeyCorrection (int& key_id)
|
||||||
{
|
{
|
||||||
// get the current modifier key state
|
// get the current modifier key state
|
||||||
getModifierKey();
|
FTerm::modifier_key& m = getModifierKey();
|
||||||
modifier_key& m = mod_key;
|
|
||||||
|
|
||||||
if ( ! (m.shift || m.ctrl || m.alt) )
|
if ( ! (m.shift || m.ctrl || m.alt) )
|
||||||
{
|
{
|
||||||
|
@ -845,6 +845,7 @@ bool FApplication::processAccelerator (FWidget*& widget)
|
||||||
void FApplication::getX11ButtonState (int button)
|
void FApplication::getX11ButtonState (int button)
|
||||||
{
|
{
|
||||||
// get the x11 and urxvt mouse button state
|
// get the x11 and urxvt mouse button state
|
||||||
|
const FPoint& mouse_position = getMousePos();
|
||||||
|
|
||||||
enum btn_states
|
enum btn_states
|
||||||
{
|
{
|
||||||
|
@ -870,7 +871,7 @@ void FApplication::getX11ButtonState (int button)
|
||||||
{
|
{
|
||||||
case button1_pressed:
|
case button1_pressed:
|
||||||
case button1_pressed_move:
|
case button1_pressed_move:
|
||||||
if ( *mouse == new_mouse_position
|
if ( mouse_position == new_mouse_position
|
||||||
&& x11_button_state == all_buttons_released
|
&& x11_button_state == all_buttons_released
|
||||||
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
|
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
|
||||||
{
|
{
|
||||||
|
@ -942,6 +943,7 @@ void FApplication::getX11ButtonState (int button)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FApplication::parseX11Mouse()
|
bool FApplication::parseX11Mouse()
|
||||||
{
|
{
|
||||||
|
const FPoint& mouse_position = getMousePos();
|
||||||
uChar x, y;
|
uChar x, y;
|
||||||
|
|
||||||
enum x11_btn_states
|
enum x11_btn_states
|
||||||
|
@ -979,15 +981,15 @@ bool FApplication::parseX11Mouse()
|
||||||
|
|
||||||
if ( (x11_mouse[0] & button_mask) >= button1_pressed_move
|
if ( (x11_mouse[0] & button_mask) >= button1_pressed_move
|
||||||
&& (x11_mouse[0] & button_mask) <= button3_pressed_move
|
&& (x11_mouse[0] & button_mask) <= button3_pressed_move
|
||||||
&& *mouse != *zero_point )
|
&& mouse_position != *zero_point )
|
||||||
{
|
{
|
||||||
b_state.mouse_moved = true;
|
b_state.mouse_moved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
getX11ButtonState (x11_mouse[0] & button_mask);
|
getX11ButtonState (x11_mouse[0] & button_mask);
|
||||||
|
|
||||||
if ( uChar(x11_mouse[1]) == mouse->getX() + 0x20
|
if ( uChar(x11_mouse[1]) == mouse_position.getX() + 0x20
|
||||||
&& uChar(x11_mouse[2]) == mouse->getY() + 0x20
|
&& uChar(x11_mouse[2]) == mouse_position.getY() + 0x20
|
||||||
&& b_state.wheel_up != Pressed
|
&& b_state.wheel_up != Pressed
|
||||||
&& b_state.wheel_down != Pressed
|
&& b_state.wheel_down != Pressed
|
||||||
&& uChar(x11_mouse[0]) == x11_button_state )
|
&& uChar(x11_mouse[0]) == x11_button_state )
|
||||||
|
@ -995,7 +997,7 @@ bool FApplication::parseX11Mouse()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse->setPoint(x,y);
|
setMousePos (x, y);
|
||||||
x11_button_state = uChar(x11_mouse[0]);
|
x11_button_state = uChar(x11_mouse[0]);
|
||||||
x11_mouse[0] = '\0';
|
x11_mouse[0] = '\0';
|
||||||
return true;
|
return true;
|
||||||
|
@ -1004,6 +1006,7 @@ bool FApplication::parseX11Mouse()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FApplication::parseSGRMouse()
|
bool FApplication::parseSGRMouse()
|
||||||
{
|
{
|
||||||
|
const FPoint& mouse_position = getMousePos();
|
||||||
register char* p;
|
register char* p;
|
||||||
int button;
|
int button;
|
||||||
uChar x, y;
|
uChar x, y;
|
||||||
|
@ -1026,6 +1029,7 @@ bool FApplication::parseSGRMouse()
|
||||||
pressed = 'M',
|
pressed = 'M',
|
||||||
released = 'm'
|
released = 'm'
|
||||||
};
|
};
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
button = 0;
|
button = 0;
|
||||||
|
@ -1072,7 +1076,7 @@ bool FApplication::parseSGRMouse()
|
||||||
|
|
||||||
if ( (button & button_mask) >= button1_move
|
if ( (button & button_mask) >= button1_move
|
||||||
&& (button & button_mask) <= button3_move
|
&& (button & button_mask) <= button3_move
|
||||||
&& *mouse != *zero_point )
|
&& mouse_position != *zero_point )
|
||||||
{
|
{
|
||||||
b_state.mouse_moved = true;
|
b_state.mouse_moved = true;
|
||||||
}
|
}
|
||||||
|
@ -1083,7 +1087,7 @@ bool FApplication::parseSGRMouse()
|
||||||
{
|
{
|
||||||
case button1:
|
case button1:
|
||||||
case button1_move:
|
case button1_move:
|
||||||
if ( *mouse == new_mouse_position
|
if ( mouse_position == new_mouse_position
|
||||||
&& (((x11_button_state & 0x80) >> 2) + 'M') == released
|
&& (((x11_button_state & 0x80) >> 2) + 'M') == released
|
||||||
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
|
&& ! isKeyTimeout(&time_mousepressed, dblclick_interval) )
|
||||||
{
|
{
|
||||||
|
@ -1152,7 +1156,7 @@ bool FApplication::parseSGRMouse()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( *mouse == new_mouse_position
|
if ( mouse_position == new_mouse_position
|
||||||
&& b_state.wheel_up != Pressed
|
&& b_state.wheel_up != Pressed
|
||||||
&& b_state.wheel_down != Pressed
|
&& b_state.wheel_down != Pressed
|
||||||
&& x11_button_state == uChar(((*p & 0x20) << 2) + button) )
|
&& x11_button_state == uChar(((*p & 0x20) << 2) + button) )
|
||||||
|
@ -1160,7 +1164,7 @@ bool FApplication::parseSGRMouse()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse->setPoint(x,y);
|
setMousePos (x, y);
|
||||||
x11_button_state = uChar(((*p & 0x20) << 2) + button);
|
x11_button_state = uChar(((*p & 0x20) << 2) + button);
|
||||||
sgr_mouse[0] = '\0';
|
sgr_mouse[0] = '\0';
|
||||||
return true;
|
return true;
|
||||||
|
@ -1169,6 +1173,7 @@ bool FApplication::parseSGRMouse()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FApplication::parseUrxvtMouse()
|
bool FApplication::parseUrxvtMouse()
|
||||||
{
|
{
|
||||||
|
const FPoint& mouse_position = getMousePos();
|
||||||
register char* p;
|
register char* p;
|
||||||
register bool x_neg;
|
register bool x_neg;
|
||||||
register bool y_neg;
|
register bool y_neg;
|
||||||
|
@ -1248,11 +1253,11 @@ bool FApplication::parseUrxvtMouse()
|
||||||
if ( y_neg || y == 0 )
|
if ( y_neg || y == 0 )
|
||||||
y = 1;
|
y = 1;
|
||||||
|
|
||||||
if ( x > term->getWidth() )
|
if ( x > getColumnNumber() )
|
||||||
x = uChar(term->getWidth());
|
x = uChar(getColumnNumber());
|
||||||
|
|
||||||
if ( y > term->getHeight() )
|
if ( y > getLineNumber() )
|
||||||
y = uChar(term->getHeight());
|
y = uChar(getLineNumber());
|
||||||
|
|
||||||
new_mouse_position.setPoint(x,y);
|
new_mouse_position.setPoint(x,y);
|
||||||
// fill bit field with 0
|
// fill bit field with 0
|
||||||
|
@ -1269,14 +1274,14 @@ bool FApplication::parseUrxvtMouse()
|
||||||
|
|
||||||
if ( (button & button_mask) >= button1_pressed_move
|
if ( (button & button_mask) >= button1_pressed_move
|
||||||
&& (button & button_mask) <= button3_pressed_move
|
&& (button & button_mask) <= button3_pressed_move
|
||||||
&& *mouse != *zero_point )
|
&& mouse_position != *zero_point )
|
||||||
{
|
{
|
||||||
b_state.mouse_moved = true;
|
b_state.mouse_moved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
getX11ButtonState (button & button_mask);
|
getX11ButtonState (button & button_mask);
|
||||||
|
|
||||||
if ( *mouse == new_mouse_position
|
if ( mouse_position == new_mouse_position
|
||||||
&& b_state.wheel_up != Pressed
|
&& b_state.wheel_up != Pressed
|
||||||
&& b_state.wheel_down != Pressed
|
&& b_state.wheel_down != Pressed
|
||||||
&& x11_button_state == uChar(button) )
|
&& x11_button_state == uChar(button) )
|
||||||
|
@ -1284,7 +1289,7 @@ bool FApplication::parseUrxvtMouse()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse->setPoint(x,y);
|
setMousePos (x, y);
|
||||||
x11_button_state = uChar(button);
|
x11_button_state = uChar(button);
|
||||||
urxvt_mouse[0] = '\0';
|
urxvt_mouse[0] = '\0';
|
||||||
return true;
|
return true;
|
||||||
|
@ -1359,7 +1364,7 @@ bool FApplication::processGpmEvent()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse->setPoint(gpm_ev.x, gpm_ev.y);
|
setMousePos (gpm_ev.x, gpm_ev.y);
|
||||||
|
|
||||||
if ( gpmEvent(false) == mouse_event )
|
if ( gpmEvent(false) == mouse_event )
|
||||||
unprocessedInput() = true;
|
unprocessedInput() = true;
|
||||||
|
@ -1416,6 +1421,8 @@ void FApplication::processMouseEvent()
|
||||||
if ( ! Event )
|
if ( ! Event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const FPoint& mouse_position = getMousePos();
|
||||||
|
|
||||||
if ( ! clicked_widget
|
if ( ! clicked_widget
|
||||||
&& ( b_state.left_button == Pressed
|
&& ( b_state.left_button == Pressed
|
||||||
|| b_state.left_button == DoubleClick
|
|| b_state.left_button == DoubleClick
|
||||||
|
@ -1425,12 +1432,12 @@ void FApplication::processMouseEvent()
|
||||||
|| b_state.wheel_down == Pressed ) )
|
|| b_state.wheel_down == Pressed ) )
|
||||||
{
|
{
|
||||||
// determine the window object on the current click position
|
// determine the window object on the current click position
|
||||||
FWidget* window = FWindow::getWindowWidgetAt (*mouse);
|
FWidget* window = FWindow::getWindowWidgetAt (mouse_position);
|
||||||
|
|
||||||
if ( window )
|
if ( window )
|
||||||
{
|
{
|
||||||
// determine the widget at the current click position
|
// determine the widget at the current click position
|
||||||
FWidget* child = childWidgetAt (window, *mouse);
|
FWidget* child = childWidgetAt (window, mouse_position);
|
||||||
clicked_widget = (child != 0) ? child : window;
|
clicked_widget = (child != 0) ? child : window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1448,7 +1455,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMenu* menu = static_cast<FMenu*>(open_menu);
|
FMenu* menu = static_cast<FMenu*>(open_menu);
|
||||||
|
|
||||||
if ( ! menu->containsMenuStructure(*mouse) )
|
if ( ! menu->containsMenuStructure(mouse_position) )
|
||||||
{
|
{
|
||||||
bool is_window_menu;
|
bool is_window_menu;
|
||||||
FWidget* super = menu->getSuperMenu();
|
FWidget* super = menu->getSuperMenu();
|
||||||
|
@ -1480,7 +1487,7 @@ void FApplication::processMouseEvent()
|
||||||
&& menuBar()->hasSelectedItem()
|
&& menuBar()->hasSelectedItem()
|
||||||
&& ! b_state.mouse_moved )
|
&& ! b_state.mouse_moved )
|
||||||
{
|
{
|
||||||
if ( ! menuBar()->getTermGeometry().contains(*mouse) )
|
if ( ! menuBar()->getTermGeometry().contains(mouse_position) )
|
||||||
{
|
{
|
||||||
if ( statusBar() )
|
if ( statusBar() )
|
||||||
statusBar()->clearMessage();
|
statusBar()->clearMessage();
|
||||||
|
@ -1514,7 +1521,7 @@ void FApplication::processMouseEvent()
|
||||||
if ( b_state.control_button == Pressed )
|
if ( b_state.control_button == Pressed )
|
||||||
key_state |= fc::ControlButton;
|
key_state |= fc::ControlButton;
|
||||||
|
|
||||||
widgetMousePos = clicked_widget->termToWidgetPos(*mouse);
|
widgetMousePos = clicked_widget->termToWidgetPos(mouse_position);
|
||||||
|
|
||||||
if ( b_state.mouse_moved )
|
if ( b_state.mouse_moved )
|
||||||
{
|
{
|
||||||
|
@ -1522,7 +1529,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::LeftButton | key_state );
|
, fc::LeftButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_down_ev);
|
sendEvent (clicked_widget, &m_down_ev);
|
||||||
}
|
}
|
||||||
|
@ -1531,7 +1538,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::RightButton | key_state );
|
, fc::RightButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_down_ev);
|
sendEvent (clicked_widget, &m_down_ev);
|
||||||
}
|
}
|
||||||
|
@ -1540,7 +1547,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::MiddleButton | key_state );
|
, fc::MiddleButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_down_ev);
|
sendEvent (clicked_widget, &m_down_ev);
|
||||||
}
|
}
|
||||||
|
@ -1551,7 +1558,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_dblclick_ev ( fc::MouseDoubleClick_Event
|
FMouseEvent m_dblclick_ev ( fc::MouseDoubleClick_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::LeftButton | key_state );
|
, fc::LeftButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_dblclick_ev);
|
sendEvent (clicked_widget, &m_dblclick_ev);
|
||||||
}
|
}
|
||||||
|
@ -1559,7 +1566,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::LeftButton | key_state );
|
, fc::LeftButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_down_ev);
|
sendEvent (clicked_widget, &m_down_ev);
|
||||||
}
|
}
|
||||||
|
@ -1567,7 +1574,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_up_ev ( fc::MouseUp_Event
|
FMouseEvent m_up_ev ( fc::MouseUp_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::LeftButton | key_state );
|
, fc::LeftButton | key_state );
|
||||||
FWidget* released_widget = clicked_widget;
|
FWidget* released_widget = clicked_widget;
|
||||||
|
|
||||||
|
@ -1582,7 +1589,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::RightButton | key_state );
|
, fc::RightButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_down_ev);
|
sendEvent (clicked_widget, &m_down_ev);
|
||||||
}
|
}
|
||||||
|
@ -1590,7 +1597,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_up_ev ( fc::MouseUp_Event
|
FMouseEvent m_up_ev ( fc::MouseUp_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::RightButton | key_state );
|
, fc::RightButton | key_state );
|
||||||
FWidget* released_widget = clicked_widget;
|
FWidget* released_widget = clicked_widget;
|
||||||
|
|
||||||
|
@ -1605,7 +1612,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::MiddleButton | key_state );
|
, fc::MiddleButton | key_state );
|
||||||
sendEvent (clicked_widget, &m_down_ev);
|
sendEvent (clicked_widget, &m_down_ev);
|
||||||
|
|
||||||
|
@ -1617,7 +1624,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FMouseEvent m_up_ev ( fc::MouseUp_Event
|
FMouseEvent m_up_ev ( fc::MouseUp_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::MiddleButton | key_state );
|
, fc::MiddleButton | key_state );
|
||||||
FWidget* released_widget = clicked_widget;
|
FWidget* released_widget = clicked_widget;
|
||||||
|
|
||||||
|
@ -1635,7 +1642,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FWheelEvent wheel_ev ( fc::MouseWheel_Event
|
FWheelEvent wheel_ev ( fc::MouseWheel_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::WheelUp );
|
, fc::WheelUp );
|
||||||
FWidget* scroll_over_widget = clicked_widget;
|
FWidget* scroll_over_widget = clicked_widget;
|
||||||
clicked_widget = 0;
|
clicked_widget = 0;
|
||||||
|
@ -1646,7 +1653,7 @@ void FApplication::processMouseEvent()
|
||||||
{
|
{
|
||||||
FWheelEvent wheel_ev ( fc::MouseWheel_Event
|
FWheelEvent wheel_ev ( fc::MouseWheel_Event
|
||||||
, widgetMousePos
|
, widgetMousePos
|
||||||
, *mouse
|
, mouse_position
|
||||||
, fc::WheelDown );
|
, fc::WheelDown );
|
||||||
FWidget* scroll_over_widget = clicked_widget;
|
FWidget* scroll_over_widget = clicked_widget;
|
||||||
clicked_widget = 0;
|
clicked_widget = 0;
|
||||||
|
@ -1656,7 +1663,7 @@ void FApplication::processMouseEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
#ifdef F_HAVE_LIBGPM
|
||||||
if ( gpm_mouse_enabled && gpm_ev.x != -1 )
|
if ( isGpmMouseEnabled() && gpm_ev.x != -1 )
|
||||||
GPM_DRAWPOINTER(&gpm_ev);
|
GPM_DRAWPOINTER(&gpm_ev);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1664,13 +1671,13 @@ void FApplication::processMouseEvent()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FApplication::processResizeEvent()
|
void FApplication::processResizeEvent()
|
||||||
{
|
{
|
||||||
if ( resize_term )
|
if ( hasChangedTermSize() )
|
||||||
{
|
{
|
||||||
FResizeEvent r_ev(fc::Resize_Event);
|
FResizeEvent r_ev(fc::Resize_Event);
|
||||||
sendEvent(rootObj, &r_ev);
|
sendEvent(rootObj, &r_ev);
|
||||||
|
|
||||||
if ( r_ev.isAccepted() )
|
if ( r_ev.isAccepted() )
|
||||||
resize_term = false;
|
changeTermSizeFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1899,7 +1906,12 @@ bool FApplication::sendEvent(FObject* receiver, FEvent* event)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// sends event event directly to receiver
|
// sends event event directly to receiver
|
||||||
return widget->event(event);
|
FApplication* w = static_cast<FApplication*>(widget);
|
||||||
|
|
||||||
|
if ( w )
|
||||||
|
return w->event(event); // access to a protected base class member
|
||||||
|
else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -65,12 +65,14 @@ class FApplication : public FWidget
|
||||||
static int loop_level;
|
static int loop_level;
|
||||||
static bool process_timer_event;
|
static bool process_timer_event;
|
||||||
static FPoint* zero_point;
|
static FPoint* zero_point;
|
||||||
|
static uChar x11_button_state;
|
||||||
int key;
|
int key;
|
||||||
char k_buf[1024];
|
char k_buf[1024];
|
||||||
char x11_mouse[4];
|
char x11_mouse[4];
|
||||||
char sgr_mouse[13];
|
char sgr_mouse[13];
|
||||||
char urxvt_mouse[13];
|
char urxvt_mouse[13];
|
||||||
|
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
#ifdef F_HAVE_LIBGPM
|
||||||
|
|
||||||
Gpm_Event gpm_ev;
|
Gpm_Event gpm_ev;
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ void FDialog::onWindowActive (FEvent*)
|
||||||
void FDialog::onWindowInactive (FEvent*)
|
void FDialog::onWindowInactive (FEvent*)
|
||||||
{
|
{
|
||||||
if ( dialog_menu && ! dialog_menu->isVisible() )
|
if ( dialog_menu && ! dialog_menu->isVisible() )
|
||||||
FWindow::previous_widget = this;
|
FWindow::previous_window = this;
|
||||||
|
|
||||||
if ( isVisible() && isEnabled() )
|
if ( isVisible() && isEnabled() )
|
||||||
drawTitleBar();
|
drawTitleBar();
|
||||||
|
|
|
@ -1325,7 +1325,7 @@ void FOptiAttr::init()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
char* FOptiAttr::change_attribute (char_data*& term, char_data*& next)
|
char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
|
||||||
{
|
{
|
||||||
fake_reverse = false;
|
fake_reverse = false;
|
||||||
attr_buf[0] = '\0';
|
attr_buf[0] = '\0';
|
||||||
|
|
|
@ -234,7 +234,7 @@ class FOptiAttr
|
||||||
void set_orig_orig_colors (char*&);
|
void set_orig_orig_colors (char*&);
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
char* change_attribute (char_data*&, char_data*&);
|
char* changeAttribute (char_data*&, char_data*&);
|
||||||
|
|
||||||
friend bool operator == (const char_data&, const char_data&);
|
friend bool operator == (const char_data&, const char_data&);
|
||||||
friend bool operator != (const char_data&, const char_data&);
|
friend bool operator != (const char_data&, const char_data&);
|
||||||
|
|
398
src/fterm.cpp
398
src/fterm.cpp
|
@ -23,11 +23,8 @@ int (*FTerm::Fputchar)(int);
|
||||||
int FTerm::stdin_no;
|
int FTerm::stdin_no;
|
||||||
int FTerm::stdout_no;
|
int FTerm::stdout_no;
|
||||||
int FTerm::fd_tty;
|
int FTerm::fd_tty;
|
||||||
int FTerm::max_color;
|
|
||||||
int FTerm::stdin_status_flags;
|
int FTerm::stdin_status_flags;
|
||||||
uInt FTerm::baudrate;
|
uInt FTerm::baudrate;
|
||||||
uInt FTerm::tabstop;
|
|
||||||
uInt FTerm::attr_without_color;
|
|
||||||
bool FTerm::resize_term;
|
bool FTerm::resize_term;
|
||||||
bool FTerm::mouse_support;
|
bool FTerm::mouse_support;
|
||||||
bool FTerm::raw_mode;
|
bool FTerm::raw_mode;
|
||||||
|
@ -36,11 +33,6 @@ bool FTerm::non_blocking_stdin;
|
||||||
bool FTerm::gpm_mouse_enabled;
|
bool FTerm::gpm_mouse_enabled;
|
||||||
bool FTerm::color256;
|
bool FTerm::color256;
|
||||||
bool FTerm::monochron;
|
bool FTerm::monochron;
|
||||||
bool FTerm::background_color_erase;
|
|
||||||
bool FTerm::automatic_left_margin;
|
|
||||||
bool FTerm::automatic_right_margin;
|
|
||||||
bool FTerm::eat_nl_glitch;
|
|
||||||
bool FTerm::ansi_default_color;
|
|
||||||
bool FTerm::xterm_terminal;
|
bool FTerm::xterm_terminal;
|
||||||
bool FTerm::rxvt_terminal;
|
bool FTerm::rxvt_terminal;
|
||||||
bool FTerm::urxvt_terminal;
|
bool FTerm::urxvt_terminal;
|
||||||
|
@ -66,8 +58,6 @@ bool FTerm::ascii_console;
|
||||||
bool FTerm::NewFont;
|
bool FTerm::NewFont;
|
||||||
bool FTerm::VGAFont;
|
bool FTerm::VGAFont;
|
||||||
bool FTerm::cursor_optimisation;
|
bool FTerm::cursor_optimisation;
|
||||||
bool FTerm::osc_support;
|
|
||||||
uChar FTerm::x11_button_state;
|
|
||||||
termios FTerm::term_init;
|
termios FTerm::term_init;
|
||||||
char FTerm::termtype[30] = "";
|
char FTerm::termtype[30] = "";
|
||||||
char* FTerm::term_name = 0;
|
char* FTerm::term_name = 0;
|
||||||
|
@ -88,8 +78,17 @@ FTerm::modifier_key FTerm::mod_key;
|
||||||
std::map<uChar,uChar>* FTerm::vt100_alt_char = 0;
|
std::map<uChar,uChar>* FTerm::vt100_alt_char = 0;
|
||||||
std::map<std::string,fc::encoding>* \
|
std::map<std::string,fc::encoding>* \
|
||||||
FTerm::encoding_set = 0;
|
FTerm::encoding_set = 0;
|
||||||
FTermcap::tcap_map* FTermcap::tcap = 0;
|
|
||||||
FTermcap::tcap_map* FTerm::tcap = term_caps;
|
FTermcap::tcap_map* FTerm::tcap = term_caps;
|
||||||
|
FTermcap::tcap_map* FTermcap::tcap = 0;
|
||||||
|
bool FTermcap::background_color_erase = false;
|
||||||
|
bool FTermcap::automatic_left_margin = false;
|
||||||
|
bool FTermcap::automatic_right_margin = false;
|
||||||
|
bool FTermcap::eat_nl_glitch = false;
|
||||||
|
bool FTermcap::ansi_default_color = false;
|
||||||
|
bool FTermcap::osc_support = false;
|
||||||
|
int FTermcap::max_color = 1;
|
||||||
|
uInt FTermcap::tabstop = 8;
|
||||||
|
uInt FTermcap::attr_without_color = 0;
|
||||||
console_font_op FTerm::screen_font;
|
console_font_op FTerm::screen_font;
|
||||||
unimapdesc FTerm::screen_unicode_map;
|
unimapdesc FTerm::screen_unicode_map;
|
||||||
fc::consoleCursorStyle FTerm::console_cursor_style;
|
fc::consoleCursorStyle FTerm::console_cursor_style;
|
||||||
|
@ -104,6 +103,8 @@ fc::consoleCursorStyle FTerm::console_cursor_style;
|
||||||
FTerm::FTerm()
|
FTerm::FTerm()
|
||||||
: map()
|
: map()
|
||||||
{
|
{
|
||||||
|
resize_term = false;
|
||||||
|
|
||||||
if ( ! term_initialized )
|
if ( ! term_initialized )
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
@ -660,7 +661,7 @@ bool& FTerm::unprocessedInput()
|
||||||
int FTerm::getLineNumber()
|
int FTerm::getLineNumber()
|
||||||
{
|
{
|
||||||
if ( term->getHeight() == 0 )
|
if ( term->getHeight() == 0 )
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
|
|
||||||
return term->getHeight();
|
return term->getHeight();
|
||||||
}
|
}
|
||||||
|
@ -669,7 +670,7 @@ int FTerm::getLineNumber()
|
||||||
int FTerm::getColumnNumber()
|
int FTerm::getColumnNumber()
|
||||||
{
|
{
|
||||||
if ( term->getWidth() == 0 )
|
if ( term->getWidth() == 0 )
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
|
|
||||||
return term->getWidth();
|
return term->getWidth();
|
||||||
}
|
}
|
||||||
|
@ -688,7 +689,7 @@ FString FTerm::getKeyName (int keynum)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::getModifierKey()
|
FTerm::modifier_key& FTerm::getModifierKey()
|
||||||
{
|
{
|
||||||
char subcode = 6;
|
char subcode = 6;
|
||||||
// fill bit field with 0
|
// fill bit field with 0
|
||||||
|
@ -709,11 +710,14 @@ void FTerm::getModifierKey()
|
||||||
if ( subcode & (1 << KG_ALT) )
|
if ( subcode & (1 << KG_ALT) )
|
||||||
mod_key.alt = true;
|
mod_key.alt = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return mod_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::init_console()
|
void FTerm::init_console()
|
||||||
{
|
{
|
||||||
|
// initialize terminal and Linux console
|
||||||
fd_tty = -1;
|
fd_tty = -1;
|
||||||
screen_unicode_map.entries = 0;
|
screen_unicode_map.entries = 0;
|
||||||
screen_font.data = 0;
|
screen_font.data = 0;
|
||||||
|
@ -726,7 +730,7 @@ void FTerm::init_console()
|
||||||
getScreenFont();
|
getScreenFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
closeConsole();
|
closeConsole();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -763,30 +767,6 @@ uInt FTerm::getBaudRate (const struct termios* termios_p)
|
||||||
return ospeed[cfgetospeed(termios_p)];
|
return ospeed[cfgetospeed(termios_p)];
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void FTerm::init_consoleCharMap()
|
|
||||||
{
|
|
||||||
if ( screen_unicode_map.entry_ct != 0 )
|
|
||||||
{
|
|
||||||
for (int i=0; i <= lastCharItem; i++ )
|
|
||||||
{
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
for (uInt n=0; n < screen_unicode_map.entry_ct; n++)
|
|
||||||
{
|
|
||||||
if ( character[i][fc::UTF8] == screen_unicode_map.entries[n].unicode )
|
|
||||||
{
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! found )
|
|
||||||
character[i][fc::PC] = character[i][fc::ASCII];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::signal_handler (int signum)
|
void FTerm::signal_handler (int signum)
|
||||||
{
|
{
|
||||||
|
@ -1221,48 +1201,48 @@ void FTerm::init_termcaps()
|
||||||
char* key_up_string;
|
char* key_up_string;
|
||||||
|
|
||||||
// screen erased with the background color
|
// screen erased with the background color
|
||||||
background_color_erase = tgetflag(const_cast<char*>("ut"));
|
FTermcap::background_color_erase = tgetflag(const_cast<char*>("ut"));
|
||||||
|
|
||||||
// t_cursor_left wraps from column 0 to last column
|
// t_cursor_left wraps from column 0 to last column
|
||||||
automatic_left_margin = tgetflag(const_cast<char*>("bw"));
|
FTermcap::automatic_left_margin = tgetflag(const_cast<char*>("bw"));
|
||||||
|
|
||||||
// terminal has auto-matic margins
|
// terminal has auto-matic margins
|
||||||
automatic_right_margin = tgetflag(const_cast<char*>("am"));
|
FTermcap::automatic_right_margin = tgetflag(const_cast<char*>("am"));
|
||||||
|
|
||||||
// newline ignored after 80 cols
|
// newline ignored after 80 cols
|
||||||
eat_nl_glitch = tgetflag(const_cast<char*>("xn"));
|
FTermcap::eat_nl_glitch = tgetflag(const_cast<char*>("xn"));
|
||||||
|
|
||||||
// terminal supports ANSI set default fg and bg color
|
// terminal supports ANSI set default fg and bg color
|
||||||
ansi_default_color = tgetflag(const_cast<char*>("AX"));
|
FTermcap::ansi_default_color = tgetflag(const_cast<char*>("AX"));
|
||||||
|
|
||||||
// terminal supports operating system commands (OSC)
|
// terminal supports operating system commands (OSC)
|
||||||
// OSC = Esc + ']'
|
// OSC = Esc + ']'
|
||||||
osc_support = tgetflag(const_cast<char*>("XT"));
|
FTermcap::osc_support = tgetflag(const_cast<char*>("XT"));
|
||||||
|
|
||||||
if ( isTeraTerm() )
|
if ( isTeraTerm() )
|
||||||
eat_nl_glitch = true;
|
FTermcap::eat_nl_glitch = true;
|
||||||
|
|
||||||
// maximum number of colors on screen
|
// maximum number of colors on screen
|
||||||
max_color = tgetnum(const_cast<char*>("Co"));
|
FTermcap::max_color = tgetnum(const_cast<char*>("Co"));
|
||||||
|
|
||||||
if ( max_color < 0 )
|
if ( FTermcap::max_color < 0 )
|
||||||
max_color = 1;
|
FTermcap::max_color = 1;
|
||||||
|
|
||||||
if ( max_color < 8 )
|
if ( FTermcap::max_color < 8 )
|
||||||
monochron = true;
|
monochron = true;
|
||||||
else
|
else
|
||||||
monochron = false;
|
monochron = false;
|
||||||
|
|
||||||
tabstop = uInt(tgetnum(const_cast<char*>("it")));
|
FTermcap::tabstop = uInt(tgetnum(const_cast<char*>("it")));
|
||||||
attr_without_color = uInt(tgetnum(const_cast<char*>("NC")));
|
FTermcap::attr_without_color = uInt(tgetnum(const_cast<char*>("NC")));
|
||||||
|
|
||||||
// gnome-terminal has NC=16 however, it can use the dim attribute
|
// gnome-terminal has NC=16 however, it can use the dim attribute
|
||||||
if ( gnome_terminal )
|
if ( gnome_terminal )
|
||||||
attr_without_color = 0;
|
FTermcap::attr_without_color = 0;
|
||||||
|
|
||||||
// PuTTY has NC=22 however, it can show underline and reverse
|
// PuTTY has NC=22 however, it can show underline and reverse
|
||||||
if ( putty_terminal )
|
if ( putty_terminal )
|
||||||
attr_without_color = 16;
|
FTermcap::attr_without_color = 16;
|
||||||
|
|
||||||
// read termcap output strings
|
// read termcap output strings
|
||||||
for (int i=0; tcap[i].tname[0] != 0; i++)
|
for (int i=0; tcap[i].tname[0] != 0; i++)
|
||||||
|
@ -1508,7 +1488,7 @@ void FTerm::init_termcaps()
|
||||||
}
|
}
|
||||||
|
|
||||||
// duration precalculation of the cursor movement strings
|
// duration precalculation of the cursor movement strings
|
||||||
opti_move->setTabStop(int(tabstop));
|
opti_move->setTabStop(int(FTermcap::tabstop));
|
||||||
opti_move->set_cursor_home (tcap[fc::t_cursor_home].string);
|
opti_move->set_cursor_home (tcap[fc::t_cursor_home].string);
|
||||||
opti_move->set_cursor_to_ll (tcap[fc::t_cursor_to_ll].string);
|
opti_move->set_cursor_to_ll (tcap[fc::t_cursor_to_ll].string);
|
||||||
opti_move->set_carriage_return (tcap[fc::t_carriage_return].string);
|
opti_move->set_carriage_return (tcap[fc::t_carriage_return].string);
|
||||||
|
@ -1525,12 +1505,12 @@ void FTerm::init_termcaps()
|
||||||
opti_move->set_parm_down_cursor (tcap[fc::t_parm_down_cursor].string);
|
opti_move->set_parm_down_cursor (tcap[fc::t_parm_down_cursor].string);
|
||||||
opti_move->set_parm_left_cursor (tcap[fc::t_parm_left_cursor].string);
|
opti_move->set_parm_left_cursor (tcap[fc::t_parm_left_cursor].string);
|
||||||
opti_move->set_parm_right_cursor (tcap[fc::t_parm_right_cursor].string);
|
opti_move->set_parm_right_cursor (tcap[fc::t_parm_right_cursor].string);
|
||||||
opti_move->set_auto_left_margin (automatic_left_margin);
|
opti_move->set_auto_left_margin (FTermcap::automatic_left_margin);
|
||||||
opti_move->set_eat_newline_glitch (eat_nl_glitch);
|
opti_move->set_eat_newline_glitch (FTermcap::eat_nl_glitch);
|
||||||
//opti_move->printDurations();
|
//opti_move->printDurations();
|
||||||
|
|
||||||
// attribute settings
|
// attribute settings
|
||||||
opti_attr->setNoColorVideo (int(attr_without_color));
|
opti_attr->setNoColorVideo (int(FTermcap::attr_without_color));
|
||||||
opti_attr->set_enter_bold_mode (tcap[fc::t_enter_bold_mode].string);
|
opti_attr->set_enter_bold_mode (tcap[fc::t_enter_bold_mode].string);
|
||||||
opti_attr->set_exit_bold_mode (tcap[fc::t_exit_bold_mode].string);
|
opti_attr->set_exit_bold_mode (tcap[fc::t_exit_bold_mode].string);
|
||||||
opti_attr->set_enter_dim_mode (tcap[fc::t_enter_dim_mode].string);
|
opti_attr->set_enter_dim_mode (tcap[fc::t_enter_dim_mode].string);
|
||||||
|
@ -1566,9 +1546,9 @@ void FTerm::init_termcaps()
|
||||||
opti_attr->set_term_color_pair (tcap[fc::t_set_color_pair].string);
|
opti_attr->set_term_color_pair (tcap[fc::t_set_color_pair].string);
|
||||||
opti_attr->set_orig_pair (tcap[fc::t_orig_pair].string);
|
opti_attr->set_orig_pair (tcap[fc::t_orig_pair].string);
|
||||||
opti_attr->set_orig_orig_colors (tcap[fc::t_orig_colors].string);
|
opti_attr->set_orig_orig_colors (tcap[fc::t_orig_colors].string);
|
||||||
opti_attr->setMaxColor (max_color);
|
opti_attr->setMaxColor (FTermcap::max_color);
|
||||||
|
|
||||||
if ( ansi_default_color )
|
if ( FTermcap::ansi_default_color )
|
||||||
opti_attr->setDefaultColorSupport();
|
opti_attr->setDefaultColorSupport();
|
||||||
|
|
||||||
if ( cygwin_terminal )
|
if ( cygwin_terminal )
|
||||||
|
@ -1642,8 +1622,6 @@ void FTerm::init()
|
||||||
char* new_termtype = 0;
|
char* new_termtype = 0;
|
||||||
term_initialized = true;
|
term_initialized = true;
|
||||||
init_term_object = this;
|
init_term_object = this;
|
||||||
x11_button_state = 0x03;
|
|
||||||
max_color = 1;
|
|
||||||
fd_tty = -1;
|
fd_tty = -1;
|
||||||
opti_move = new FOptiMove();
|
opti_move = new FOptiMove();
|
||||||
opti_attr = new FOptiAttr();
|
opti_attr = new FOptiAttr();
|
||||||
|
@ -1681,8 +1659,7 @@ void FTerm::init()
|
||||||
mlterm_terminal = \
|
mlterm_terminal = \
|
||||||
mintty_terminal = \
|
mintty_terminal = \
|
||||||
screen_terminal = \
|
screen_terminal = \
|
||||||
tmux_terminal = \
|
tmux_terminal = false;
|
||||||
background_color_erase = false;
|
|
||||||
|
|
||||||
// Preset to true
|
// Preset to true
|
||||||
cursor_optimisation = true;
|
cursor_optimisation = true;
|
||||||
|
@ -1882,33 +1859,33 @@ void FTerm::init()
|
||||||
unsetNonBlockingInput();
|
unsetNonBlockingInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (max_color == 8)
|
if ( (FTermcap::max_color == 8)
|
||||||
&& ( linux_terminal
|
&& ( linux_terminal
|
||||||
|| cygwin_terminal
|
|| cygwin_terminal
|
||||||
|| putty_terminal
|
|| putty_terminal
|
||||||
|| tera_terminal
|
|| tera_terminal
|
||||||
|| rxvt_terminal) )
|
|| rxvt_terminal) )
|
||||||
{
|
{
|
||||||
max_color = 16;
|
FTermcap::max_color = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( linux_terminal && openConsole() == 0 )
|
if ( linux_terminal && openConsole() == 0 )
|
||||||
{
|
{
|
||||||
if ( isConsole() )
|
if ( isConsole() )
|
||||||
if ( setBlinkAsIntensity(true) != 0 )
|
if ( setBlinkAsIntensity(true) != 0 )
|
||||||
max_color = 8;
|
FTermcap::max_color = 8;
|
||||||
|
|
||||||
closeConsole();
|
closeConsole();
|
||||||
setConsoleCursor(fc::underscore_cursor, true);
|
setConsoleCursor(fc::underscore_cursor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( linux_terminal && getFramebuffer_bpp() >= 4 )
|
if ( linux_terminal && getFramebuffer_bpp() >= 4 )
|
||||||
max_color = 16;
|
FTermcap::max_color = 16;
|
||||||
|
|
||||||
if ( kde_konsole )
|
if ( kde_konsole )
|
||||||
setKDECursor(fc::UnderlineCursor);
|
setKDECursor(fc::UnderlineCursor);
|
||||||
|
|
||||||
if ( max_color >= 16
|
if ( FTermcap::max_color >= 16
|
||||||
&& ! cygwin_terminal
|
&& ! cygwin_terminal
|
||||||
&& ! kde_konsole
|
&& ! kde_konsole
|
||||||
&& ! tera_terminal )
|
&& ! tera_terminal )
|
||||||
|
@ -1987,7 +1964,7 @@ void FTerm::finish()
|
||||||
resetXTermHighlightBackground();
|
resetXTermHighlightBackground();
|
||||||
setXTermCursorStyle(fc::steady_block);
|
setXTermCursorStyle(fc::steady_block);
|
||||||
|
|
||||||
if ( max_color >= 16 && ! (kde_konsole || tera_terminal) )
|
if ( FTermcap::max_color >= 16 && ! (kde_konsole || tera_terminal) )
|
||||||
{
|
{
|
||||||
// reset screen settings
|
// reset screen settings
|
||||||
setPalette (fc::Cyan, 0x18, 0xb2, 0xb2);
|
setPalette (fc::Cyan, 0x18, 0xb2, 0xb2);
|
||||||
|
@ -2019,7 +1996,7 @@ void FTerm::finish()
|
||||||
resetBeep();
|
resetBeep();
|
||||||
|
|
||||||
if ( linux_terminal
|
if ( linux_terminal
|
||||||
&& background_color_erase
|
&& FTermcap::background_color_erase
|
||||||
&& tcap[fc::t_clear_screen].string )
|
&& tcap[fc::t_clear_screen].string )
|
||||||
{
|
{
|
||||||
int rows = term->getHeight();
|
int rows = term->getHeight();
|
||||||
|
@ -2102,6 +2079,59 @@ void FTerm::finish()
|
||||||
delete opti_move;
|
delete opti_move;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
uInt FTerm::cp437_to_unicode (uChar c)
|
||||||
|
{
|
||||||
|
register uInt ucs = uInt(c);
|
||||||
|
|
||||||
|
for (register uInt i=0; i <= lastCP437Item; i++)
|
||||||
|
{
|
||||||
|
if ( cp437_to_ucs[i][0] == c ) // found
|
||||||
|
{
|
||||||
|
ucs = cp437_to_ucs[i][1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ucs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// protected methods of FTerm
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FTerm::init_consoleCharMap()
|
||||||
|
{
|
||||||
|
if ( NewFont || VGAFont )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( screen_unicode_map.entry_ct != 0 )
|
||||||
|
{
|
||||||
|
for (int i=0; i <= lastCharItem; i++ )
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
|
for (uInt n=0; n < screen_unicode_map.entry_ct; n++)
|
||||||
|
{
|
||||||
|
if ( character[i][fc::UTF8] == screen_unicode_map.entries[n].unicode )
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! found )
|
||||||
|
character[i][fc::PC] = character[i][fc::ASCII];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
bool FTerm::charEncodable (uInt c)
|
||||||
|
{
|
||||||
|
uInt ch = charEncode(c);
|
||||||
|
return bool(ch > 0 && ch != c);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
uInt FTerm::charEncode (uInt c)
|
uInt FTerm::charEncode (uInt c)
|
||||||
{
|
{
|
||||||
|
@ -2124,30 +2154,83 @@ uInt FTerm::charEncode (uInt c, fc::encoding enc)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
uInt FTerm::cp437_to_unicode (uChar c)
|
char* FTerm::changeAttribute ( FOptiAttr::char_data*& term_attr
|
||||||
|
, FOptiAttr::char_data*& next_attr )
|
||||||
{
|
{
|
||||||
register uInt ucs = uInt(c);
|
return opti_attr->changeAttribute (term_attr, next_attr);
|
||||||
|
}
|
||||||
|
|
||||||
for (register uInt i=0; i <= lastCP437Item; i++)
|
//----------------------------------------------------------------------
|
||||||
|
void FTerm::xtermMouse (bool on)
|
||||||
{
|
{
|
||||||
if ( cp437_to_ucs[i][0] == c ) // found
|
// activate/deactivate the xterm mouse support
|
||||||
|
if ( ! mouse_support )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( on )
|
||||||
|
putstring (CSI "?1001s" // save old highlight mouse tracking
|
||||||
|
CSI "?1000h" // enable x11 mouse tracking
|
||||||
|
CSI "?1002h" // enable cell motion mouse tracking
|
||||||
|
CSI "?1015h" // enable urxvt mouse mode
|
||||||
|
CSI "?1006h"); // enable SGR mouse mode
|
||||||
|
else
|
||||||
|
putstring (CSI "?1006l" // disable SGR mouse mode
|
||||||
|
CSI "?1015l" // disable urxvt mouse mode
|
||||||
|
CSI "?1002l" // disable cell motion mouse tracking
|
||||||
|
CSI "?1000l" // disable x11 mouse tracking
|
||||||
|
CSI "?1001r"); // restore old highlight mouse tracking
|
||||||
|
|
||||||
|
std::fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef F_HAVE_LIBGPM
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
bool FTerm::gpmMouse (bool on)
|
||||||
{
|
{
|
||||||
ucs = cp437_to_ucs[i][1];
|
// activate/deactivate the gpm mouse support
|
||||||
|
if ( ! linux_terminal )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( openConsole() == 0 )
|
||||||
|
{
|
||||||
|
if ( ! isConsole() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
closeConsole();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( on )
|
||||||
|
{
|
||||||
|
Gpm_Connect conn;
|
||||||
|
conn.eventMask = uInt16(~GPM_MOVE);
|
||||||
|
conn.defaultMask = GPM_MOVE;
|
||||||
|
conn.maxMod = uInt16(~0);
|
||||||
|
conn.minMod = 0;
|
||||||
|
Gpm_Open(&conn, 0);
|
||||||
|
|
||||||
|
switch ( gpm_fd )
|
||||||
|
{
|
||||||
|
case -1:
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case -2:
|
||||||
|
Gpm_Close();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
return ucs;
|
|
||||||
}
|
|
||||||
|
|
||||||
// protected methods of FTerm
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
bool FTerm::charEncodable (uInt c)
|
|
||||||
{
|
{
|
||||||
uInt ch = charEncode(c);
|
Gpm_Close();
|
||||||
return bool(ch > 0 && ch != c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return on;
|
||||||
|
}
|
||||||
|
#endif // F_HAVE_LIBGPM
|
||||||
|
|
||||||
|
|
||||||
// public methods of FTerm
|
// public methods of FTerm
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -2166,7 +2249,7 @@ bool FTerm::setVGAFont()
|
||||||
|
|
||||||
VGAFont = true;
|
VGAFont = true;
|
||||||
|
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
// Set font in xterm to vga
|
// Set font in xterm to vga
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
|
@ -2204,7 +2287,7 @@ bool FTerm::setVGAFont()
|
||||||
else
|
else
|
||||||
VGAFont = false;
|
VGAFont = false;
|
||||||
|
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
closeConsole();
|
closeConsole();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2234,7 +2317,8 @@ bool FTerm::setNewFont()
|
||||||
|| mintty_terminal )
|
|| mintty_terminal )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( xterm_terminal || screen_terminal || urxvt_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal
|
||||||
|
|| urxvt_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
NewFont = true;
|
NewFont = true;
|
||||||
// Set font in xterm to 8x16graph
|
// Set font in xterm to 8x16graph
|
||||||
|
@ -2274,7 +2358,7 @@ bool FTerm::setNewFont()
|
||||||
setUnicodeMap(&unimap);
|
setUnicodeMap(&unimap);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
closeConsole();
|
closeConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2300,7 +2384,8 @@ bool FTerm::setOldFont()
|
||||||
NewFont = \
|
NewFont = \
|
||||||
VGAFont = false;
|
VGAFont = false;
|
||||||
|
|
||||||
if ( xterm_terminal || screen_terminal || urxvt_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal
|
||||||
|
|| urxvt_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
if ( xterm_font && xterm_font->getLength() > 2 )
|
if ( xterm_font && xterm_font->getLength() > 2 )
|
||||||
{
|
{
|
||||||
|
@ -2347,7 +2432,7 @@ bool FTerm::setOldFont()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
closeConsole();
|
closeConsole();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2355,6 +2440,12 @@ bool FTerm::setOldFont()
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
fc::consoleCursorStyle FTerm::getConsoleCursor()
|
||||||
|
{
|
||||||
|
return console_cursor_style;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::setConsoleCursor (fc::consoleCursorStyle style, bool hidden)
|
void FTerm::setConsoleCursor (fc::consoleCursorStyle style, bool hidden)
|
||||||
{
|
{
|
||||||
|
@ -2407,14 +2498,20 @@ char* FTerm::disableCursor()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::getTermSize()
|
void FTerm::detectTermSize()
|
||||||
{
|
{
|
||||||
struct winsize win_size;
|
struct winsize win_size;
|
||||||
|
bool close_after_detect = false;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ( fd_tty < 0 )
|
if ( fd_tty < 0 ) // console is already closed
|
||||||
|
{
|
||||||
|
if ( openConsole() != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
close_after_detect = true;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ioctl (fd_tty, TIOCGWINSZ, &win_size);
|
ret = ioctl (fd_tty, TIOCGWINSZ, &win_size);
|
||||||
|
|
||||||
if ( ret != 0 || win_size.ws_col == 0 || win_size.ws_row == 0 )
|
if ( ret != 0 || win_size.ws_col == 0 || win_size.ws_row == 0 )
|
||||||
|
@ -2432,6 +2529,9 @@ void FTerm::getTermSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
opti_move->setTermSize (term->getWidth(), term->getHeight());
|
opti_move->setTermSize (term->getWidth(), term->getHeight());
|
||||||
|
|
||||||
|
if ( close_after_detect )
|
||||||
|
closeConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -2459,11 +2559,11 @@ void FTerm::setKDECursor (fc::kdeKonsoleCursorShape style)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FString FTerm::getXTermFont()
|
const FString FTerm::getXTermFont()
|
||||||
{
|
{
|
||||||
FString font("");
|
FString font("");
|
||||||
|
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
if ( raw_mode && non_blocking_stdin )
|
if ( raw_mode && non_blocking_stdin )
|
||||||
{
|
{
|
||||||
|
@ -2491,7 +2591,7 @@ FString FTerm::getXTermFont()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FString FTerm::getXTermTitle()
|
const FString FTerm::getXTermTitle()
|
||||||
{
|
{
|
||||||
FString title("");
|
FString title("");
|
||||||
|
|
||||||
|
@ -2537,7 +2637,7 @@ void FTerm::setXTermTitle (const FString& title)
|
||||||
// Set the xterm title
|
// Set the xterm title
|
||||||
if ( xterm_terminal || screen_terminal
|
if ( xterm_terminal || screen_terminal
|
||||||
|| mintty_terminal || putty_terminal
|
|| mintty_terminal || putty_terminal
|
||||||
|| osc_support )
|
|| FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "0;%s" BEL, title.c_str());
|
putstringf (OSC "0;%s" BEL, title.c_str());
|
||||||
|
@ -2552,7 +2652,7 @@ void FTerm::setXTermForeground (const FString& fg)
|
||||||
// Set the VT100 text foreground color
|
// Set the VT100 text foreground color
|
||||||
if ( xterm_terminal || screen_terminal
|
if ( xterm_terminal || screen_terminal
|
||||||
|| mintty_terminal || mlterm_terminal
|
|| mintty_terminal || mlterm_terminal
|
||||||
|| osc_support )
|
|| FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "10;%s" BEL, fg.c_str());
|
putstringf (OSC "10;%s" BEL, fg.c_str());
|
||||||
|
@ -2567,7 +2667,7 @@ void FTerm::setXTermBackground (const FString& bg)
|
||||||
// Set the VT100 text background color
|
// Set the VT100 text background color
|
||||||
if ( xterm_terminal || screen_terminal
|
if ( xterm_terminal || screen_terminal
|
||||||
|| mintty_terminal || mlterm_terminal
|
|| mintty_terminal || mlterm_terminal
|
||||||
|| osc_support )
|
|| FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "11;%s" BEL, bg.c_str());
|
putstringf (OSC "11;%s" BEL, bg.c_str());
|
||||||
|
@ -2582,7 +2682,7 @@ void FTerm::setXTermCursorColor (const FString& cc)
|
||||||
// Set the text cursor color
|
// Set the text cursor color
|
||||||
if ( xterm_terminal || screen_terminal
|
if ( xterm_terminal || screen_terminal
|
||||||
|| mintty_terminal || urxvt_terminal
|
|| mintty_terminal || urxvt_terminal
|
||||||
|| osc_support )
|
|| FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "12;%s" BEL, cc.c_str());
|
putstringf (OSC "12;%s" BEL, cc.c_str());
|
||||||
|
@ -2595,7 +2695,8 @@ void FTerm::setXTermCursorColor (const FString& cc)
|
||||||
void FTerm::setXTermMouseForeground (const FString& mfg)
|
void FTerm::setXTermMouseForeground (const FString& mfg)
|
||||||
{
|
{
|
||||||
// Set the mouse foreground color
|
// Set the mouse foreground color
|
||||||
if ( xterm_terminal || screen_terminal || urxvt_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal
|
||||||
|
|| urxvt_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "13;%s" BEL, mfg.c_str());
|
putstringf (OSC "13;%s" BEL, mfg.c_str());
|
||||||
|
@ -2608,7 +2709,7 @@ void FTerm::setXTermMouseForeground (const FString& mfg)
|
||||||
void FTerm::setXTermMouseBackground (const FString& mbg)
|
void FTerm::setXTermMouseBackground (const FString& mbg)
|
||||||
{
|
{
|
||||||
// Set the mouse background color
|
// Set the mouse background color
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "14;%s" BEL, mbg.c_str());
|
putstringf (OSC "14;%s" BEL, mbg.c_str());
|
||||||
|
@ -2621,7 +2722,8 @@ void FTerm::setXTermMouseBackground (const FString& mbg)
|
||||||
void FTerm::setXTermHighlightBackground (const FString& hbg)
|
void FTerm::setXTermHighlightBackground (const FString& hbg)
|
||||||
{
|
{
|
||||||
// Set the highlight background color
|
// Set the highlight background color
|
||||||
if ( xterm_terminal || screen_terminal || urxvt_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal
|
||||||
|
|| urxvt_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "17;%s" BEL, hbg.c_str());
|
putstringf (OSC "17;%s" BEL, hbg.c_str());
|
||||||
|
@ -2634,7 +2736,7 @@ void FTerm::setXTermHighlightBackground (const FString& hbg)
|
||||||
void FTerm::resetXTermColors()
|
void FTerm::resetXTermColors()
|
||||||
{
|
{
|
||||||
// Reset the entire color table
|
// Reset the entire color table
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "104" BEL);
|
putstringf (OSC "104" BEL);
|
||||||
|
@ -2647,7 +2749,7 @@ void FTerm::resetXTermColors()
|
||||||
void FTerm::resetXTermForeground()
|
void FTerm::resetXTermForeground()
|
||||||
{
|
{
|
||||||
// Reset the VT100 text foreground color
|
// Reset the VT100 text foreground color
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstring (OSC "110" BEL);
|
putstring (OSC "110" BEL);
|
||||||
|
@ -2660,7 +2762,7 @@ void FTerm::resetXTermForeground()
|
||||||
void FTerm::resetXTermBackground()
|
void FTerm::resetXTermBackground()
|
||||||
{
|
{
|
||||||
// Reset the VT100 text background color
|
// Reset the VT100 text background color
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstring (OSC "111" BEL);
|
putstring (OSC "111" BEL);
|
||||||
|
@ -2673,7 +2775,7 @@ void FTerm::resetXTermBackground()
|
||||||
void FTerm::resetXTermCursorColor()
|
void FTerm::resetXTermCursorColor()
|
||||||
{
|
{
|
||||||
// Reset the text cursor color
|
// Reset the text cursor color
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstring (OSC "112" BEL);
|
putstring (OSC "112" BEL);
|
||||||
|
@ -2686,7 +2788,7 @@ void FTerm::resetXTermCursorColor()
|
||||||
void FTerm::resetXTermMouseForeground()
|
void FTerm::resetXTermMouseForeground()
|
||||||
{
|
{
|
||||||
// Reset the mouse foreground color
|
// Reset the mouse foreground color
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstring (OSC "113" BEL);
|
putstring (OSC "113" BEL);
|
||||||
|
@ -2699,7 +2801,7 @@ void FTerm::resetXTermMouseForeground()
|
||||||
void FTerm::resetXTermMouseBackground()
|
void FTerm::resetXTermMouseBackground()
|
||||||
{
|
{
|
||||||
// Reset the mouse background color
|
// Reset the mouse background color
|
||||||
if ( xterm_terminal || screen_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstring (OSC "114" BEL);
|
putstring (OSC "114" BEL);
|
||||||
|
@ -2712,7 +2814,8 @@ void FTerm::resetXTermMouseBackground()
|
||||||
void FTerm::resetXTermHighlightBackground()
|
void FTerm::resetXTermHighlightBackground()
|
||||||
{
|
{
|
||||||
// Reset the highlight background color
|
// Reset the highlight background color
|
||||||
if ( xterm_terminal || screen_terminal || urxvt_terminal || osc_support )
|
if ( xterm_terminal || screen_terminal
|
||||||
|
|| urxvt_terminal || FTermcap::osc_support )
|
||||||
{
|
{
|
||||||
oscPrefix();
|
oscPrefix();
|
||||||
putstringf (OSC "117" BEL);
|
putstringf (OSC "117" BEL);
|
||||||
|
@ -2803,77 +2906,6 @@ void FTerm::setPalette (short index, int r, int g, int b)
|
||||||
std::fflush(stdout);
|
std::fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void FTerm::xtermMouse (bool on)
|
|
||||||
{
|
|
||||||
// activate/deactivate the xterm mouse support
|
|
||||||
if ( ! mouse_support )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( on )
|
|
||||||
putstring (CSI "?1001s" // save old highlight mouse tracking
|
|
||||||
CSI "?1000h" // enable x11 mouse tracking
|
|
||||||
CSI "?1002h" // enable cell motion mouse tracking
|
|
||||||
CSI "?1015h" // enable urxvt mouse mode
|
|
||||||
CSI "?1006h"); // enable SGR mouse mode
|
|
||||||
else
|
|
||||||
putstring (CSI "?1006l" // disable SGR mouse mode
|
|
||||||
CSI "?1015l" // disable urxvt mouse mode
|
|
||||||
CSI "?1002l" // disable cell motion mouse tracking
|
|
||||||
CSI "?1000l" // disable x11 mouse tracking
|
|
||||||
CSI "?1001r"); // restore old highlight mouse tracking
|
|
||||||
|
|
||||||
std::fflush(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
bool FTerm::gpmMouse (bool on)
|
|
||||||
{
|
|
||||||
// activate/deactivate the gpm mouse support
|
|
||||||
if ( ! linux_terminal )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( openConsole() == 0 )
|
|
||||||
{
|
|
||||||
if ( ! isConsole() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
closeConsole();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( on )
|
|
||||||
{
|
|
||||||
Gpm_Connect conn;
|
|
||||||
conn.eventMask = uInt16(~GPM_MOVE);
|
|
||||||
conn.defaultMask = GPM_MOVE;
|
|
||||||
conn.maxMod = uInt16(~0);
|
|
||||||
conn.minMod = 0;
|
|
||||||
Gpm_Open(&conn, 0);
|
|
||||||
|
|
||||||
switch ( gpm_fd )
|
|
||||||
{
|
|
||||||
case -1:
|
|
||||||
return false;
|
|
||||||
|
|
||||||
case -2:
|
|
||||||
Gpm_Close();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Gpm_Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
return on;
|
|
||||||
}
|
|
||||||
#endif // F_HAVE_LIBGPM
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::setBeep (int Hz, int ms)
|
void FTerm::setBeep (int Hz, int ms)
|
||||||
{
|
{
|
||||||
|
@ -3092,7 +3124,7 @@ bool FTerm::setRawMode (bool on)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FString FTerm::getAnswerbackMsg()
|
const FString FTerm::getAnswerbackMsg()
|
||||||
{
|
{
|
||||||
FString answerback = "";
|
FString answerback = "";
|
||||||
|
|
||||||
|
@ -3128,7 +3160,7 @@ FString FTerm::getAnswerbackMsg()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
FString FTerm::getSecDA()
|
const FString FTerm::getSecDA()
|
||||||
{
|
{
|
||||||
FString sec_da_str = "";
|
FString sec_da_str = "";
|
||||||
|
|
||||||
|
|
163
src/fterm.h
163
src/fterm.h
|
@ -129,28 +129,17 @@ class FTerm
|
||||||
static bool linux_terminal;
|
static bool linux_terminal;
|
||||||
static bool screen_terminal;
|
static bool screen_terminal;
|
||||||
static bool tmux_terminal;
|
static bool tmux_terminal;
|
||||||
static bool background_color_erase;
|
|
||||||
static bool automatic_left_margin;
|
|
||||||
static bool automatic_right_margin;
|
|
||||||
static bool eat_nl_glitch;
|
|
||||||
static bool ansi_default_color;
|
|
||||||
static bool osc_support;
|
|
||||||
static char termtype[30];
|
static char termtype[30];
|
||||||
static char* term_name;
|
static char* term_name;
|
||||||
static char* locale_name;
|
static char* locale_name;
|
||||||
static char* locale_xterm;
|
static char* locale_xterm;
|
||||||
static uChar x11_button_state;
|
|
||||||
static FRect* term; // current terminal geometry
|
static FRect* term; // current terminal geometry
|
||||||
static FPoint* mouse; // mouse click position
|
static FPoint* mouse; // mouse click position
|
||||||
|
|
||||||
static int stdin_status_flags;
|
static int stdin_status_flags;
|
||||||
static int stdin_no;
|
|
||||||
static int stdout_no;
|
|
||||||
static int max_color;
|
|
||||||
static int fd_tty;
|
static int fd_tty;
|
||||||
static uInt baudrate;
|
static uInt baudrate;
|
||||||
static bool resize_term;
|
static bool resize_term;
|
||||||
static char exit_message[8192];
|
|
||||||
|
|
||||||
static struct termios term_init;
|
static struct termios term_init;
|
||||||
|
|
||||||
|
@ -177,6 +166,15 @@ class FTerm
|
||||||
dacreg d[16];
|
dacreg d[16];
|
||||||
} map;
|
} map;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static int stdin_no;
|
||||||
|
static int stdout_no;
|
||||||
|
static bool NewFont;
|
||||||
|
static bool VGAFont;
|
||||||
|
static bool cursor_optimisation;
|
||||||
|
static fc::encoding Encoding;
|
||||||
|
static char exit_message[8192];
|
||||||
|
|
||||||
static struct modifier_key // bit field
|
static struct modifier_key // bit field
|
||||||
{
|
{
|
||||||
uChar shift : 1; // 0..1
|
uChar shift : 1; // 0..1
|
||||||
|
@ -186,14 +184,6 @@ class FTerm
|
||||||
uChar : 4; // padding bits
|
uChar : 4; // padding bits
|
||||||
} mod_key;
|
} mod_key;
|
||||||
|
|
||||||
protected:
|
|
||||||
static bool NewFont;
|
|
||||||
static bool VGAFont;
|
|
||||||
static bool cursor_optimisation;
|
|
||||||
static uInt tabstop;
|
|
||||||
static uInt attr_without_color;
|
|
||||||
static fc::encoding Encoding;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
FTerm (const FTerm&);
|
FTerm (const FTerm&);
|
||||||
|
@ -214,7 +204,6 @@ class FTerm
|
||||||
static int setBlinkAsIntensity (bool);
|
static int setBlinkAsIntensity (bool);
|
||||||
static void init_console();
|
static void init_console();
|
||||||
static uInt getBaudRate (const struct termios*);
|
static uInt getBaudRate (const struct termios*);
|
||||||
static void init_consoleCharMap();
|
|
||||||
static char* init_256colorTerminal();
|
static char* init_256colorTerminal();
|
||||||
static char* parseAnswerbackMsg (char*&);
|
static char* parseAnswerbackMsg (char*&);
|
||||||
static char* parseSecDA (char*&);
|
static char* parseSecDA (char*&);
|
||||||
|
@ -226,18 +215,31 @@ class FTerm
|
||||||
static void init_encoding();
|
static void init_encoding();
|
||||||
void init();
|
void init();
|
||||||
void finish();
|
void finish();
|
||||||
static uInt charEncode (uInt);
|
|
||||||
static uInt charEncode (uInt, fc::encoding);
|
|
||||||
static uInt cp437_to_unicode (uChar);
|
static uInt cp437_to_unicode (uChar);
|
||||||
static void signal_handler (int);
|
static void signal_handler (int);
|
||||||
|
|
||||||
// Friend classes
|
|
||||||
friend class FWidget;
|
|
||||||
friend class FVTerm;
|
|
||||||
friend class FApplication;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
static void init_consoleCharMap();
|
||||||
static bool charEncodable (uInt);
|
static bool charEncodable (uInt);
|
||||||
|
static uInt charEncode (uInt);
|
||||||
|
static uInt charEncode (uInt, fc::encoding);
|
||||||
|
static char* changeAttribute ( FOptiAttr::char_data*&
|
||||||
|
, FOptiAttr::char_data*& );
|
||||||
|
static bool hasChangedTermSize();
|
||||||
|
static void changeTermSizeFinished();
|
||||||
|
static void xtermMouse (bool);
|
||||||
|
static void enableXTermMouse();
|
||||||
|
static void disableXTermMouse();
|
||||||
|
|
||||||
|
#ifdef F_HAVE_LIBGPM
|
||||||
|
static bool gpmMouse (bool);
|
||||||
|
static bool enableGpmMouse();
|
||||||
|
static bool disableGpmMouse();
|
||||||
|
static bool isGpmMouseEnabled();
|
||||||
|
#endif // F_HAVE_LIBGPM
|
||||||
|
static FPoint& getMousePos();
|
||||||
|
static void setMousePos (FPoint&);
|
||||||
|
static void setMousePos (short, short);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -252,10 +254,10 @@ class FTerm
|
||||||
static int getLineNumber();
|
static int getLineNumber();
|
||||||
static int getColumnNumber();
|
static int getColumnNumber();
|
||||||
static FString getKeyName (int);
|
static FString getKeyName (int);
|
||||||
static void getModifierKey();
|
static modifier_key& getModifierKey();
|
||||||
|
|
||||||
static char* getTermType();
|
static char* getTermType();
|
||||||
static char* getTermName();
|
static char* getTermName();
|
||||||
|
static uInt getTabstop();
|
||||||
static bool hasPCcharset();
|
static bool hasPCcharset();
|
||||||
static bool hasUTF8();
|
static bool hasUTF8();
|
||||||
static bool hasVT100();
|
static bool hasVT100();
|
||||||
|
@ -275,20 +277,22 @@ class FTerm
|
||||||
static bool isLinuxTerm();
|
static bool isLinuxTerm();
|
||||||
static bool isScreenTerm();
|
static bool isScreenTerm();
|
||||||
static bool isTmuxTerm();
|
static bool isTmuxTerm();
|
||||||
|
static bool isInputDataPending();
|
||||||
static bool setVGAFont();
|
static bool setVGAFont();
|
||||||
static bool setNewFont();
|
static bool setNewFont();
|
||||||
static bool isNewFont();
|
static bool isNewFont();
|
||||||
static bool setOldFont();
|
static bool setOldFont();
|
||||||
static bool setCursorOptimisation (bool);
|
static bool setCursorOptimisation (bool);
|
||||||
|
static fc::consoleCursorStyle getConsoleCursor();
|
||||||
static void setConsoleCursor (fc::consoleCursorStyle, bool);
|
static void setConsoleCursor (fc::consoleCursorStyle, bool);
|
||||||
static char* moveCursor (int, int, int, int);
|
static char* moveCursor (int, int, int, int);
|
||||||
static char* enableCursor();
|
static char* enableCursor();
|
||||||
static char* disableCursor();
|
static char* disableCursor();
|
||||||
static void getTermSize();
|
static void detectTermSize();
|
||||||
static void setTermSize (int, int);
|
static void setTermSize (int, int);
|
||||||
static void setKDECursor (fc::kdeKonsoleCursorShape);
|
static void setKDECursor (fc::kdeKonsoleCursorShape);
|
||||||
static FString getXTermFont();
|
static const FString getXTermFont();
|
||||||
static FString getXTermTitle();
|
static const FString getXTermTitle();
|
||||||
static void setXTermCursorStyle (fc::xtermCursorStyle);
|
static void setXTermCursorStyle (fc::xtermCursorStyle);
|
||||||
static void setXTermTitle (const FString&);
|
static void setXTermTitle (const FString&);
|
||||||
static void setXTermForeground (const FString&);
|
static void setXTermForeground (const FString&);
|
||||||
|
@ -308,16 +312,6 @@ class FTerm
|
||||||
static void resetColorMap();
|
static void resetColorMap();
|
||||||
static void setPalette (short, int, int, int);
|
static void setPalette (short, int, int, int);
|
||||||
static int getMaxColor();
|
static int getMaxColor();
|
||||||
static void xtermMouse (bool);
|
|
||||||
static void enableXTermMouse();
|
|
||||||
static void disableXTermMouse();
|
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
|
||||||
static bool gpmMouse (bool);
|
|
||||||
static bool enableGpmMouse();
|
|
||||||
static bool disableGpmMouse();
|
|
||||||
#endif // F_HAVE_LIBGPM
|
|
||||||
|
|
||||||
static void setBeep (int, int);
|
static void setBeep (int, int);
|
||||||
static void resetBeep();
|
static void resetBeep();
|
||||||
static void beep();
|
static void beep();
|
||||||
|
@ -344,10 +338,11 @@ class FTerm
|
||||||
static bool setCookedMode();
|
static bool setCookedMode();
|
||||||
static bool isRaw();
|
static bool isRaw();
|
||||||
|
|
||||||
static FString getAnswerbackMsg();
|
static const FString getAnswerbackMsg();
|
||||||
static FString getSecDA();
|
static const FString getSecDA();
|
||||||
|
|
||||||
static int (*Fputchar)(int); // function pointer -> static function
|
// function pointer -> static function
|
||||||
|
static int (*Fputchar)(int);
|
||||||
static void putstringf (const char*, ...)
|
static void putstringf (const char*, ...)
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
__attribute__((__format__ (__printf__, 1, 2)))
|
__attribute__((__format__ (__printf__, 1, 2)))
|
||||||
|
@ -364,6 +359,52 @@ class FTerm
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
// FTerm inline functions
|
// FTerm inline functions
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FTerm::hasChangedTermSize()
|
||||||
|
{ return resize_term; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FTerm::changeTermSizeFinished()
|
||||||
|
{ resize_term = false; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FTerm::enableXTermMouse()
|
||||||
|
{ xtermMouse(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FTerm::disableXTermMouse()
|
||||||
|
{ xtermMouse(false); }
|
||||||
|
|
||||||
|
#ifdef F_HAVE_LIBGPM
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FTerm::enableGpmMouse()
|
||||||
|
{ return gpmMouse(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FTerm::disableGpmMouse()
|
||||||
|
{ return gpmMouse(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FTerm::isGpmMouseEnabled()
|
||||||
|
{ return gpm_mouse_enabled; }
|
||||||
|
#endif // F_HAVE_LIBGPM
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline FPoint& FTerm::getMousePos()
|
||||||
|
{ return *mouse; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FTerm::setMousePos (FPoint& m)
|
||||||
|
{ *mouse = m; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FTerm::setMousePos (short x, short y)
|
||||||
|
{ mouse->setPoint (x, y); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FTerm::setNonBlockingInput()
|
||||||
|
{ return setNonBlockingInput(true); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline const char* FTerm::getClassName() const
|
inline const char* FTerm::getClassName() const
|
||||||
{ return "FTerm"; }
|
{ return "FTerm"; }
|
||||||
|
@ -376,6 +417,10 @@ inline char* FTerm::getTermType()
|
||||||
inline char* FTerm::getTermName()
|
inline char* FTerm::getTermName()
|
||||||
{ return term_name; }
|
{ return term_name; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline uInt FTerm::getTabstop()
|
||||||
|
{ return FTermcap::tabstop; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FTerm::hasPCcharset()
|
inline bool FTerm::hasPCcharset()
|
||||||
{ return pc_charset_console; }
|
{ return pc_charset_console; }
|
||||||
|
@ -456,6 +501,10 @@ inline bool FTerm::isScreenTerm()
|
||||||
inline bool FTerm::isTmuxTerm()
|
inline bool FTerm::isTmuxTerm()
|
||||||
{ return tmux_terminal; }
|
{ return tmux_terminal; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FTerm::isInputDataPending()
|
||||||
|
{ return input_data_pending; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FTerm::setCursorOptimisation (bool on)
|
inline bool FTerm::setCursorOptimisation (bool on)
|
||||||
{ return cursor_optimisation = (on) ? true : false; }
|
{ return cursor_optimisation = (on) ? true : false; }
|
||||||
|
@ -466,29 +515,7 @@ inline bool FTerm::isRaw()
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline int FTerm::getMaxColor()
|
inline int FTerm::getMaxColor()
|
||||||
{ return max_color; }
|
{ return FTermcap::max_color; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline void FTerm::enableXTermMouse()
|
|
||||||
{ xtermMouse(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline void FTerm::disableXTermMouse()
|
|
||||||
{ xtermMouse(false); }
|
|
||||||
|
|
||||||
#ifdef F_HAVE_LIBGPM
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FTerm::enableGpmMouse()
|
|
||||||
{ return gpmMouse(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FTerm::disableGpmMouse()
|
|
||||||
{ return gpmMouse(false); }
|
|
||||||
#endif // F_HAVE_LIBGPM
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FTerm::setNonBlockingInput()
|
|
||||||
{ return setNonBlockingInput(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FTerm::unsetNonBlockingInput()
|
inline bool FTerm::unsetNonBlockingInput()
|
||||||
|
|
|
@ -29,6 +29,16 @@ class FTermcap
|
||||||
}
|
}
|
||||||
tcap_map;
|
tcap_map;
|
||||||
|
|
||||||
|
static bool background_color_erase;
|
||||||
|
static bool automatic_left_margin;
|
||||||
|
static bool automatic_right_margin;
|
||||||
|
static bool eat_nl_glitch;
|
||||||
|
static bool ansi_default_color;
|
||||||
|
static bool osc_support;
|
||||||
|
static int max_color;
|
||||||
|
static uInt tabstop;
|
||||||
|
static uInt attr_without_color;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static tcap_map* tcap;
|
static tcap_map* tcap;
|
||||||
|
|
||||||
|
|
|
@ -823,7 +823,7 @@ void FTextView::insert (const FString& str, int pos)
|
||||||
if ( str.isEmpty() )
|
if ( str.isEmpty() )
|
||||||
s = "\n";
|
s = "\n";
|
||||||
else
|
else
|
||||||
s = FString(str).rtrim().expandTabs(tabstop);
|
s = FString(str).rtrim().expandTabs(getTabstop());
|
||||||
|
|
||||||
iter = data.begin();
|
iter = data.begin();
|
||||||
text_split = s.split("\r\n");
|
text_split = s.split("\r\n");
|
||||||
|
|
|
@ -11,9 +11,9 @@ static FVTerm* init_object = 0;
|
||||||
|
|
||||||
// static class attributes
|
// static class attributes
|
||||||
bool FVTerm::hidden_cursor;
|
bool FVTerm::hidden_cursor;
|
||||||
|
bool FVTerm::terminal_update_complete;
|
||||||
bool FVTerm::terminal_update_pending;
|
bool FVTerm::terminal_update_pending;
|
||||||
bool FVTerm::force_terminal_update;
|
bool FVTerm::force_terminal_update;
|
||||||
bool FVTerm::terminal_updates;
|
|
||||||
bool FVTerm::stop_terminal_updates;
|
bool FVTerm::stop_terminal_updates;
|
||||||
bool FVTerm::vterm_updates;
|
bool FVTerm::vterm_updates;
|
||||||
int FVTerm::skipped_terminal_update = 0;
|
int FVTerm::skipped_terminal_update = 0;
|
||||||
|
@ -40,7 +40,7 @@ FVTerm::FVTerm (FVTerm* parent)
|
||||||
, print_area(0)
|
, print_area(0)
|
||||||
, vwin(0)
|
, vwin(0)
|
||||||
{
|
{
|
||||||
terminal_updates = false;
|
terminal_update_complete = false;
|
||||||
vterm_updates = true;
|
vterm_updates = true;
|
||||||
|
|
||||||
if ( ! parent )
|
if ( ! parent )
|
||||||
|
@ -103,11 +103,12 @@ void FVTerm::init()
|
||||||
tcap = FTermcap().getTermcapMap();
|
tcap = FTermcap().getTermcapMap();
|
||||||
|
|
||||||
// create virtual terminal
|
// create virtual terminal
|
||||||
createVTerm (*term);
|
FRect term_geometry (1, 1, getColumnNumber(), getLineNumber());
|
||||||
|
createVTerm (term_geometry);
|
||||||
|
|
||||||
// create virtual desktop area
|
// create virtual desktop area
|
||||||
FPoint shadow_size(0,0);
|
FPoint shadow_size(0,0);
|
||||||
createArea (*term, shadow_size, vdesktop);
|
createArea (term_geometry, shadow_size, vdesktop);
|
||||||
vdesktop->visible = true;
|
vdesktop->visible = true;
|
||||||
active_area = vdesktop;
|
active_area = vdesktop;
|
||||||
|
|
||||||
|
@ -1250,6 +1251,18 @@ FOptiAttr::char_data FVTerm::getOverlappedCharacter ( const FPoint& pos
|
||||||
return getCharacter (overlapped_character, pos.getX(), pos.getY(), obj);
|
return getCharacter (overlapped_character, pos.getX(), pos.getY(), obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FVTerm::startTerminalUpdate()
|
||||||
|
{
|
||||||
|
terminal_update_complete = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FVTerm::finishTerminalUpdate()
|
||||||
|
{
|
||||||
|
terminal_update_complete = true;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FVTerm::setTermXY (register int x, register int y)
|
void FVTerm::setTermXY (register int x, register int y)
|
||||||
{
|
{
|
||||||
|
@ -1260,8 +1273,8 @@ void FVTerm::setTermXY (register int x, register int y)
|
||||||
if ( term_pos->getX() == x && term_pos->getY() == y )
|
if ( term_pos->getX() == x && term_pos->getY() == y )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
term_width = term->getWidth();
|
term_width = getColumnNumber();
|
||||||
term_height = term->getHeight();
|
term_height = getLineNumber();
|
||||||
|
|
||||||
if ( x >= term_width )
|
if ( x >= term_width )
|
||||||
{
|
{
|
||||||
|
@ -1315,7 +1328,7 @@ bool FVTerm::hideCursor (bool on)
|
||||||
flush_out();
|
flush_out();
|
||||||
|
|
||||||
if ( ! hidden_cursor && isLinuxTerm() )
|
if ( ! hidden_cursor && isLinuxTerm() )
|
||||||
setConsoleCursor (console_cursor_style, false);
|
setConsoleCursor (getConsoleCursor(), false);
|
||||||
|
|
||||||
return hidden_cursor;
|
return hidden_cursor;
|
||||||
}
|
}
|
||||||
|
@ -1381,10 +1394,10 @@ void FVTerm::updateTerminal()
|
||||||
|
|
||||||
if ( ! force_terminal_update )
|
if ( ! force_terminal_update )
|
||||||
{
|
{
|
||||||
if ( ! terminal_updates )
|
if ( ! terminal_update_complete )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( input_data_pending )
|
if ( isInputDataPending() )
|
||||||
{
|
{
|
||||||
terminal_update_pending = true;
|
terminal_update_pending = true;
|
||||||
return;
|
return;
|
||||||
|
@ -1431,11 +1444,11 @@ void FVTerm::updateTerminal()
|
||||||
term_pos->x_ref()--;
|
term_pos->x_ref()--;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( eat_nl_glitch )
|
if ( FTermcap::eat_nl_glitch )
|
||||||
{
|
{
|
||||||
term_pos->setPoint(-1,-1);
|
term_pos->setPoint(-1,-1);
|
||||||
}
|
}
|
||||||
else if ( automatic_right_margin )
|
else if ( FTermcap::automatic_right_margin )
|
||||||
{
|
{
|
||||||
term_pos->setX(0);
|
term_pos->setX(0);
|
||||||
term_pos->y_ref()++;
|
term_pos->y_ref()++;
|
||||||
|
@ -1502,7 +1515,9 @@ void FVTerm::processTerminalUpdate()
|
||||||
bool FVTerm::isInsideTerminal (int x, int y)
|
bool FVTerm::isInsideTerminal (int x, int y)
|
||||||
{
|
{
|
||||||
// Check whether the coordinates are within the virtual terminal
|
// Check whether the coordinates are within the virtual terminal
|
||||||
if ( term->contains(x,y) )
|
FRect term_geometry (1, 1, getColumnNumber(), getLineNumber());
|
||||||
|
|
||||||
|
if ( term_geometry.contains(x,y) )
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
@ -1650,6 +1665,7 @@ int FVTerm::print (FVTerm::term_area* area, FString& s)
|
||||||
assert ( ! s.isNull() );
|
assert ( ! s.isNull() );
|
||||||
register int len = 0;
|
register int len = 0;
|
||||||
const wchar_t* p;
|
const wchar_t* p;
|
||||||
|
uInt tabstop = getTabstop();
|
||||||
FWidget* window;
|
FWidget* window;
|
||||||
|
|
||||||
if ( ! area )
|
if ( ! area )
|
||||||
|
@ -1975,7 +1991,7 @@ inline void FVTerm::charsetChanges (FOptiAttr::char_data*& next_char)
|
||||||
{
|
{
|
||||||
next_char->pc_charset = true;
|
next_char->pc_charset = true;
|
||||||
|
|
||||||
if ( isXTerminal() && utf8_console && ch < 0x20 ) // Character 0x00..0x1f
|
if ( isXTerminal() && hasUTF8() && ch < 0x20 ) // Character 0x00..0x1f
|
||||||
next_char->code = int(charEncode(code, fc::ASCII));
|
next_char->code = int(charEncode(code, fc::ASCII));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1998,7 +2014,7 @@ inline void FVTerm::appendAttributes (FOptiAttr::char_data*& next_attr)
|
||||||
FOptiAttr::char_data* term_attr = &term_attribute;
|
FOptiAttr::char_data* term_attr = &term_attribute;
|
||||||
|
|
||||||
// generate attribute string for the next character
|
// generate attribute string for the next character
|
||||||
attr_str = opti_attr->change_attribute (term_attr, next_attr);
|
attr_str = changeAttribute (term_attr, next_attr);
|
||||||
|
|
||||||
if ( attr_str )
|
if ( attr_str )
|
||||||
appendOutputBuffer (attr_str);
|
appendOutputBuffer (attr_str);
|
||||||
|
@ -2010,7 +2026,7 @@ int FVTerm::appendLowerRight (FOptiAttr::char_data*& screen_char)
|
||||||
char* SA = tcap[fc::t_enter_am_mode].string;
|
char* SA = tcap[fc::t_enter_am_mode].string;
|
||||||
char* RA = tcap[fc::t_exit_am_mode].string;
|
char* RA = tcap[fc::t_exit_am_mode].string;
|
||||||
|
|
||||||
if ( ! automatic_right_margin )
|
if ( ! FTermcap::automatic_right_margin )
|
||||||
{
|
{
|
||||||
appendCharacter (screen_char);
|
appendCharacter (screen_char);
|
||||||
}
|
}
|
||||||
|
@ -2029,8 +2045,8 @@ int FVTerm::appendLowerRight (FOptiAttr::char_data*& screen_char)
|
||||||
char* ip = tcap[fc::t_insert_padding].string;
|
char* ip = tcap[fc::t_insert_padding].string;
|
||||||
char* ic = tcap[fc::t_insert_character].string;
|
char* ic = tcap[fc::t_insert_character].string;
|
||||||
|
|
||||||
x = term->getWidth() - 2;
|
x = getColumnNumber() - 2;
|
||||||
y = term->getHeight() - 1;
|
y = getLineNumber() - 1;
|
||||||
setTermXY (x, y);
|
setTermXY (x, y);
|
||||||
appendCharacter (screen_char);
|
appendCharacter (screen_char);
|
||||||
term_pos->x_ref()++;
|
term_pos->x_ref()++;
|
||||||
|
|
394
src/fvterm.h
394
src/fvterm.h
|
@ -11,10 +11,17 @@
|
||||||
// │ │
|
// │ │
|
||||||
// └─────┬─────┘
|
// └─────┬─────┘
|
||||||
// │
|
// │
|
||||||
// ▕▔▔▔▔▔▔▔▔▏
|
// ▕▔▔▔▔▔▔▔▔▏ 1 *▕▔▔▔▔▔▔▔▔▔▏
|
||||||
// ▕ FVTerm ▏
|
// ▕ FVTerm ▏-┬- - - -▕ FString ▏
|
||||||
// ▕▁▁▁▁▁▁▁▁▏
|
// ▕▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▁▁▏
|
||||||
|
// :
|
||||||
|
// : *▕▔▔▔▔▔▔▔▔▏
|
||||||
|
// :- - - -▕ FPoint ▏
|
||||||
|
// : ▕▁▁▁▁▁▁▁▁▏
|
||||||
|
// :
|
||||||
|
// : *▕▔▔▔▔▔▔▔▏
|
||||||
|
// └- - - -▕ FRect ▏
|
||||||
|
// ▕▁▁▁▁▁▁▁▏
|
||||||
|
|
||||||
#ifndef _FVTERM_H
|
#ifndef _FVTERM_H
|
||||||
#define _FVTERM_H
|
#define _FVTERM_H
|
||||||
|
@ -47,9 +54,9 @@ class FVTerm : public FObject, public FTerm
|
||||||
static FTermcap::tcap_map* tcap;
|
static FTermcap::tcap_map* tcap;
|
||||||
|
|
||||||
static bool hidden_cursor;
|
static bool hidden_cursor;
|
||||||
|
static bool terminal_update_complete;
|
||||||
static bool terminal_update_pending;
|
static bool terminal_update_pending;
|
||||||
static bool force_terminal_update;
|
static bool force_terminal_update;
|
||||||
static bool terminal_updates;
|
|
||||||
static bool stop_terminal_updates;
|
static bool stop_terminal_updates;
|
||||||
static bool vterm_updates;
|
static bool vterm_updates;
|
||||||
static int skipped_terminal_update;
|
static int skipped_terminal_update;
|
||||||
|
@ -128,6 +135,8 @@ class FVTerm : public FObject, public FTerm
|
||||||
static FOptiAttr::char_data getCoveredCharacter (int, int, FVTerm*);
|
static FOptiAttr::char_data getCoveredCharacter (int, int, FVTerm*);
|
||||||
static FOptiAttr::char_data getOverlappedCharacter (const FPoint&, FVTerm*);
|
static FOptiAttr::char_data getOverlappedCharacter (const FPoint&, FVTerm*);
|
||||||
static FOptiAttr::char_data getOverlappedCharacter (int, int, FVTerm*);
|
static FOptiAttr::char_data getOverlappedCharacter (int, int, FVTerm*);
|
||||||
|
static void startTerminalUpdate();
|
||||||
|
static void finishTerminalUpdate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
|
@ -140,9 +149,6 @@ class FVTerm : public FObject, public FTerm
|
||||||
term_area* getPrintArea();
|
term_area* getPrintArea();
|
||||||
void setPrintArea (term_area*);
|
void setPrintArea (term_area*);
|
||||||
|
|
||||||
// Friend class
|
|
||||||
friend class FWidget;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit FVTerm (FVTerm* = 0);
|
explicit FVTerm (FVTerm* = 0);
|
||||||
|
@ -204,6 +210,89 @@ class FVTerm : public FObject, public FTerm
|
||||||
static void appendOutputBuffer (const char*);
|
static void appendOutputBuffer (const char*);
|
||||||
static int appendOutputBuffer (int);
|
static int appendOutputBuffer (int);
|
||||||
static void flush_out();
|
static void flush_out();
|
||||||
|
|
||||||
|
void setColor (short, short);
|
||||||
|
static void setNormal();
|
||||||
|
|
||||||
|
static bool setBold (register bool);
|
||||||
|
static bool setBold();
|
||||||
|
static bool unsetBold();
|
||||||
|
static bool isBold();
|
||||||
|
|
||||||
|
static bool setDim (register bool);
|
||||||
|
static bool setDim();
|
||||||
|
static bool unsetDim();
|
||||||
|
static bool isDim();
|
||||||
|
|
||||||
|
static bool setItalic (register bool);
|
||||||
|
static bool setItalic();
|
||||||
|
static bool unsetItalic();
|
||||||
|
static bool isItalic();
|
||||||
|
|
||||||
|
static bool setUnderline (register bool);
|
||||||
|
static bool setUnderline();
|
||||||
|
static bool unsetUnderline();
|
||||||
|
static bool isUnderline();
|
||||||
|
|
||||||
|
static bool setBlink (register bool);
|
||||||
|
static bool setBlink();
|
||||||
|
static bool unsetBlink();
|
||||||
|
static bool isBlink();
|
||||||
|
|
||||||
|
static bool setReverse (register bool);
|
||||||
|
static bool setReverse();
|
||||||
|
static bool unsetReverse();
|
||||||
|
static bool isReverse();
|
||||||
|
|
||||||
|
static bool setStandout (register bool);
|
||||||
|
static bool setStandout();
|
||||||
|
static bool unsetStandout();
|
||||||
|
static bool isStandout();
|
||||||
|
|
||||||
|
static bool setInvisible (register bool);
|
||||||
|
static bool setInvisible();
|
||||||
|
static bool unsetInvisible();
|
||||||
|
static bool isInvisible();
|
||||||
|
|
||||||
|
static bool setProtected (register bool);
|
||||||
|
static bool setProtected();
|
||||||
|
static bool unsetProtected();
|
||||||
|
static bool isProtected();
|
||||||
|
|
||||||
|
static bool setCrossedOut (register bool);
|
||||||
|
static bool setCrossedOut();
|
||||||
|
static bool unsetCrossedOut();
|
||||||
|
static bool isCrossedOut();
|
||||||
|
|
||||||
|
static bool setDoubleUnderline (register bool);
|
||||||
|
static bool setDoubleUnderline();
|
||||||
|
static bool unsetDoubleUnderline();
|
||||||
|
static bool isDoubleUnderline();
|
||||||
|
|
||||||
|
static bool setAltCharset (register bool);
|
||||||
|
static bool setAltCharset();
|
||||||
|
static bool unsetAltCharset();
|
||||||
|
static bool isAltCharset();
|
||||||
|
|
||||||
|
static bool setPCcharset (register bool);
|
||||||
|
static bool setPCcharset();
|
||||||
|
static bool unsetPCcharset();
|
||||||
|
static bool isPCcharset();
|
||||||
|
|
||||||
|
static bool setTransparent (register bool);
|
||||||
|
static bool setTransparent();
|
||||||
|
static bool unsetTransparent();
|
||||||
|
static bool isTransparent();
|
||||||
|
|
||||||
|
static bool setTransShadow (register bool);
|
||||||
|
static bool setTransShadow();
|
||||||
|
static bool unsetTransShadow();
|
||||||
|
static bool isTransShadow();
|
||||||
|
|
||||||
|
static bool setInheritBackground (register bool);
|
||||||
|
static bool setInheritBackground();
|
||||||
|
static bool unsetInheritBackground();
|
||||||
|
static bool isInheritBackground();
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
@ -249,4 +338,293 @@ inline void FVTerm::setPrintCursor (const FPoint& pos)
|
||||||
inline void FVTerm::setPrintCursor (register int x, register int y)
|
inline void FVTerm::setPrintCursor (register int x, register int y)
|
||||||
{ cursor->setPoint(x,y); }
|
{ cursor->setPoint(x,y); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FVTerm::setColor (register short fg, register short bg)
|
||||||
|
{
|
||||||
|
// Changes colors
|
||||||
|
next_attribute.fg_color = fg;
|
||||||
|
next_attribute.bg_color = bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FVTerm::setNormal()
|
||||||
|
{
|
||||||
|
// reset all character attributes
|
||||||
|
next_attribute.bold = \
|
||||||
|
next_attribute.dim = \
|
||||||
|
next_attribute.italic = \
|
||||||
|
next_attribute.underline = \
|
||||||
|
next_attribute.blink = \
|
||||||
|
next_attribute.reverse = \
|
||||||
|
next_attribute.standout = \
|
||||||
|
next_attribute.invisible = \
|
||||||
|
next_attribute.protect = \
|
||||||
|
next_attribute.crossed_out = \
|
||||||
|
next_attribute.dbl_underline = \
|
||||||
|
next_attribute.alt_charset = \
|
||||||
|
next_attribute.pc_charset = \
|
||||||
|
next_attribute.transparent = \
|
||||||
|
next_attribute.trans_shadow = \
|
||||||
|
next_attribute.inherit_bg = false;
|
||||||
|
|
||||||
|
next_attribute.fg_color = fc::Default;
|
||||||
|
next_attribute.bg_color = fc::Default;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setBold (register bool on)
|
||||||
|
{ return (next_attribute.bold = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setBold()
|
||||||
|
{ return setBold(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetBold()
|
||||||
|
{ return setBold(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isBold()
|
||||||
|
{ return next_attribute.bold; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setDim (register bool on)
|
||||||
|
{ return (next_attribute.dim = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setDim()
|
||||||
|
{ return setDim(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetDim()
|
||||||
|
{ return setDim(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isDim()
|
||||||
|
{ return next_attribute.dim; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setItalic (register bool on)
|
||||||
|
{ return (next_attribute.italic = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setItalic()
|
||||||
|
{ return setItalic(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetItalic()
|
||||||
|
{ return setItalic(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isItalic()
|
||||||
|
{ return next_attribute.italic; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setUnderline (register bool on)
|
||||||
|
{ return (next_attribute.underline = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setUnderline()
|
||||||
|
{ return setUnderline(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetUnderline()
|
||||||
|
{ return setUnderline(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isUnderline()
|
||||||
|
{ return next_attribute.underline; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setBlink (register bool on)
|
||||||
|
{ return (next_attribute.blink = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setBlink()
|
||||||
|
{ return setBlink(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetBlink()
|
||||||
|
{ return setBlink(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isBlink()
|
||||||
|
{ return next_attribute.blink; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setReverse (register bool on)
|
||||||
|
{ return (next_attribute.reverse = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setReverse()
|
||||||
|
{ return setReverse(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetReverse()
|
||||||
|
{ return setReverse(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isReverse()
|
||||||
|
{ return next_attribute.reverse; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setStandout (register bool on)
|
||||||
|
{ return (next_attribute.standout = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setStandout()
|
||||||
|
{ return setStandout(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetStandout()
|
||||||
|
{ return setStandout(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isStandout()
|
||||||
|
{ return next_attribute.standout; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setInvisible (register bool on)
|
||||||
|
{ return (next_attribute.invisible = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setInvisible()
|
||||||
|
{ return setInvisible(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetInvisible()
|
||||||
|
{ return setInvisible(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isInvisible()
|
||||||
|
{ return next_attribute.invisible; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setProtected (register bool on)
|
||||||
|
{ return (next_attribute.protect = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setProtected()
|
||||||
|
{ return setProtected(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetProtected()
|
||||||
|
{ return setProtected(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isProtected()
|
||||||
|
{ return next_attribute.protect; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setCrossedOut (register bool on)
|
||||||
|
{ return (next_attribute.crossed_out = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setCrossedOut()
|
||||||
|
{ return setCrossedOut(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetCrossedOut()
|
||||||
|
{ return setCrossedOut(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isCrossedOut()
|
||||||
|
{ return next_attribute.crossed_out; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setDoubleUnderline (register bool on)
|
||||||
|
{ return (next_attribute.dbl_underline = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setDoubleUnderline()
|
||||||
|
{ return setDoubleUnderline(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetDoubleUnderline()
|
||||||
|
{ return setDoubleUnderline(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isDoubleUnderline()
|
||||||
|
{ return next_attribute.dbl_underline; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setAltCharset (register bool on)
|
||||||
|
{ return (next_attribute.alt_charset = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setAltCharset()
|
||||||
|
{ return setAltCharset(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetAltCharset()
|
||||||
|
{ return setAltCharset(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isAltCharset()
|
||||||
|
{ return next_attribute.alt_charset; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setPCcharset (register bool on)
|
||||||
|
{ return (next_attribute.pc_charset = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setPCcharset()
|
||||||
|
{ return setPCcharset(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetPCcharset()
|
||||||
|
{ return setPCcharset(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isPCcharset()
|
||||||
|
{ return next_attribute.pc_charset; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setTransparent (register bool on)
|
||||||
|
{ return (next_attribute.transparent = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setTransparent()
|
||||||
|
{ return setTransparent(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetTransparent()
|
||||||
|
{ return setTransparent(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isTransparent()
|
||||||
|
{ return next_attribute.transparent; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setTransShadow (register bool on)
|
||||||
|
{ return (next_attribute.trans_shadow = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setTransShadow()
|
||||||
|
{ return setTransShadow(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetTransShadow()
|
||||||
|
{ return setTransShadow(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isTransShadow()
|
||||||
|
{ return next_attribute.trans_shadow; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setInheritBackground (register bool on)
|
||||||
|
{ return (next_attribute.inherit_bg = on); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::setInheritBackground()
|
||||||
|
{ return setInheritBackground(true); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::unsetInheritBackground()
|
||||||
|
{ return setInheritBackground(false); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FVTerm::isInheritBackground()
|
||||||
|
{ return next_attribute.inherit_bg; }
|
||||||
|
|
||||||
#endif // _FVTERM_H
|
#endif // _FVTERM_H
|
||||||
|
|
|
@ -58,8 +58,6 @@ FWidget::FWidget (FWidget* parent)
|
||||||
, background_color(fc::Default)
|
, background_color(fc::Default)
|
||||||
, statusbar_message()
|
, statusbar_message()
|
||||||
{
|
{
|
||||||
resize_term = false;
|
|
||||||
|
|
||||||
if ( ! parent )
|
if ( ! parent )
|
||||||
{
|
{
|
||||||
assert ( ! rootObject
|
assert ( ! rootObject
|
||||||
|
@ -125,10 +123,10 @@ void FWidget::init()
|
||||||
close_widget = new widgetList();
|
close_widget = new widgetList();
|
||||||
|
|
||||||
// determine width and height of the terminal
|
// determine width and height of the terminal
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
wsize.setRect(1, 1, term->getWidth(), term->getHeight());
|
wsize.setRect(1, 1, getColumnNumber(), getLineNumber());
|
||||||
adjust_wsize = wsize;
|
adjust_wsize = wsize;
|
||||||
offset.setRect(0, 0, term->getWidth(), term->getHeight());
|
offset.setRect(0, 0, getColumnNumber(), getLineNumber());
|
||||||
client_offset = offset;
|
client_offset = offset;
|
||||||
|
|
||||||
double_flatline_mask.top.resize (uLong(getWidth()), false);
|
double_flatline_mask.top.resize (uLong(getWidth()), false);
|
||||||
|
@ -270,13 +268,13 @@ void FWidget::setColorTheme()
|
||||||
wc.progressbar_fg = fc::DarkGray;
|
wc.progressbar_fg = fc::DarkGray;
|
||||||
wc.progressbar_bg = fc::LightBlue;
|
wc.progressbar_bg = fc::LightBlue;
|
||||||
|
|
||||||
if ( kde_konsole )
|
if ( isKdeTerminal() )
|
||||||
wc.term_bg = fc::SteelBlue3;
|
wc.term_bg = fc::SteelBlue3;
|
||||||
|
|
||||||
if ( tera_terminal )
|
if ( isTeraTerm() )
|
||||||
wc.term_bg = fc::LightBlue;
|
wc.term_bg = fc::LightBlue;
|
||||||
|
|
||||||
if ( max_color < 16 ) // for 8 color mode
|
if ( getMaxColor() < 16 ) // for 8 color mode
|
||||||
{
|
{
|
||||||
wc.term_fg = fc::Black;
|
wc.term_fg = fc::Black;
|
||||||
wc.term_bg = fc::Blue;
|
wc.term_bg = fc::Blue;
|
||||||
|
@ -1198,7 +1196,7 @@ void FWidget::redraw()
|
||||||
|
|
||||||
if ( isRootWidget() )
|
if ( isRootWidget() )
|
||||||
{
|
{
|
||||||
terminal_updates = false;
|
startTerminalUpdate();
|
||||||
// clean desktop
|
// clean desktop
|
||||||
setColor (wc.term_fg, wc.term_bg);
|
setColor (wc.term_fg, wc.term_bg);
|
||||||
clearArea (vdesktop);
|
clearArea (vdesktop);
|
||||||
|
@ -1279,7 +1277,7 @@ void FWidget::redraw()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isRootWidget() )
|
if ( isRootWidget() )
|
||||||
terminal_updates = true;
|
finishTerminalUpdate();
|
||||||
|
|
||||||
if ( redraw_root_widget == this )
|
if ( redraw_root_widget == this )
|
||||||
{
|
{
|
||||||
|
@ -1292,11 +1290,10 @@ void FWidget::redraw()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FWidget::resize()
|
void FWidget::resize()
|
||||||
{
|
{
|
||||||
if ( isRootWidget() && openConsole() == 0 )
|
if ( isRootWidget() )
|
||||||
{
|
{
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
const FRect& term_geometry = getGeometry();
|
const FRect& term_geometry = getGeometry();
|
||||||
closeConsole();
|
|
||||||
resizeVTerm (term_geometry);
|
resizeVTerm (term_geometry);
|
||||||
resizeArea (term_geometry, getShadow(), vdesktop);
|
resizeArea (term_geometry, getShadow(), vdesktop);
|
||||||
adjustSizeGlobal();
|
adjustSizeGlobal();
|
||||||
|
@ -1317,12 +1314,14 @@ void FWidget::show()
|
||||||
if ( ! visible )
|
if ( ! visible )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( getMainWidget() == this && ! (NewFont || VGAFont) )
|
// Important: Do not use setNewFont() or setVGAFont() after
|
||||||
|
// the console character mapping has been initialized
|
||||||
|
if ( getMainWidget() == this )
|
||||||
init_consoleCharMap();
|
init_consoleCharMap();
|
||||||
|
|
||||||
if ( ! show_root_widget )
|
if ( ! show_root_widget )
|
||||||
{
|
{
|
||||||
terminal_updates = false;
|
startTerminalUpdate();
|
||||||
show_root_widget = this;
|
show_root_widget = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1348,7 +1347,7 @@ void FWidget::show()
|
||||||
|
|
||||||
if ( show_root_widget && show_root_widget == this )
|
if ( show_root_widget && show_root_widget == this )
|
||||||
{
|
{
|
||||||
terminal_updates = true;
|
finishTerminalUpdate();
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flush_out();
|
||||||
show_root_widget = 0;
|
show_root_widget = 0;
|
||||||
|
@ -1534,16 +1533,7 @@ bool FWidget::setFocus (bool on)
|
||||||
void FWidget::setColor ()
|
void FWidget::setColor ()
|
||||||
{
|
{
|
||||||
// Changes colors to the widget default colors
|
// Changes colors to the widget default colors
|
||||||
next_attribute.fg_color = foreground_color;
|
setColor (foreground_color, background_color);
|
||||||
next_attribute.bg_color = background_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void FWidget::setColor (register short fg, register short bg)
|
|
||||||
{
|
|
||||||
// Changes colors
|
|
||||||
next_attribute.fg_color = fg;
|
|
||||||
next_attribute.bg_color = bg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -1799,24 +1789,18 @@ void FWidget::setTermOffsetWithPadding()
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FWidget::getTermSize()
|
void FWidget::detectTermSize()
|
||||||
{
|
{
|
||||||
FWidget* r = rootObject;
|
FWidget* r = rootObject;
|
||||||
|
FTerm::detectTermSize();
|
||||||
if ( openConsole() == 0 )
|
r->adjust_wsize.setRect (1, 1, getColumnNumber(), getLineNumber());
|
||||||
{
|
r->offset.setRect (0, 0, getColumnNumber(), getLineNumber());
|
||||||
FTerm::getTermSize();
|
|
||||||
closeConsole();
|
|
||||||
}
|
|
||||||
|
|
||||||
r->adjust_wsize.setRect (1, 1, term->getWidth(), term->getHeight());
|
|
||||||
r->offset.setRect (0, 0, term->getWidth(), term->getHeight());
|
|
||||||
r->client_offset.setCoordinates
|
r->client_offset.setCoordinates
|
||||||
(
|
(
|
||||||
r->padding.left,
|
r->padding.left,
|
||||||
r->padding.top,
|
r->padding.top,
|
||||||
term->getWidth() - 1 - r->padding.right,
|
getColumnNumber() - 1 - r->padding.right,
|
||||||
term->getHeight() - 1 - r->padding.bottom
|
getLineNumber() - 1 - r->padding.bottom
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1829,7 +1813,7 @@ void FWidget::setTermSize (int w, int h)
|
||||||
rootObject->wsize.setRect(1, 1, w, h);
|
rootObject->wsize.setRect(1, 1, w, h);
|
||||||
rootObject->adjust_wsize = rootObject->wsize;
|
rootObject->adjust_wsize = rootObject->wsize;
|
||||||
FTerm::setTermSize (w, h); // w = columns / h = lines
|
FTerm::setTermSize (w, h); // w = columns / h = lines
|
||||||
getTermSize();
|
detectTermSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
369
src/fwidget.h
369
src/fwidget.h
|
@ -314,7 +314,7 @@ class FWidget : public FVTerm
|
||||||
static FWidget* show_root_widget;
|
static FWidget* show_root_widget;
|
||||||
static FWidget* redraw_root_widget;
|
static FWidget* redraw_root_widget;
|
||||||
|
|
||||||
friend class FApplication;
|
// Friend classes
|
||||||
friend class FToggleButton;
|
friend class FToggleButton;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -473,7 +473,8 @@ class FWidget : public FVTerm
|
||||||
void setForegroundColor (short);
|
void setForegroundColor (short);
|
||||||
void setBackgroundColor (short);
|
void setBackgroundColor (short);
|
||||||
void setColor();
|
void setColor();
|
||||||
void setColor (short, short);
|
// make every setColor from FVTerm available
|
||||||
|
using FVTerm::setColor;
|
||||||
void setX (int, bool = true);
|
void setX (int, bool = true);
|
||||||
void setY (int, bool = true);
|
void setY (int, bool = true);
|
||||||
virtual void setPos (const FPoint&, bool = true);
|
virtual void setPos (const FPoint&, bool = true);
|
||||||
|
@ -488,7 +489,7 @@ class FWidget : public FVTerm
|
||||||
void setParentOffset();
|
void setParentOffset();
|
||||||
void setTermOffset();
|
void setTermOffset();
|
||||||
void setTermOffsetWithPadding();
|
void setTermOffsetWithPadding();
|
||||||
void getTermSize();
|
void detectTermSize();
|
||||||
void setTermSize (int, int);
|
void setTermSize (int, int);
|
||||||
virtual void setGeometry (const FRect&, bool = true);
|
virtual void setGeometry (const FRect&, bool = true);
|
||||||
virtual void setGeometry (int, int, int, int, bool = true);
|
virtual void setGeometry (int, int, int, int, bool = true);
|
||||||
|
@ -509,88 +510,6 @@ class FWidget : public FVTerm
|
||||||
void setPrintPos (register int, register int);
|
void setPrintPos (register int, register int);
|
||||||
FPoint getPrintPos() const;
|
FPoint getPrintPos() const;
|
||||||
|
|
||||||
static void setNormal();
|
|
||||||
|
|
||||||
static bool setBold (register bool);
|
|
||||||
static bool setBold();
|
|
||||||
static bool unsetBold();
|
|
||||||
static bool isBold();
|
|
||||||
|
|
||||||
static bool setDim (register bool);
|
|
||||||
static bool setDim();
|
|
||||||
static bool unsetDim();
|
|
||||||
static bool isDim();
|
|
||||||
|
|
||||||
static bool setItalic (register bool);
|
|
||||||
static bool setItalic();
|
|
||||||
static bool unsetItalic();
|
|
||||||
static bool isItalic();
|
|
||||||
|
|
||||||
static bool setUnderline (register bool);
|
|
||||||
static bool setUnderline();
|
|
||||||
static bool unsetUnderline();
|
|
||||||
static bool isUnderline();
|
|
||||||
|
|
||||||
static bool setBlink (register bool);
|
|
||||||
static bool setBlink();
|
|
||||||
static bool unsetBlink();
|
|
||||||
static bool isBlink();
|
|
||||||
|
|
||||||
static bool setReverse (register bool);
|
|
||||||
static bool setReverse();
|
|
||||||
static bool unsetReverse();
|
|
||||||
static bool isReverse();
|
|
||||||
|
|
||||||
static bool setStandout (register bool);
|
|
||||||
static bool setStandout();
|
|
||||||
static bool unsetStandout();
|
|
||||||
static bool isStandout();
|
|
||||||
|
|
||||||
static bool setInvisible (register bool);
|
|
||||||
static bool setInvisible();
|
|
||||||
static bool unsetInvisible();
|
|
||||||
static bool isInvisible();
|
|
||||||
|
|
||||||
static bool setProtected (register bool);
|
|
||||||
static bool setProtected();
|
|
||||||
static bool unsetProtected();
|
|
||||||
static bool isProtected();
|
|
||||||
|
|
||||||
static bool setCrossedOut (register bool);
|
|
||||||
static bool setCrossedOut();
|
|
||||||
static bool unsetCrossedOut();
|
|
||||||
static bool isCrossedOut();
|
|
||||||
|
|
||||||
static bool setDoubleUnderline (register bool);
|
|
||||||
static bool setDoubleUnderline();
|
|
||||||
static bool unsetDoubleUnderline();
|
|
||||||
static bool isDoubleUnderline();
|
|
||||||
|
|
||||||
static bool setAltCharset (register bool);
|
|
||||||
static bool setAltCharset();
|
|
||||||
static bool unsetAltCharset();
|
|
||||||
static bool isAltCharset();
|
|
||||||
|
|
||||||
static bool setPCcharset (register bool);
|
|
||||||
static bool setPCcharset();
|
|
||||||
static bool unsetPCcharset();
|
|
||||||
static bool isPCcharset();
|
|
||||||
|
|
||||||
static bool setTransparent (register bool);
|
|
||||||
static bool setTransparent();
|
|
||||||
static bool unsetTransparent();
|
|
||||||
static bool isTransparent();
|
|
||||||
|
|
||||||
static bool setTransShadow (register bool);
|
|
||||||
static bool setTransShadow();
|
|
||||||
static bool unsetTransShadow();
|
|
||||||
static bool isTransShadow();
|
|
||||||
|
|
||||||
static bool setInheritBackground (register bool);
|
|
||||||
static bool setInheritBackground();
|
|
||||||
static bool unsetInheritBackground();
|
|
||||||
static bool isInheritBackground();
|
|
||||||
|
|
||||||
void drawShadow();
|
void drawShadow();
|
||||||
void clearShadow();
|
void clearShadow();
|
||||||
void drawFlatBorder();
|
void drawFlatBorder();
|
||||||
|
@ -928,286 +847,6 @@ inline void FWidget::unsetCursorPos()
|
||||||
inline void FWidget::setPrintPos (const FPoint& pos)
|
inline void FWidget::setPrintPos (const FPoint& pos)
|
||||||
{ setPrintPos (pos.getX(), pos.getY()); }
|
{ setPrintPos (pos.getX(), pos.getY()); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline void FWidget::setNormal()
|
|
||||||
{
|
|
||||||
next_attribute.bold = \
|
|
||||||
next_attribute.dim = \
|
|
||||||
next_attribute.italic = \
|
|
||||||
next_attribute.underline = \
|
|
||||||
next_attribute.blink = \
|
|
||||||
next_attribute.reverse = \
|
|
||||||
next_attribute.standout = \
|
|
||||||
next_attribute.invisible = \
|
|
||||||
next_attribute.protect = \
|
|
||||||
next_attribute.crossed_out = \
|
|
||||||
next_attribute.dbl_underline = \
|
|
||||||
next_attribute.alt_charset = \
|
|
||||||
next_attribute.pc_charset = \
|
|
||||||
next_attribute.transparent = \
|
|
||||||
next_attribute.trans_shadow = \
|
|
||||||
next_attribute.inherit_bg = false;
|
|
||||||
|
|
||||||
next_attribute.fg_color = fc::Default;
|
|
||||||
next_attribute.bg_color = fc::Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setBold (register bool on)
|
|
||||||
{ return (next_attribute.bold = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setBold()
|
|
||||||
{ return setBold(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetBold()
|
|
||||||
{ return setBold(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isBold()
|
|
||||||
{ return next_attribute.bold; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setDim (register bool on)
|
|
||||||
{ return (next_attribute.dim = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setDim()
|
|
||||||
{ return setDim(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetDim()
|
|
||||||
{ return setDim(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isDim()
|
|
||||||
{ return next_attribute.dim; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setItalic (register bool on)
|
|
||||||
{ return (next_attribute.italic = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setItalic()
|
|
||||||
{ return setItalic(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetItalic()
|
|
||||||
{ return setItalic(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isItalic()
|
|
||||||
{ return next_attribute.italic; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setUnderline (register bool on)
|
|
||||||
{ return (next_attribute.underline = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setUnderline()
|
|
||||||
{ return setUnderline(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetUnderline()
|
|
||||||
{ return setUnderline(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isUnderline()
|
|
||||||
{ return next_attribute.underline; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setBlink (register bool on)
|
|
||||||
{ return (next_attribute.blink = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setBlink()
|
|
||||||
{ return setBlink(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetBlink()
|
|
||||||
{ return setBlink(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isBlink()
|
|
||||||
{ return next_attribute.blink; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setReverse (register bool on)
|
|
||||||
{ return (next_attribute.reverse = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setReverse()
|
|
||||||
{ return setReverse(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetReverse()
|
|
||||||
{ return setReverse(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isReverse()
|
|
||||||
{ return next_attribute.reverse; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setStandout (register bool on)
|
|
||||||
{ return (next_attribute.standout = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setStandout()
|
|
||||||
{ return setStandout(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetStandout()
|
|
||||||
{ return setStandout(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isStandout()
|
|
||||||
{ return next_attribute.standout; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setInvisible (register bool on)
|
|
||||||
{ return (next_attribute.invisible = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setInvisible()
|
|
||||||
{ return setInvisible(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetInvisible()
|
|
||||||
{ return setInvisible(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isInvisible()
|
|
||||||
{ return next_attribute.invisible; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setProtected (register bool on)
|
|
||||||
{ return (next_attribute.protect = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setProtected()
|
|
||||||
{ return setProtected(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetProtected()
|
|
||||||
{ return setProtected(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isProtected()
|
|
||||||
{ return next_attribute.protect; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setCrossedOut (register bool on)
|
|
||||||
{ return (next_attribute.crossed_out = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setCrossedOut()
|
|
||||||
{ return setCrossedOut(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetCrossedOut()
|
|
||||||
{ return setCrossedOut(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isCrossedOut()
|
|
||||||
{ return next_attribute.crossed_out; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setDoubleUnderline (register bool on)
|
|
||||||
{ return (next_attribute.dbl_underline = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setDoubleUnderline()
|
|
||||||
{ return setDoubleUnderline(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetDoubleUnderline()
|
|
||||||
{ return setDoubleUnderline(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isDoubleUnderline()
|
|
||||||
{ return next_attribute.dbl_underline; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setAltCharset (register bool on)
|
|
||||||
{ return (next_attribute.alt_charset = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setAltCharset()
|
|
||||||
{ return setAltCharset(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetAltCharset()
|
|
||||||
{ return setAltCharset(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isAltCharset()
|
|
||||||
{ return next_attribute.alt_charset; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setPCcharset (register bool on)
|
|
||||||
{ return (next_attribute.pc_charset = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setPCcharset()
|
|
||||||
{ return setPCcharset(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetPCcharset()
|
|
||||||
{ return setPCcharset(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isPCcharset()
|
|
||||||
{ return next_attribute.pc_charset; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setTransparent (register bool on)
|
|
||||||
{ return (next_attribute.transparent = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setTransparent()
|
|
||||||
{ return setTransparent(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetTransparent()
|
|
||||||
{ return setTransparent(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isTransparent()
|
|
||||||
{ return next_attribute.transparent; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setTransShadow (register bool on)
|
|
||||||
{ return (next_attribute.trans_shadow = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setTransShadow()
|
|
||||||
{ return setTransShadow(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetTransShadow()
|
|
||||||
{ return setTransShadow(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isTransShadow()
|
|
||||||
{ return next_attribute.trans_shadow; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setInheritBackground (register bool on)
|
|
||||||
{ return (next_attribute.inherit_bg = on); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::setInheritBackground()
|
|
||||||
{ return setInheritBackground(true); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::unsetInheritBackground()
|
|
||||||
{ return setInheritBackground(false); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FWidget::isInheritBackground()
|
|
||||||
{ return next_attribute.inherit_bg; }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FWidget::unsetDoubleFlatLine (int side)
|
inline void FWidget::unsetDoubleFlatLine (int side)
|
||||||
{ setDoubleFlatLine(side, false); }
|
{ setDoubleFlatLine(side, false); }
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "fwindow.h"
|
#include "fwindow.h"
|
||||||
|
|
||||||
// static attributes
|
// static attributes
|
||||||
FWindow* FWindow::previous_widget = 0;
|
FWindow* FWindow::previous_window = 0;
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -33,8 +33,8 @@ FWindow::~FWindow() // destructor
|
||||||
{
|
{
|
||||||
FApplication* fapp = static_cast<FApplication*>(getRootWidget());
|
FApplication* fapp = static_cast<FApplication*>(getRootWidget());
|
||||||
|
|
||||||
if ( previous_widget == this )
|
if ( previous_window == this )
|
||||||
previous_widget = 0;
|
previous_window = 0;
|
||||||
|
|
||||||
if ( isAlwaysOnTop() )
|
if ( isAlwaysOnTop() )
|
||||||
deleteFromAlwaysOnTopList (this);
|
deleteFromAlwaysOnTopList (this);
|
||||||
|
@ -665,7 +665,7 @@ void FWindow::switchToPrevWindow()
|
||||||
bool FWindow::activatePrevWindow()
|
bool FWindow::activatePrevWindow()
|
||||||
{
|
{
|
||||||
// activate the previous window
|
// activate the previous window
|
||||||
FWindow* w = previous_widget;
|
FWindow* w = previous_window;
|
||||||
|
|
||||||
if ( w )
|
if ( w )
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ class FWindow : public FWidget
|
||||||
FRect normalGeometry;
|
FRect normalGeometry;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static FWindow* previous_widget;
|
static FWindow* previous_window;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disable copy constructor
|
// Disable copy constructor
|
||||||
|
|
Loading…
Reference in New Issue