void OfxOverlayInteract::drawOverlay(TimeValue time, const RenderScale & renderScale, ViewIdx view) { EffectInstancePtr effect = getEffect(); EffectInstanceTLSDataPtr tls = effect->getOrCreateTLSObject(); EffectActionArgsSetter_RAII actionArgsTls(tls, kOfxInteractActionDraw, time, view, renderScale #ifdef DEBUG , /*canSetValue*/ true , /*canBeCalledRecursively*/ false #endif ); ThreadIsActionCaller_RAII actionCaller(toOfxEffectInstance(effect)); OfxRGBAColourD pickerColor; bool hasPicker = hasColorPicker(); if (hasPicker) { pickerColor = colorToOfxColor(getLastColorPickerColor()); } drawAction(time, renderScale, view, hasPicker ? &pickerColor : /*colourPicker=*/0); }
bool OfxOverlayInteract::onOverlayKeyDown(TimeValue time, const RenderScale & renderScale, ViewIdx view, Key key, KeyboardModifiers /*modifiers*/) { EffectInstancePtr effect = getEffect(); EffectInstanceTLSDataPtr tls = effect->getOrCreateTLSObject(); EffectActionArgsSetter_RAII actionArgsTls(tls, kOfxInteractActionKeyDown, time, view, renderScale #ifdef DEBUG , /*canSetValue*/ true , /*canBeCalledRecursively*/ true #endif ); ThreadIsActionCaller_RAII actionCaller(toOfxEffectInstance(effect)); OfxRGBAColourD pickerColor; bool hasPicker = hasColorPicker(); if (hasPicker) { pickerColor = colorToOfxColor(getLastColorPickerColor()); } QByteArray keyStr; OfxStatus stat = keyDownAction( time, renderScale, view,hasPicker ? &pickerColor : /*colourPicker=*/0, (int)key, keyStr.data() ); if (stat == kOfxStatOK) { return true; } return false; }
bool OfxOverlayInteract::onOverlayFocusLost(TimeValue time, const RenderScale & renderScale, ViewIdx view) { EffectInstancePtr effect = getEffect(); EffectInstanceTLSDataPtr tls = effect->getOrCreateTLSObject(); EffectActionArgsSetter_RAII actionArgsTls(tls, kOfxInteractActionLoseFocus, time, view, renderScale #ifdef DEBUG , /*canSetValue*/ true , /*canBeCalledRecursively*/ true #endif ); ThreadIsActionCaller_RAII actionCaller(toOfxEffectInstance(effect)); OfxRGBAColourD pickerColor; bool hasPicker = hasColorPicker(); if (hasPicker) { pickerColor = colorToOfxColor(getLastColorPickerColor()); } OfxStatus stat; stat = loseFocusAction(time, renderScale, view, hasPicker ? &pickerColor : /*colourPicker=*/0); if (stat == kOfxStatOK) { return true; } return false; }
bool OfxOverlayInteract::onOverlayPenMotion(TimeValue time, const RenderScale & renderScale, ViewIdx view, const QPointF & viewportPos, const QPointF & pos, double pressure, TimeValue /*timestamp*/) { OfxPointD penPos; penPos.x = pos.x(); penPos.y = pos.y(); OfxPointI penPosViewport; penPosViewport.x = viewportPos.x(); penPosViewport.y = viewportPos.y(); OfxStatus stat; EffectInstancePtr effect = getEffect(); EffectInstanceTLSDataPtr tls = effect->getOrCreateTLSObject(); EffectActionArgsSetter_RAII actionArgsTls(tls, kOfxInteractActionPenMotion, time, view, renderScale #ifdef DEBUG , /*canSetValue*/ true , /*canBeCalledRecursively*/ true #endif ); ThreadIsActionCaller_RAII actionCaller(toOfxEffectInstance(effect)); OfxRGBAColourD pickerColor; bool hasPicker = hasColorPicker(); if (hasPicker) { pickerColor = colorToOfxColor(getLastColorPickerColor()); } stat = penMotionAction(time, renderScale, view, hasPicker ? &pickerColor : /*colourPicker=*/0, penPos, penPosViewport, pressure); if (stat == kOfxStatOK) { return true; } return false; }