#include <Iguana/Studio/interface/IgQtAppContextService.h>
Public Types | |
typedef void(* | ConnectionCallback )(void *data, bool focus) |
Public Member Functions | |
void | add (ConnectionCallback connection, void *data, bool enable=true) |
void | addOnFocusIn (lat::CallbackRep *callback) |
void | addOnFocusOut (lat::CallbackRep *callback) |
void | focusIn (void) |
void | focusOut (void) |
IgQtAppContextService (IgState *state, QWidget *mainWindow) | |
~IgQtAppContextService (void) | |
Private Types | |
typedef std::list< lat::Callback > | CallbackList |
Private Member Functions | |
IG_DECLARE_STATE_ELEMENT (IgQtAppContextService) | |
IgQtAppContextService (const IgQtAppContextService &) | |
IgQtAppContextService & | operator= (const IgQtAppContextService &) |
Private Attributes | |
CallbackList | m_focusInCallbacks |
CallbackList | m_focusOutCallbacks |
QWidget * | m_mainWindow |
IgState * | m_state |
Definition at line 22 of file IgQtAppContextService.h.
typedef std::list<lat::Callback> IgQtAppContextService::CallbackList [private] |
Definition at line 49 of file IgQtAppContextService.h.
typedef void(* IgQtAppContextService::ConnectionCallback)(void *data, bool focus) |
IgQtAppContextService::IgQtAppContextService | ( | IgState * | state, | |
QWidget * | mainWindow | |||
) |
Definition at line 21 of file IgQtAppContextService.cc.
References ASSERT, and IgState::put().
00023 : m_state (state), 00024 m_mainWindow (mainWindow) 00025 { 00026 ASSERT (state); 00027 ASSERT (mainWindow); 00028 state->put (s_key, this); 00029 }
IgQtAppContextService::~IgQtAppContextService | ( | void | ) |
Definition at line 31 of file IgQtAppContextService.cc.
References ASSERT, IgState::detach(), m_mainWindow, and m_state.
IgQtAppContextService::IgQtAppContextService | ( | const IgQtAppContextService & | ) | [private] |
void IgQtAppContextService::add | ( | ConnectionCallback | connection, | |
void * | data, | |||
bool | enable = true | |||
) |
Definition at line 39 of file IgQtAppContextService.cc.
References lat::CreateCallback(), focusIn(), focusOut(), m_focusInCallbacks, and m_focusOutCallbacks.
Referenced by IgControlCategory::registerMe(), and IgQtAppToolBarService::toolBarButton().
00041 { 00042 lat::Callback focusIn; 00043 lat::Callback focusOut; 00044 focusIn = lat::CreateCallback (connection, data, enable); 00045 focusOut = lat::CreateCallback (connection, data, false); 00046 00047 m_focusInCallbacks.push_back (focusIn); 00048 m_focusOutCallbacks.push_back (focusOut); 00049 }
void IgQtAppContextService::addOnFocusIn | ( | lat::CallbackRep * | callback | ) |
Definition at line 53 of file IgQtAppContextService.cc.
References m_focusInCallbacks.
Referenced by Ig3DBaseWindow::initMenu(), IgSpareWindow::initToolBar(), IgRPhiWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), Ig3DWindow::initToolBar(), Ig3DBaseWindow::initToolBar(), IgQtAppMenuService::insertItem(), IgRPhiViewPropertiesCategory::registerBrowser(), Ig3DNodeCategory::registerBrowser(), Ig2DViewPropertiesCategory::registerBrowser(), IgLegoViewPropertiesCategory::registerBrowser(), Ig3DClipsCategory::registerBrowser(), IgCommonViewCategory::registerBrowser(), Ig3DSlicersCategory::registerBrowser(), Ig3DViewpointsCategory::registerBrowser(), IgRZViewPropertiesCategory::registerBrowser(), IgSpareViewPropertiesCategory::registerBrowser(), Ig3DLightsCategory::registerBrowser(), Ig3DAnimsCategory::registerBrowser(), and Ig3DGridCategory::registerBrowser().
00054 { 00055 m_focusInCallbacks.push_back (lat::Callback (callback)); 00056 }
void IgQtAppContextService::addOnFocusOut | ( | lat::CallbackRep * | callback | ) |
Definition at line 59 of file IgQtAppContextService.cc.
References m_focusOutCallbacks.
Referenced by Ig3DBaseWindow::initMenu(), IgSpareWindow::initToolBar(), IgRPhiWindow::initToolBar(), IgLegoWindow::initToolBar(), IgRZWindow::initToolBar(), Ig3DWindow::initToolBar(), and IgQtAppMenuService::insertItem().
00060 { 00061 m_focusOutCallbacks.push_back (lat::Callback (callback)); 00062 }
Definition at line 69 of file IgQtAppContextService.cc.
References focusIn(), DBSPlugin::get(), i, m_focusInCallbacks, m_state, IgState::parent(), and parseConfig::service.
Referenced by add(), focusIn(), and IgQtFocusManager::windowActivated().
00070 { 00071 if (m_state->parent ()) 00072 { 00073 IgQtAppContextService *service; 00074 service = IgQtAppContextService::get (m_state->parent ()); 00075 if (service) 00076 service->focusIn (); 00077 } 00078 00079 //FIXME: use LOG macro for logging. 00080 //std::cerr << "Focusing in of state " << m_state << std::endl; 00081 for (CallbackList::iterator i = m_focusInCallbacks.begin (); 00082 i != m_focusInCallbacks.end (); 00083 i++) 00084 { 00085 (*i) (); 00086 } 00087 }
Definition at line 90 of file IgQtAppContextService.cc.
References focusOut(), DBSPlugin::get(), i, m_focusOutCallbacks, m_state, IgState::parent(), and parseConfig::service.
Referenced by add(), focusOut(), and IgQtFocusManager::windowActivated().
00091 { 00092 //FIXME: use LOG macro for logging. 00093 //std::cerr << "Focusing out of state " << m_state << std::endl; 00094 for (CallbackList::iterator i = m_focusOutCallbacks.begin (); 00095 i != m_focusOutCallbacks.end (); 00096 i++) 00097 { 00098 (*i) (); 00099 } 00100 00101 if (m_state->parent ()) 00102 { 00103 IgQtAppContextService *service; 00104 service = IgQtAppContextService::get (m_state->parent ()); 00105 if (service) 00106 service->focusOut (); 00107 } 00108 }
IgQtAppContextService::IG_DECLARE_STATE_ELEMENT | ( | IgQtAppContextService | ) | [private] |
IgQtAppContextService& IgQtAppContextService::operator= | ( | const IgQtAppContextService & | ) | [private] |
Definition at line 51 of file IgQtAppContextService.h.
Referenced by add(), addOnFocusIn(), and focusIn().
Definition at line 52 of file IgQtAppContextService.h.
Referenced by add(), addOnFocusOut(), and focusOut().
QWidget* IgQtAppContextService::m_mainWindow [private] |
IgState* IgQtAppContextService::m_state [private] |
Definition at line 46 of file IgQtAppContextService.h.
Referenced by focusIn(), focusOut(), and ~IgQtAppContextService().