MCPcopy Create free account
hub / github.com/SpartanJ/eepp / scheduledUpdate

Method scheduledUpdate

src/eepp/ui/uicodeeditor.cpp:455–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void UICodeEditor::scheduledUpdate( const Time& ) {
456 if ( mDisableCursorBlinkingAfterAMinuteOfInactivity &&
457 mLastActivity.getElapsedTime() > Seconds( 60 ) ) {
458 if ( !mCursorVisible ) {
459 mCursorVisible = true;
460 invalidateDraw();
461 }
462 } else if ( hasFocus() && getUISceneNode()->getWindow()->hasFocus() ) {
463 if ( mBlinkTime != Time::Zero && mBlinkTimer.getElapsedTime() > mBlinkTime ) {
464 mCursorVisible = !mCursorVisible;
465 mBlinkTimer.restart();
466 invalidateDraw();
467 }
468 }
469
470 if ( mMouseDown || mMouseDownMinimap ) {
471 if ( !( getInput()->getPressTrigger() & EE_BUTTON_LMASK ) ) {
472 stopMinimapDragging( getInput()->getMousePos().asFloat() );
473 mMouseDown = false;
474 mMouseDownMinimap = false;
475 getInput()->captureMouse( false );
476 } else if ( !isMouseOverMeOrChildren() || mMinimapDragging ) {
477 onMouseMove( getUISceneNode()->getEventDispatcher()->getMousePos(),
478 getUISceneNode()->getEventDispatcher()->getPressTrigger() );
479 }
480 }
481
482 if ( !mVisible )
483 return;
484
485 if ( mDoc && !mDoc->isLoading() && !mDoc->isEmpty() &&
486 !mDoc->getSyntaxDefinition().getPatterns().empty() &&
487 mDoc->getHighlighter()->updateDirty( getVisibleLinesCount() ) ) {
488 invalidateDraw();
489 }
490
491 if ( mDoc && !mDoc->isLoading() && needsHorizontalLength() && isVisible() &&
492 mLongestLineWidthDirty &&
493 mLongestLineWidthLastUpdate.getElapsedTime() > mFindLongestLineWidthUpdateFrequency ) {
494 updateLongestLineWidth();
495 }
496
497 for ( auto& plugin : mPlugins )
498 plugin->update( this );
499}
500
501void UICodeEditor::updateLongestLineWidth() {
502 if ( needsHorizontalLength() && mDoc && !mDoc->isLoading() && !mDoc->isRunningTransaction() ) {

Callers

nothing calls this directly

Calls 15

SecondsFunction · 0.85
getElapsedTimeMethod · 0.80
captureMouseMethod · 0.80
getHighlighterMethod · 0.80
hasFocusMethod · 0.45
getWindowMethod · 0.45
restartMethod · 0.45
asFloatMethod · 0.45
getMousePosMethod · 0.45
getEventDispatcherMethod · 0.45
isLoadingMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected