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 char *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 char *pPayload) override |
virtual void | libreOfficeKitViewCallbackWithViewId (int nType, const char *pPayload, int nViewId) override |
virtual void | libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart) override |
virtual void | libreOfficeKitViewUpdatedCallback (int nType) override |
virtual void | libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId) override |
![]() | |
Idle (const char *pDebugName) | |
virtual void | Start (bool bStartTimer=true) override |
![]() | |
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 |
![]() | |
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 |
![]() | |
virtual | ~SfxLokCallbackInterface () |
virtual void | libreOfficeKitViewCallback (int nType, const char *pPayload)=0 |
virtual void | libreOfficeKitViewCallbackWithViewId (int nType, const char *pPayload, int nViewId)=0 |
virtual void | libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart)=0 |
virtual void | libreOfficeKitViewUpdatedCallback (int nType)=0 |
virtual void | libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId)=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, std::string > | m_states |
std::unordered_map< std::string, std::string > | m_lastStateChange |
std::unordered_map< int, std::unordered_map< int, std::string > > | 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 | |
![]() | |
virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const override |
Idle (bool bAuto, const char *pDebugName) | |
![]() | |
virtual void | SetDeletionFlags () override |
virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const override |
Timer (bool bAuto, const char *pDebugName) | |
![]() | |
const ImplSchedulerData * | GetSchedulerData () const |
virtual void | SetDeletionFlags () |
virtual sal_uInt64 | UpdateMinPeriod (sal_uInt64 nTimeNow) const=0 |
![]() | |
static void | StartTimer (sal_uInt64 nMS) |
|
private |
|
private |
|
explicit |
Definition at line 1347 of file init.cxx.
References m_states, pData, and Task::SetPriority().
|
overridevirtual |
Definition at line 1375 of file init.cxx.
References Task::Stop().
void CallbackFlushHandler::addViewStates | ( | int | viewId | ) |
Definition at line 2274 of file init.cxx.
References m_viewStates, and result.
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 2103 of file init.cxx.
References SfxViewShell::getLOKPayload(), desktop::CallbackFlushHandler::CallbackData::getPayload(), ignore, m_queue1, m_queue2, SAL_INFO, and type.
Referenced by enqueueUpdatedTypes().
|
private |
Definition at line 2041 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 2116 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.
|
overridevirtual |
Implements SfxLokCallbackInterface.
|
overridevirtual |
|
overridevirtual |
Implements SfxLokCallbackInterface.
Definition at line 1456 of file init.cxx.
References isUpdatedType(), lock(), m_mutex, nType, SAL_INFO, and setUpdatedType().
|
overridevirtual |
Implements SfxLokCallbackInterface.
Definition at line 1464 of file init.cxx.
References isUpdatedTypePerViewId(), lock(), m_mutex, nType, SAL_INFO, and setUpdatedTypePerViewId().
|
private |
Definition at line 1748 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_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 1867 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 1478 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 char * | data | ||
) |
Definition at line 1472 of file init.cxx.
Referenced by libreOfficeKitViewCallback(), libreOfficeKitViewCallbackWithViewId(), libreOfficeKitViewInvalidateTilesCallback(), and queue().
|
private |
Definition at line 2236 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 2283 of file init.cxx.
References m_viewStates.
|
private |
Definition at line 1402 of file init.cxx.
References nType, and setUpdatedType().
Referenced by queue().
Definition at line 1418 of file init.cxx.
References isUpdatedTypePerViewId(), comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation(), m_updatedTypesPerViewId, o3tl::make_unsigned(), nType, and setUpdatedTypePerViewId().
Referenced by queue().
|
private |
Definition at line 1392 of file init.cxx.
References isUpdatedType(), m_updatedTypes, o3tl::make_unsigned(), nType, startTimer(), and value.
Referenced by libreOfficeKitViewUpdatedCallback(), and resetUpdatedType().
|
private |
Definition at line 1407 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 2228 of file init.cxx.
References Task::IsActive(), m_TimeoutIdle, Idle::Start(), and Timer::Start().
Referenced by queue(), setUpdatedType(), and setUpdatedTypePerViewId().
|
private |
Referenced by processInvalidateTilesEvent(), queue(), and removeAll().
|
private |
|
private |
|
private |
Definition at line 223 of file init.hxx.
Referenced by Invoke(), libreOfficeKitViewUpdatedCallback(), libreOfficeKitViewUpdatedCallbackPerViewId(), and queue().
|
private |
|
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 193 of file init.hxx.
Referenced by enqueueUpdatedType(), Invoke(), processInvalidateTilesEvent(), processWindowEvent(), queue(), and removeAll().
|
private |
Definition at line 194 of file init.hxx.
Referenced by enqueueUpdatedType(), Invoke(), processWindowEvent(), queue(), and removeAll().
Definition at line 195 of file init.hxx.
Referenced by CallbackFlushHandler(), and Invoke().
|
private |
Definition at line 232 of file init.hxx.
Referenced by Invoke(), and startTimer().
|
private |
Definition at line 209 of file init.hxx.
Referenced by enqueueUpdatedTypes(), and setUpdatedType().
|
private |
Definition at line 216 of file init.hxx.
Referenced by enqueueUpdatedTypes(), resetUpdatedTypePerViewId(), and setUpdatedTypePerViewId().
|
private |
Definition at line 219 of file init.hxx.
Referenced by enqueueUpdatedTypes(), and Invoke().
|
private |
Definition at line 197 of file init.hxx.
Referenced by addViewStates(), Invoke(), and removeViewStates().