|
LibreOffice Module desktop (master) 1
|
One instance of this per view, handles flushing callbacks. More...
#include <init.hxx>
Classes | |
| struct | CallbackData |
| struct | PerViewIdData |
| class | TimeoutIdle |
Public Member Functions | |
| CallbackFlushHandler (LibreOfficeKitDocument *pDocument, LibreOfficeKitCallback pCallback, void *pData) | |
| virtual | ~CallbackFlushHandler () override |
| virtual void | Invoke () override |
| void | queue (const int type, const OString &data) |
| void | disableCallbacks () |
| Disables callbacks on this handler. More... | |
| void | enableCallbacks () |
| Enables callbacks on this handler. More... | |
| bool | callbacksDisabled () const |
| Returns true iff callbacks are disabled. More... | |
| void | addViewStates (int viewId) |
| void | removeViewStates (int viewId) |
| void | setViewId (int viewId) |
| virtual void | libreOfficeKitViewCallback (int nType, const OString &pPayload) override |
| virtual void | libreOfficeKitViewCallbackWithViewId (int nType, const OString &pPayload, int nViewId) override |
| virtual void | libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart, int nMode) override |
| virtual void | libreOfficeKitViewUpdatedCallback (int nType) override |
| virtual void | libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId) override |
| virtual void | libreOfficeKitViewAddPendingInvalidateTiles () override |
| virtual void | dumpState (rtl::OStringBuffer &rState) override |
Public Member Functions inherited from Idle | |
| Idle (const char *pDebugName) | |
| virtual void | Start (bool bStartTimer=true) override |
Public Member Functions inherited from Timer | |
| Timer (const char *pDebugName) | |
| Timer (const Timer &rTimer) | |
| virtual | ~Timer () override |
| Timer & | operator= (const Timer &rTimer) |
| virtual void | Invoke () override |
| void | Invoke (Timer *arg) |
| void | SetInvokeHandler (const Link< Timer *, void > &rLink) |
| void | ClearInvokeHandler () |
| void | SetTimeout (sal_uInt64 nTimeoutMs) |
| sal_uInt64 | GetTimeout () const |
| virtual void | Start (bool bStartTimer=true) override |
Public Member Functions inherited from Task | |
| Task (const char *pDebugName) | |
| Task (const Task &rTask) | |
| virtual | ~Task () COVERITY_NOEXCEPT_FALSE |
| Task & | operator= (const Task &rTask) |
| void | SetPriority (TaskPriority ePriority) |
| TaskPriority | GetPriority () const |
| const char * | GetDebugName () const |
| virtual void | Invoke ()=0 |
| virtual void | Start (bool bStartTimer=true) |
| void | Stop () |
| bool | IsActive () const |
| void | SetStatic () |
| bool | IsStatic () const |
Public Member Functions inherited from SfxLokCallbackInterface | |
| virtual | ~SfxLokCallbackInterface () |
| virtual void | libreOfficeKitViewCallback (int nType, const rtl::OString &pPayload)=0 |
| virtual void | libreOfficeKitViewCallbackWithViewId (int nType, const rtl::OString &pPayload, int nViewId)=0 |
| virtual void | libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart, int nMode)=0 |
| virtual void | libreOfficeKitViewUpdatedCallback (int nType)=0 |
| virtual void | libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId)=0 |
| virtual void | libreOfficeKitViewAddPendingInvalidateTiles ()=0 |
| virtual void | dumpState (rtl::OStringBuffer &rState)=0 |
Private Types | |
| typedef std::vector< int > | queue_type1 |
| typedef std::vector< CallbackData > | queue_type2 |
Private Member Functions | |
| void | startTimer () |
| bool | removeAll (int type) |
| bool | removeAll (int type, const std::function< bool(const CallbackData &)> &rTestFunc) |
| bool | processInvalidateTilesEvent (int type, CallbackData &aCallbackData) |
| bool | processWindowEvent (int type, CallbackData &aCallbackData) |
| queue_type2::iterator | toQueue2 (queue_type1::iterator) |
| queue_type2::reverse_iterator | toQueue2 (queue_type1::reverse_iterator) |
| void | queue (const int type, CallbackData &data) |
| void | enqueueUpdatedTypes () |
| void | enqueueUpdatedType (int type, const SfxViewShell *sourceViewShell, int viewId) |
| void | setUpdatedType (int nType, bool value) |
| void | setUpdatedTypePerViewId (int nType, int nViewId, int nSourceViewId, bool value) |
| void | resetUpdatedType (int nType) |
| void | resetUpdatedTypePerViewId (int nType, int nViewId) |
Private Attributes | |
| queue_type1 | m_queue1 |
| we frequently want to scan the queue, and mostly when we do so, we only care about the element type so we split the queue in 2 to make the scanning cache friendly. More... | |
| queue_type2 | m_queue2 |
| std::map< int, OString > | m_states |
| std::unordered_map< OString, OString > | m_lastStateChange |
| std::unordered_map< int, std::unordered_map< int, OString > > | m_viewStates |
| std::vector< bool > | m_updatedTypes |
| boost::container::flat_map< int, std::vector< PerViewIdData > > | m_updatedTypesPerViewId |
| LibreOfficeKitDocument * | m_pDocument |
| int | m_viewId = -1 |
| LibreOfficeKitCallback | m_pCallback |
| void * | m_pData |
| int | m_nDisableCallbacks |
| std::recursive_mutex | m_mutex |
| TimeoutIdle | m_TimeoutIdle |
Additional Inherited Members | |
Protected Member Functions inherited from Idle | |
| virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const override |
| Idle (bool bAuto, const char *pDebugName) | |
Protected Member Functions inherited from Timer | |
| virtual void | SetDeletionFlags () override |
| virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const override |
| Timer (bool bAuto, const char *pDebugName) | |
Protected Member Functions inherited from Task | |
| const ImplSchedulerData * | GetSchedulerData () const |
| virtual void | SetDeletionFlags () |
| virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const=0 |
Static Protected Member Functions inherited from Task | |
| static void | StartTimer (sal_uInt64 nMS) |
|
private |
|
private |
|
explicit |
Definition at line 1540 of file init.cxx.
References m_states, pData, and Task::SetPriority().
|
overridevirtual |
Definition at line 1568 of file init.cxx.
References Task::Stop().
| void CallbackFlushHandler::addViewStates | ( | int | viewId | ) |
Definition at line 2506 of file init.cxx.
References m_viewStates, and result.
|
inline |
|
inline |
|
overridevirtual |
Implements SfxLokCallbackInterface.
Definition at line 1665 of file init.cxx.
References i, m_nDisableCallbacks, m_states, and m_viewId.
|
inline |
|
private |
Definition at line 2331 of file init.cxx.
References SfxViewShell::getLOKPayload(), desktop::CallbackFlushHandler::CallbackData::getPayload(), m_queue1, m_queue2, SAL_INFO, and type.
Referenced by enqueueUpdatedTypes().
|
private |
Definition at line 2269 of file init.cxx.
References enqueueUpdatedType(), get(), SfxViewShell::GetFirst(), m_updatedTypes, m_updatedTypesPerViewId, m_viewId, o3tl::make_unsigned(), SAL_INFO, and type.
Referenced by Invoke().
|
overridevirtual |
Reimplemented from Timer.
Definition at line 2348 of file init.cxx.
References enqueueUpdatedTypes(), get(), SfxViewShell::GetFirst(), idx, lcl_isViewCallbackType(), lock(), m_lastStateChange, m_mutex, m_pCallback, m_pData, m_queue1, m_queue2, m_states, m_TimeoutIdle, m_viewId, m_viewStates, SAL_INFO, Task::Stop(), type, and value.
|
overridevirtual |
Implements SfxLokCallbackInterface.
Definition at line 1682 of file init.cxx.
References startTimer().
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Implements SfxLokCallbackInterface.
Definition at line 1649 of file init.cxx.
References isUpdatedType(), lock(), m_mutex, nType, SAL_INFO, and setUpdatedType().
|
overridevirtual |
Implements SfxLokCallbackInterface.
Definition at line 1657 of file init.cxx.
References isUpdatedTypePerViewId(), lock(), m_mutex, nType, SAL_INFO, and setUpdatedTypePerViewId().
|
private |
Definition at line 1973 of file init.cxx.
References tools::Rectangle::Contains(), tools::Rectangle::GetIntersection(), desktop::CallbackFlushHandler::CallbackData::getPayload(), desktop::CallbackFlushHandler::CallbackData::getRectangleAndPart(), if(), desktop::RectangleAndPart::isEmpty(), tools::Rectangle::IsEmpty(), desktop::RectangleAndPart::isInfinite(), desktop::RectangleAndPart::m_aRectangle, desktop::RectangleAndPart::m_nMode, desktop::RectangleAndPart::m_nPart, m_queue1, pos, removeAll(), SAL_INFO, toQueue2(), desktop::RectangleAndPart::toString(), tools::Rectangle::toString(), type, and tools::Rectangle::Union().
Referenced by queue().
|
private |
Definition at line 2095 of file init.cxx.
References desktop::CallbackFlushHandler::CallbackData::getJson(), desktop::CallbackFlushHandler::CallbackData::getPayload(), m_queue1, m_queue2, removeAll(), SAL_INFO, desktop::CallbackFlushHandler::CallbackData::setJson(), type, and desktop::CallbackFlushHandler::CallbackData::validate().
Referenced by queue().
|
private |
Definition at line 1694 of file init.cxx.
References callbacksDisabled(), SfxViewShell::Current(), doc_getDocumentType(), desktop::CallbackFlushHandler::CallbackData::getPayload(), desktop::CallbackFlushHandler::CallbackData::getViewId(), LokChartHelper::GetWindow(), i, desktop::CallbackFlushHandler::CallbackData::isEmpty(), isUpdatedType(), isUpdatedTypePerViewId(), lock(), m_mutex, m_pDocument, m_queue1, m_queue2, name, pos, processInvalidateTilesEvent(), processWindowEvent(), removeAll(), resetUpdatedType(), resetUpdatedTypePerViewId(), SAL_INFO, startTimer(), toQueue2(), type, and desktop::CallbackFlushHandler::CallbackData::validate().
| void CallbackFlushHandler::queue | ( | const int | type, |
| const OString & | data | ||
| ) |
Definition at line 1688 of file init.cxx.
Referenced by libreOfficeKitViewCallback(), libreOfficeKitViewCallbackWithViewId(), libreOfficeKitViewInvalidateTilesCallback(), and queue().
|
private |
Definition at line 2468 of file init.cxx.
References m_queue1, m_queue2, toQueue2(), and type.
Referenced by processInvalidateTilesEvent(), processWindowEvent(), and queue().
|
private |
| void CallbackFlushHandler::removeViewStates | ( | int | viewId | ) |
Definition at line 2515 of file init.cxx.
References m_viewStates.
|
private |
Definition at line 1595 of file init.cxx.
References nType, and setUpdatedType().
Referenced by queue().
Definition at line 1611 of file init.cxx.
References isUpdatedTypePerViewId(), comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation(), m_updatedTypesPerViewId, o3tl::make_unsigned(), nType, and setUpdatedTypePerViewId().
Referenced by queue().
|
private |
Definition at line 1585 of file init.cxx.
References isUpdatedType(), m_updatedTypes, o3tl::make_unsigned(), nType, startTimer(), and value.
Referenced by libreOfficeKitViewUpdatedCallback(), and resetUpdatedType().
|
private |
Definition at line 1600 of file init.cxx.
References isUpdatedTypePerViewId(), m_updatedTypesPerViewId, o3tl::make_unsigned(), nType, startTimer(), and value.
Referenced by libreOfficeKitViewUpdatedCallbackPerViewId(), and resetUpdatedTypePerViewId().
|
inline |
|
private |
Definition at line 2460 of file init.cxx.
References Task::IsActive(), m_TimeoutIdle, Idle::Start(), and Timer::Start().
Referenced by libreOfficeKitViewAddPendingInvalidateTiles(), queue(), setUpdatedType(), and setUpdatedTypePerViewId().
|
private |
Referenced by processInvalidateTilesEvent(), queue(), and removeAll().
|
private |
|
private |
|
private |
Definition at line 235 of file init.hxx.
Referenced by Invoke(), libreOfficeKitViewUpdatedCallback(), libreOfficeKitViewUpdatedCallbackPerViewId(), and queue().
|
private |
Definition at line 234 of file init.hxx.
Referenced by dumpState().
|
private |
|
private |
|
private |
|
private |
we frequently want to scan the queue, and mostly when we do so, we only care about the element type so we split the queue in 2 to make the scanning cache friendly.
Definition at line 205 of file init.hxx.
Referenced by enqueueUpdatedType(), Invoke(), processInvalidateTilesEvent(), processWindowEvent(), queue(), and removeAll().
|
private |
Definition at line 206 of file init.hxx.
Referenced by enqueueUpdatedType(), Invoke(), processWindowEvent(), queue(), and removeAll().
Definition at line 207 of file init.hxx.
Referenced by CallbackFlushHandler(), dumpState(), and Invoke().
|
private |
Definition at line 244 of file init.hxx.
Referenced by Invoke(), and startTimer().
|
private |
Definition at line 221 of file init.hxx.
Referenced by enqueueUpdatedTypes(), and setUpdatedType().
|
private |
Definition at line 228 of file init.hxx.
Referenced by enqueueUpdatedTypes(), resetUpdatedTypePerViewId(), and setUpdatedTypePerViewId().
|
private |
Definition at line 231 of file init.hxx.
Referenced by dumpState(), enqueueUpdatedTypes(), and Invoke().
|
private |
Definition at line 209 of file init.hxx.
Referenced by addViewStates(), Invoke(), and removeViewStates().