Moving static attributes from FApplication to FWidget
This commit is contained in:
parent
689199efe2
commit
540291b410
|
@ -1,3 +1,6 @@
|
|||
2018-10-21 Markus Gans <guru.mail@muenster.de>
|
||||
* Moving static attributes from FApplication to FWidget
|
||||
|
||||
2018-10-17 Markus Gans <guru.mail@muenster.de>
|
||||
* Changed more variables from int to std::size_t
|
||||
|
||||
|
|
|
@ -31,23 +31,23 @@
|
|||
namespace finalcut
|
||||
{
|
||||
|
||||
// global application object
|
||||
static FApplication* rootObj = 0;
|
||||
// Global application object
|
||||
static FApplication* app_object = 0;
|
||||
|
||||
// flag to exit local loop
|
||||
// Flag to exit the local event loop
|
||||
static bool app_exit_loop = false;
|
||||
|
||||
// static attributes
|
||||
int FApplication::loop_level = 0; // event loop level
|
||||
FWidget* FApplication::main_widget = 0; // main application widget
|
||||
FWidget* FApplication::active_window = 0; // the active window
|
||||
FWidget* FApplication::focus_widget = 0; // has keyboard input focus
|
||||
FWidget* FApplication::clicked_widget = 0; // is focused by click
|
||||
FWidget* FApplication::open_menu = 0; // currently open menu
|
||||
FWidget* FApplication::move_size_widget = 0; // move/size by keyboard
|
||||
// Static attributes
|
||||
FWidget* FWidget::main_widget = 0; // main application widget
|
||||
FWidget* FWidget::active_window = 0; // the active window
|
||||
FWidget* FWidget::focus_widget = 0; // has keyboard input focus
|
||||
FWidget* FWidget::clicked_widget = 0; // is focused by click
|
||||
FWidget* FWidget::open_menu = 0; // currently open menu
|
||||
FWidget* FWidget::move_size_widget = 0; // move/size by keyboard
|
||||
FWidget* FApplication::keyboard_widget = 0; // has the keyboard focus
|
||||
FKeyboard* FApplication::keyboard = 0; // keyboard access
|
||||
FMouseControl* FApplication::mouse = 0; // mouse control
|
||||
int FApplication::loop_level = 0; // event loop level
|
||||
int FApplication::quit_code = 0;
|
||||
bool FApplication::quit_now = false;
|
||||
|
||||
|
@ -69,9 +69,9 @@ FApplication::FApplication ( const int& _argc
|
|||
, key_timeout(100000) // 100 ms
|
||||
, dblclick_interval(500000) // 500 ms
|
||||
{
|
||||
assert ( ! rootObj
|
||||
assert ( ! app_object
|
||||
&& "FApplication: There should be only one application object" );
|
||||
rootObj = this;
|
||||
app_object = this;
|
||||
|
||||
if ( ! (_argc && _argv) )
|
||||
{
|
||||
|
@ -89,27 +89,21 @@ FApplication::~FApplication() // destructor
|
|||
if ( event_queue )
|
||||
delete event_queue;
|
||||
|
||||
rootObj = 0;
|
||||
app_object = 0;
|
||||
}
|
||||
|
||||
|
||||
// public methods of FApplication
|
||||
//----------------------------------------------------------------------
|
||||
void FApplication::setMainWidget (FWidget* widget)
|
||||
FWidget* FApplication::getApplicationObject()
|
||||
{
|
||||
main_widget = widget;
|
||||
|
||||
if ( widget && ! getFocusWidget() )
|
||||
rootObj->focusFirstChild();
|
||||
return static_cast<FWidget*>(app_object);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FApplication::isQuit()
|
||||
{
|
||||
if ( rootObj )
|
||||
return quit_now;
|
||||
else
|
||||
return true;
|
||||
return ( app_object ) ? quit_now : true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -152,7 +146,7 @@ void FApplication::exit_loop()
|
|||
//----------------------------------------------------------------------
|
||||
void FApplication::exit (int retcode)
|
||||
{
|
||||
if ( ! rootObj ) // no global app object
|
||||
if ( ! app_object ) // no global app object
|
||||
return;
|
||||
|
||||
if ( quit_now ) // don't overwrite quit code
|
||||
|
@ -264,7 +258,7 @@ void FApplication::sendQueuedEvents()
|
|||
//----------------------------------------------------------------------
|
||||
bool FApplication::eventInQueue()
|
||||
{
|
||||
if ( rootObj )
|
||||
if ( app_object )
|
||||
return ( ! event_queue->empty() );
|
||||
else
|
||||
return false;
|
||||
|
@ -507,6 +501,8 @@ inline void FApplication::findKeyboardWidget()
|
|||
// Find the widget that has the keyboard focus
|
||||
|
||||
FWidget* widget = 0;
|
||||
FWidget* focus_widget = getFocusWidget();
|
||||
FWidget* move_size_widget = getMoveSizeWidget();
|
||||
|
||||
if ( focus_widget )
|
||||
{
|
||||
|
@ -517,7 +513,7 @@ inline void FApplication::findKeyboardWidget()
|
|||
}
|
||||
else
|
||||
{
|
||||
widget = main_widget;
|
||||
widget = getMainWidget();
|
||||
|
||||
if ( widget && widget->numOfChildren() >= 1 )
|
||||
widget->focusFirstChild();
|
||||
|
@ -641,7 +637,7 @@ inline bool FApplication::sendKeyUpEvent (FWidget* widget)
|
|||
//----------------------------------------------------------------------
|
||||
inline void FApplication::sendKeyboardAccelerator()
|
||||
{
|
||||
if ( open_menu )
|
||||
if ( getOpenMenu() )
|
||||
return;
|
||||
|
||||
// Switch to a specific dialog with Meta + 1..9
|
||||
|
@ -650,7 +646,7 @@ inline void FApplication::sendKeyboardAccelerator()
|
|||
// Windows keyboard accelerator
|
||||
if ( ! accpt )
|
||||
{
|
||||
const FWidget* window = active_window;
|
||||
const FWidget* window = getActiveWindow();
|
||||
|
||||
if ( window )
|
||||
accpt = processAccelerator (window);
|
||||
|
@ -696,14 +692,16 @@ bool FApplication::processDialogSwitchAccelerator()
|
|||
if ( s > 0 && s >= n )
|
||||
{
|
||||
// unset the move/size mode
|
||||
FWidget* move_size_widget = getMoveSizeWidget();
|
||||
|
||||
if ( move_size_widget )
|
||||
{
|
||||
FWidget* w = move_size_widget;
|
||||
move_size_widget = 0;
|
||||
setMoveSizeWidget(0);
|
||||
w->redraw();
|
||||
}
|
||||
|
||||
FAccelEvent a_ev (fc::Accelerator_Event, focus_widget);
|
||||
FAccelEvent a_ev (fc::Accelerator_Event, getFocusWidget());
|
||||
sendEvent (dialog_list->at(n - 1), &a_ev);
|
||||
return true;
|
||||
}
|
||||
|
@ -733,14 +731,16 @@ bool FApplication::processAccelerator (const FWidget*& widget)
|
|||
if ( iter->key == keyboard->getKey() )
|
||||
{
|
||||
// unset the move/size mode
|
||||
FWidget* move_size_widget = getMoveSizeWidget();
|
||||
|
||||
if ( move_size_widget )
|
||||
{
|
||||
FWidget* w = move_size_widget;
|
||||
move_size_widget = 0;
|
||||
setMoveSizeWidget(0);
|
||||
w->redraw();
|
||||
}
|
||||
|
||||
FAccelEvent a_ev (fc::Accelerator_Event, focus_widget);
|
||||
FAccelEvent a_ev (fc::Accelerator_Event, getFocusWidget());
|
||||
sendEvent (iter->object, &a_ev);
|
||||
accpt = a_ev.isAccepted();
|
||||
break;
|
||||
|
@ -772,6 +772,8 @@ bool FApplication::getMouseEvent()
|
|||
//----------------------------------------------------------------------
|
||||
FWidget*& FApplication::determineClickedWidget()
|
||||
{
|
||||
FWidget*& clicked_widget = getClickedWidget();
|
||||
|
||||
if ( clicked_widget )
|
||||
return clicked_widget;
|
||||
|
||||
|
@ -796,6 +798,7 @@ FWidget*& FApplication::determineClickedWidget()
|
|||
// Determine the widget at the current click position
|
||||
FWidget* child = childWidgetAt (window, mouse_position);
|
||||
clicked_widget = ( child != 0 ) ? child : window;
|
||||
setClickedWidget (clicked_widget);
|
||||
}
|
||||
|
||||
return clicked_widget;
|
||||
|
@ -805,10 +808,13 @@ FWidget*& FApplication::determineClickedWidget()
|
|||
void FApplication::unsetMoveSizeMode()
|
||||
{
|
||||
// Unset the move/size mode
|
||||
|
||||
FWidget* move_size_widget = getMoveSizeWidget();
|
||||
|
||||
if ( move_size_widget )
|
||||
{
|
||||
FWidget* w = move_size_widget;
|
||||
move_size_widget = 0;
|
||||
setMoveSizeWidget(0);
|
||||
w->redraw();
|
||||
}
|
||||
}
|
||||
|
@ -818,11 +824,12 @@ void FApplication::closeOpenMenu()
|
|||
{
|
||||
// Close the open menu
|
||||
|
||||
FWidget* open_menu = getOpenMenu();
|
||||
FMenu* menu = static_cast<FMenu*>(open_menu);
|
||||
|
||||
if ( ! open_menu || ( mouse && mouse->isMoved()) )
|
||||
return;
|
||||
|
||||
FMenu* menu = static_cast<FMenu*>(open_menu);
|
||||
|
||||
if ( mouse )
|
||||
{
|
||||
const FPoint& mouse_position = mouse->getPos();
|
||||
|
@ -845,7 +852,7 @@ void FApplication::closeOpenMenu()
|
|||
menu->hideSuperMenus();
|
||||
|
||||
// No widget was been clicked and the menu is no dialog menu
|
||||
if ( ! (clicked_widget || is_window_menu) )
|
||||
if ( ! (getClickedWidget() || is_window_menu) )
|
||||
FWindow::switchToPrevWindow();
|
||||
|
||||
if ( getStatusBar() )
|
||||
|
@ -860,11 +867,12 @@ void FApplication::unselectMenubarItems()
|
|||
{
|
||||
// Unselect the menu bar items
|
||||
|
||||
FWidget* open_menu = getOpenMenu();
|
||||
FMenuBar* menu_bar = getMenuBar();
|
||||
|
||||
if ( open_menu || (mouse && mouse->isMoved()) )
|
||||
return;
|
||||
|
||||
FMenuBar* menu_bar = getMenuBar();
|
||||
|
||||
if ( ! menu_bar )
|
||||
return;
|
||||
|
||||
|
@ -885,7 +893,7 @@ void FApplication::unselectMenubarItems()
|
|||
getMenuBar()->redraw();
|
||||
|
||||
// No widget was been clicked
|
||||
if ( ! clicked_widget )
|
||||
if ( ! getClickedWidget() )
|
||||
FWindow::switchToPrevWindow();
|
||||
|
||||
if ( getStatusBar() )
|
||||
|
@ -899,6 +907,8 @@ void FApplication::unselectMenubarItems()
|
|||
//----------------------------------------------------------------------
|
||||
void FApplication::sendMouseEvent()
|
||||
{
|
||||
FWidget* clicked_widget = getClickedWidget();
|
||||
|
||||
if ( ! clicked_widget )
|
||||
return;
|
||||
|
||||
|
@ -943,6 +953,8 @@ void FApplication::sendMouseMoveEvent ( const FPoint& widgetMousePos
|
|||
if ( ! mouse )
|
||||
return;
|
||||
|
||||
FWidget* clicked_widget = getClickedWidget();
|
||||
|
||||
if ( mouse->isLeftButtonPressed() )
|
||||
{
|
||||
FMouseEvent m_down_ev ( fc::MouseMove_Event
|
||||
|
@ -979,6 +991,8 @@ void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos
|
|||
if ( ! mouse )
|
||||
return;
|
||||
|
||||
FWidget* clicked_widget = getClickedWidget();
|
||||
|
||||
if ( mouse->isLeftButtonDoubleClick() )
|
||||
{
|
||||
FMouseEvent m_dblclick_ev ( fc::MouseDoubleClick_Event
|
||||
|
@ -1005,7 +1019,7 @@ void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos
|
|||
|
||||
if ( ! mouse->isRightButtonPressed()
|
||||
&& ! mouse->isMiddleButtonPressed() )
|
||||
clicked_widget = 0;
|
||||
setClickedWidget(0);
|
||||
|
||||
sendEvent (released_widget, &m_up_ev);
|
||||
}
|
||||
|
@ -1019,6 +1033,8 @@ void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos
|
|||
if ( ! mouse )
|
||||
return;
|
||||
|
||||
FWidget* clicked_widget = getClickedWidget();
|
||||
|
||||
if ( mouse->isRightButtonPressed() )
|
||||
{
|
||||
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
||||
|
@ -1037,7 +1053,7 @@ void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos
|
|||
|
||||
if ( ! mouse->isLeftButtonPressed()
|
||||
&& ! mouse->isMiddleButtonPressed() )
|
||||
clicked_widget = 0;
|
||||
setClickedWidget(0);
|
||||
|
||||
sendEvent (released_widget, &m_up_ev);
|
||||
}
|
||||
|
@ -1051,6 +1067,8 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos
|
|||
if ( ! mouse )
|
||||
return;
|
||||
|
||||
FWidget* clicked_widget = getClickedWidget();
|
||||
|
||||
if ( mouse->isMiddleButtonPressed() )
|
||||
{
|
||||
FMouseEvent m_down_ev ( fc::MouseDown_Event
|
||||
|
@ -1061,7 +1079,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos
|
|||
|
||||
// gnome-terminal sends no released on middle click
|
||||
if ( isGnomeTerminal() )
|
||||
clicked_widget = 0;
|
||||
setClickedWidget(0);
|
||||
}
|
||||
else if ( mouse->isMiddleButtonReleased() )
|
||||
{
|
||||
|
@ -1074,7 +1092,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos
|
|||
if ( ! mouse->isLeftButtonPressed()
|
||||
&& ! mouse->isRightButtonPressed() )
|
||||
{
|
||||
clicked_widget = 0;
|
||||
setClickedWidget(0);
|
||||
}
|
||||
|
||||
sendEvent (released_widget, &m_up_ev);
|
||||
|
@ -1088,6 +1106,8 @@ void FApplication::sendWheelEvent ( const FPoint& widgetMousePos
|
|||
if ( ! mouse )
|
||||
return;
|
||||
|
||||
FWidget* clicked_widget = getClickedWidget();
|
||||
|
||||
if ( mouse->isWheelUp() )
|
||||
{
|
||||
FWheelEvent wheel_ev ( fc::MouseWheel_Event
|
||||
|
@ -1095,7 +1115,7 @@ void FApplication::sendWheelEvent ( const FPoint& widgetMousePos
|
|||
, mouse_position
|
||||
, fc::WheelUp );
|
||||
FWidget* scroll_over_widget = clicked_widget;
|
||||
clicked_widget = 0;
|
||||
setClickedWidget(0);
|
||||
sendEvent(scroll_over_widget, &wheel_ev);
|
||||
}
|
||||
|
||||
|
@ -1106,7 +1126,7 @@ void FApplication::sendWheelEvent ( const FPoint& widgetMousePos
|
|||
, mouse_position
|
||||
, fc::WheelDown );
|
||||
FWidget* scroll_over_widget = clicked_widget;
|
||||
clicked_widget = 0;
|
||||
setClickedWidget(0);
|
||||
sendEvent (scroll_over_widget, &wheel_ev);
|
||||
}
|
||||
}
|
||||
|
@ -1133,7 +1153,7 @@ void FApplication::processResizeEvent()
|
|||
if ( hasChangedTermSize() )
|
||||
{
|
||||
FResizeEvent r_ev(fc::Resize_Event);
|
||||
sendEvent(rootObj, &r_ev);
|
||||
sendEvent(app_object, &r_ev);
|
||||
|
||||
if ( r_ev.isAccepted() )
|
||||
changeTermSizeFinished();
|
||||
|
|
|
@ -243,7 +243,7 @@ void FTextView::insert (const FString& str, int pos)
|
|||
FString s;
|
||||
std::size_t num;
|
||||
|
||||
if ( pos >= int(getRows()) )
|
||||
if ( pos < 0 || pos >= int(getRows()) )
|
||||
pos = int(getRows());
|
||||
|
||||
if ( str.isEmpty() )
|
||||
|
|
|
@ -34,8 +34,6 @@ namespace finalcut
|
|||
static FWidget* rootObject = 0;
|
||||
|
||||
// static class attributes
|
||||
uInt FWidget::modal_dialogs;
|
||||
|
||||
FStatusBar* FWidget::statusbar = 0;
|
||||
FMenuBar* FWidget::menubar = 0;
|
||||
FWidget* FWidget::show_root_widget = 0;
|
||||
|
@ -47,6 +45,7 @@ FWidget::widgetList* FWidget::close_widget = 0;
|
|||
FWidgetColors FWidget::wc;
|
||||
bool FWidget::init_desktop;
|
||||
bool FWidget::hideable;
|
||||
uInt FWidget::modal_dialogs;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -175,20 +174,6 @@ FWidget* FWidget::getParentWidget() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::getMainWidget()
|
||||
{
|
||||
FWidget* main_widget = static_cast<FWidget*>(FApplication::main_widget);
|
||||
return main_widget;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::getFocusWidget() const
|
||||
{
|
||||
FWidget* focus_widget = static_cast<FWidget*>(FApplication::focus_widget);
|
||||
return focus_widget;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::getFirstFocusableWidget (FObjectList list)
|
||||
{
|
||||
|
@ -242,44 +227,6 @@ FWidget* FWidget::getLastFocusableWidget (FObjectList list)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::getClickedWidget()
|
||||
{
|
||||
FWidget* clicked_widget = static_cast<FWidget*>(FApplication::clicked_widget);
|
||||
return clicked_widget;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::getMoveSizeWidget()
|
||||
{
|
||||
return FApplication::move_size_widget;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWidget::getOpenMenu()
|
||||
{
|
||||
FWidget* open_menu = static_cast<FWidget*>(FApplication::open_menu);
|
||||
return open_menu;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FMenuBar* FWidget::getMenuBar()
|
||||
{
|
||||
if ( menubar )
|
||||
return menubar;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FStatusBar* FWidget::getStatusBar()
|
||||
{
|
||||
if ( statusbar )
|
||||
return statusbar;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FPoint FWidget::getPrintPos()
|
||||
{
|
||||
|
@ -319,38 +266,11 @@ std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
|
|||
//----------------------------------------------------------------------
|
||||
void FWidget::setMainWidget (FWidget* obj)
|
||||
{
|
||||
FApplication* fapp = static_cast<FApplication*>(rootObject);
|
||||
fapp->setMainWidget(obj);
|
||||
}
|
||||
main_widget = obj;
|
||||
FWidget* app_object = FApplication::getApplicationObject();
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setFocusWidget (FWidget* obj)
|
||||
{
|
||||
FApplication::focus_widget = obj;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setClickedWidget (FWidget* obj)
|
||||
{
|
||||
FApplication::clicked_widget = obj;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setMoveSizeWidget (FWidget* obj)
|
||||
{
|
||||
FApplication::move_size_widget = obj;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setOpenMenu (FWidget* obj)
|
||||
{
|
||||
FApplication::open_menu = obj;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FWidget::setStatusbarMessage (const FString& msg)
|
||||
{
|
||||
statusbar_message = msg;
|
||||
if ( obj && app_object && ! getFocusWidget() )
|
||||
app_object->focusFirstChild();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -1569,7 +1489,8 @@ void FWidget::drawBorder (int x1, int y1, int x2, int y2)
|
|||
//----------------------------------------------------------------------
|
||||
void FWidget::quit()
|
||||
{
|
||||
FApplication* fapp = static_cast<FApplication*>(rootObject);
|
||||
FWidget* app_object = FApplication::getApplicationObject();
|
||||
FApplication* fapp = static_cast<FApplication*>(app_object);
|
||||
fapp->exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,14 +80,6 @@ FWindow::~FWindow() // destructor
|
|||
|
||||
|
||||
// public methods of FWindow
|
||||
//----------------------------------------------------------------------
|
||||
FWindow* FWindow::getActiveWindow()
|
||||
{
|
||||
// returns the active FWindow object
|
||||
FWindow* active_window = static_cast<FWindow*>(FApplication::active_window);
|
||||
return active_window;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget* FWindow::getWindowFocusWidget() const
|
||||
{
|
||||
|
@ -170,7 +162,7 @@ bool FWindow::activateWindow (bool on)
|
|||
// activate/deactivate this window
|
||||
if ( on )
|
||||
{
|
||||
FApplication::active_window = this;
|
||||
FWidget::setActiveWindow (this);
|
||||
active_area = getVWin();
|
||||
}
|
||||
|
||||
|
@ -181,7 +173,7 @@ bool FWindow::activateWindow (bool on)
|
|||
void FWindow::unsetActiveWindow()
|
||||
{
|
||||
// unset the active FWindow object
|
||||
FApplication::active_window = 0;
|
||||
FWidget::setActiveWindow (0);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -728,7 +720,7 @@ void FWindow::switchToPrevWindow()
|
|||
updateTerminal (FVTerm::stop_refresh);
|
||||
|
||||
bool is_activated = activatePrevWindow();
|
||||
FWindow* active_window = getActiveWindow();
|
||||
FWindow* active_window = static_cast<FWindow*>(getActiveWindow());
|
||||
|
||||
if ( ! is_activated )
|
||||
{
|
||||
|
|
|
@ -92,11 +92,7 @@ class FApplication : public FWidget
|
|||
const char* getClassName() const;
|
||||
int getArgc() const;
|
||||
char** getArgv() const;
|
||||
FWidget* getMainWidget() const;
|
||||
virtual FWidget* getFocusWidget() const;
|
||||
|
||||
// Mutator
|
||||
void setMainWidget (FWidget*);
|
||||
static FWidget* getApplicationObject();
|
||||
|
||||
// Inquiry
|
||||
static bool isQuit();
|
||||
|
@ -193,28 +189,6 @@ class FApplication : public FWidget
|
|||
static bool process_timer_event;
|
||||
static FKeyboard* keyboard;
|
||||
static FWidget* keyboard_widget;
|
||||
static FWidget* move_size_widget;
|
||||
static FWidget* main_widget;
|
||||
static FWidget* active_window;
|
||||
static FWidget* focus_widget;
|
||||
static FWidget* clicked_widget;
|
||||
static FWidget* open_menu;
|
||||
|
||||
// Friend functions from FWidget
|
||||
friend FWidget* FWidget::getMainWidget();
|
||||
friend FWidget* FWidget::getFocusWidget() const;
|
||||
friend void FWidget::setFocusWidget (FWidget*);
|
||||
friend FWidget* FWidget::getClickedWidget();
|
||||
friend void FWidget::setClickedWidget (FWidget*);
|
||||
friend FWidget* FWidget::getMoveSizeWidget();
|
||||
friend void FWidget::setMoveSizeWidget (FWidget*);
|
||||
friend FWidget* FWidget::getOpenMenu();
|
||||
friend void FWidget::setOpenMenu (FWidget*);
|
||||
|
||||
// Friend functions from FWindow
|
||||
friend bool FWindow::activateWindow (bool);
|
||||
friend FWindow* FWindow::getActiveWindow();
|
||||
friend void FWindow::unsetActiveWindow();
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
@ -232,14 +206,6 @@ inline int FApplication::getArgc() const
|
|||
inline char** FApplication::getArgv() const
|
||||
{ return app_argv; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget* FApplication::getMainWidget() const
|
||||
{ return main_widget; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget* FApplication::getFocusWidget() const
|
||||
{ return focus_widget; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FApplication::cb_exitApp (FWidget*, data_ptr)
|
||||
{ close(); }
|
||||
|
|
|
@ -152,13 +152,14 @@ class FWidget : public FVTerm, public FObject
|
|||
const char* getClassName() const;
|
||||
FWidget* getRootWidget() const;
|
||||
FWidget* getParentWidget() const;
|
||||
static FWidget* getMainWidget();
|
||||
virtual FWidget* getFocusWidget() const;
|
||||
static FWidget*& getMainWidget();
|
||||
static FWidget*& getActiveWindow();
|
||||
static FWidget*& getFocusWidget();
|
||||
static FWidget*& getClickedWidget();
|
||||
static FWidget*& getOpenMenu();
|
||||
static FWidget*& getMoveSizeWidget();
|
||||
virtual FWidget* getFirstFocusableWidget (FObjectList);
|
||||
virtual FWidget* getLastFocusableWidget (FObjectList);
|
||||
static FWidget* getClickedWidget();
|
||||
static FWidget* getMoveSizeWidget();
|
||||
static FWidget* getOpenMenu();
|
||||
static FMenuBar* getMenuBar();
|
||||
static FStatusBar* getStatusBar();
|
||||
FString getStatusbarMessage() const;
|
||||
|
@ -194,9 +195,10 @@ class FWidget : public FVTerm, public FObject
|
|||
|
||||
// Mutators
|
||||
static void setMainWidget (FWidget*);
|
||||
virtual void setFocusWidget (FWidget*);
|
||||
static void setFocusWidget (FWidget*);
|
||||
static void setClickedWidget (FWidget*);
|
||||
static void setMoveSizeWidget (FWidget*);
|
||||
static void setActiveWindow (FWidget*);
|
||||
static void setOpenMenu (FWidget*);
|
||||
virtual void setStatusbarMessage (const FString&);
|
||||
bool setVisible();
|
||||
|
@ -491,6 +493,12 @@ class FWidget : public FVTerm, public FObject
|
|||
FString statusbar_message;
|
||||
static FStatusBar* statusbar;
|
||||
static FMenuBar* menubar;
|
||||
static FWidget* main_widget;
|
||||
static FWidget* active_window;
|
||||
static FWidget* focus_widget;
|
||||
static FWidget* clicked_widget;
|
||||
static FWidget* open_menu;
|
||||
static FWidget* move_size_widget;
|
||||
static FWidget* show_root_widget;
|
||||
static FWidget* redraw_root_widget;
|
||||
static bool init_desktop;
|
||||
|
@ -508,6 +516,38 @@ class FWidget : public FVTerm, public FObject
|
|||
inline const char* FWidget::getClassName() const
|
||||
{ return "FWidget"; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget*& FWidget::getMainWidget()
|
||||
{ return main_widget; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget*& FWidget::getActiveWindow() // returns active FWindow object
|
||||
{ return active_window; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget*& FWidget::getFocusWidget()
|
||||
{ return focus_widget; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget*& FWidget::getClickedWidget()
|
||||
{ return clicked_widget; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget*& FWidget::getOpenMenu()
|
||||
{ return open_menu; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FWidget*& FWidget::getMoveSizeWidget()
|
||||
{ return move_size_widget; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FMenuBar* FWidget::getMenuBar()
|
||||
{ return menubar; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FStatusBar* FWidget::getStatusBar()
|
||||
{ return statusbar; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FString FWidget::getStatusbarMessage() const
|
||||
{ return statusbar_message; }
|
||||
|
@ -650,6 +690,30 @@ inline int FWidget::getFlags() const
|
|||
inline FPoint FWidget::getCursorPos()
|
||||
{ return widget_cursor_position; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setActiveWindow (FWidget* obj)
|
||||
{ active_window = obj; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setFocusWidget (FWidget* obj)
|
||||
{ focus_widget = obj; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setClickedWidget (FWidget* obj)
|
||||
{ clicked_widget = obj; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setOpenMenu (FWidget* obj)
|
||||
{ open_menu = obj; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setMoveSizeWidget (FWidget* obj)
|
||||
{ move_size_widget = obj; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FWidget::setStatusbarMessage (const FString& msg)
|
||||
{ statusbar_message = msg; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setVisible()
|
||||
{ return visible = true; }
|
||||
|
|
|
@ -91,7 +91,6 @@ class FWindow : public FWidget
|
|||
const char* getClassName() const;
|
||||
static FWindow* getWindowWidget (const FWidget*);
|
||||
static int getWindowLayer (const FWidget*);
|
||||
static FWindow* getActiveWindow();
|
||||
FWidget* getWindowFocusWidget() const;
|
||||
|
||||
// Mutators
|
||||
|
|
Loading…
Reference in New Issue