27 #ifndef _ODEDITORIMPL_H_INCLUDED_
28 #define _ODEDITORIMPL_H_INCLUDED_
43 #define FX_SAFE_CALL_REACTOR_EVENT_IMPL(reactor, method, params, index) \
45 reactor->method params; \
46 } catch (const OdError& err ) { \
47 fxReportReactorExceptionImpl( index, reactor.get(), #method, err ); \
50 #define FX_SAFE_CALL_REACTOR_EVENT_IMPL(reactor, method, params, index) { reactor->method params; }
53 #include "FxDbExtension.h"
56 #define FX_BEGIN_MAIN_THREAD()
57 #define FX_END_MAIN_THREAD()
59 #define FX_BEGIN_MAIN_THREAD() \
60 CFxDbExtension::StaticExecuteInMainThread( [&]() {
61 #define FX_END_MAIN_THREAD() \
65 #define RXEVENT_FIRE(method, inparams, params) \
66 inline void fire_##method inparams \
68 FX_BEGIN_MAIN_THREAD(); \
69 TD_AUTOLOCK( m_mutex ); \
73 unsigned i, size = m_reactors.size(); \
74 for (i = 0; i < size; ++i) \
76 if (!m_reactors[i].isNull()) \
78 FX_SAFE_CALL_REACTOR_EVENT_IMPL( m_reactors[i], method, params, i ) \
87 if (!(--m_EventCounter))\
88 while( m_reactors.remove(OdRxEventReactorPtr()) );\
89 FX_END_MAIN_THREAD(); \
92 #define EDEVENT_FIRE(method, inparams, params) \
93 inline void fire_##method inparams \
95 FX_BEGIN_MAIN_THREAD(); \
96 TD_AUTOLOCK( m_mutex ); \
100 unsigned i, size = m_reactors.size(); \
101 for (i = 0; i < size; ++i) \
103 if (!m_reactors[i].isNull())\
105 OdEditorReactorPtr pReactor = OdEditorReactor::cast(m_reactors[i]); \
106 if (pReactor.get()) \
108 FX_SAFE_CALL_REACTOR_EVENT_IMPL( pReactor, method, params, i ) \
118 if (!(--m_EventCounter))\
119 while( m_reactors.remove(OdRxEventReactorPtr()) );\
120 FX_END_MAIN_THREAD(); \
216 EDEVENT_FIRE(undoSubcommandAuto, (
int activity,
bool state), (activity, state))
217 EDEVENT_FIRE(undoSubcommandControl,(
int activity,
int option), (activity, option))
222 EDEVENT_FIRE(undoSubcommandNumber, (
int activity,
int num), (activity, num))
239 EDEVENT_FIRE(toolbarBitmapSizeWillChange, (
bool largeBitmaps), (largeBitmaps))
240 EDEVENT_FIRE(toolbarBitmapSizeChanged, (
bool largeBitmaps), (largeBitmaps))
OdSmartPtr< OdEditorImpl > OdEditorImplPtr
#define RXEVENT_FIRE(method, inparams, params)
#define EDEVENT_FIRE(method, inparams, params)
ODRX_DECLARE_MEMBERS(OdEditorImpl)
OdArray< OdRxEventReactorPtr > m_reactors
void addReactor(OdRxEventReactor *pReactor)
RXEVENT_FIRE(dwgFileOpened,(OdDbDatabase *db, const OdString &filename),(db, filename)) RXEVENT_FIRE(initialDwgFileOpenComplete
ODRX_DECLARE_MEMBERS(OdRxEventImpl)
OdRefCounter m_EventCounter
void removeReactor(OdRxEventReactor *pReactor)