X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fscene-impl.h;h=52ea3560582a0a50fd1f3fbefd3c65a05e1d3dd4;hb=48c46a4336e2126a5c658d70d8f22a745d2b1ad0;hp=7065c1649805213cb48af562ecf9b5f9105c0e1e;hpb=128cea946c9d6d4a76ab7bda08bfdd532be549b7;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/scene-impl.h b/dali/internal/event/common/scene-impl.h index 7065c16..52ea356 100644 --- a/dali/internal/event/common/scene-impl.h +++ b/dali/internal/event/common/scene-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,63 +38,9 @@ struct Event; namespace Internal { -//@todo Break this dependence somehow. -namespace Render -{ -class Renderer; -} - namespace SceneGraph { class Scene; - -struct DirtyRect -{ - DirtyRect(Node* node, Render::Renderer* renderer, int32_t frame, Rect& rect) - : node(node), - renderer(renderer), - frame(frame), - rect(rect), - visited(true) - { - } - - DirtyRect() - : node(nullptr), - renderer(nullptr), - frame(0), - rect(), - visited(true) - { - } - - bool operator<(const DirtyRect& rhs) const - { - if(node == rhs.node) - { - if(renderer == rhs.renderer) - { - return frame > rhs.frame; // Most recent rects come first - } - else - { - return renderer < rhs.renderer; - } - } - else - { - return node < rhs.node; - } - } - - Node* node; - Render::Renderer* renderer; - int32_t frame; - - Rect rect; - bool visited; -}; - } // namespace SceneGraph class EventProcessor; @@ -116,7 +62,7 @@ public: /** * @copydoc Dali::Integration::Scene::New */ - static ScenePtr New(Size size, int32_t orientation = 0); + static ScenePtr New(Size size, int32_t windowOrientation = 0, int32_t screenOrientation = 0); /** * virtual destructor @@ -240,9 +186,10 @@ public: * * @param[in] width The width of rotated surface * @param[in] height The height of rotated surface - * @param[in] orientation The orientation of rotated surface + * @param[in] windowOrientation the current window orientation + * @param[in] screenOrientation the current screen orientation */ - void SurfaceRotated(float width, float height, int32_t orientation); + void SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation); /** * @copydoc Dali::Integration::Scene::SetRotationCompletedAcknowledgement @@ -260,6 +207,11 @@ public: int32_t GetCurrentSurfaceOrientation() const; /** + * @copydoc Dali::Integration::Scene::GetCurrentScreenOrientation + */ + int32_t GetCurrentScreenOrientation() const; + + /** * @copydoc Dali::Integration::Scene::GetCurrentSurfaceRect */ const Rect& GetCurrentSurfaceRect() const; @@ -272,7 +224,7 @@ public: /** * @copydoc Dali::Integration::Scene::SetSurfaceRenderTarget */ - void SetSurfaceRenderTarget(Graphics::RenderTarget* renderTarget); + void SetSurfaceRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo); /** * Used by the EventProcessor to emit key event signals. @@ -288,6 +240,13 @@ public: bool EmitKeyEventGeneratedSignal(const Dali::KeyEvent& event); /** + * Used by the KeyEventProcessor to emit InterceptKeyEventSignal signals. + * @param[in] event The key event. + * @return The return is true if KeyEvent is consumed, otherwise false. + */ + bool EmitInterceptKeyEventSignal(const Dali::KeyEvent& event); + + /** * Emits the event processing finished signal. * * @see Dali::Scene::SignalEventProcessingFinished() @@ -307,6 +266,13 @@ public: void EmitWheelEventSignal(const Dali::WheelEvent& event); /** + * Used by the WheelEventProcessor to emit WheelEventGenerated signals. + * @param[in] event The wheel event. + * @return The return is true if WheelEvent is consumed, otherwise false. + */ + bool EmitWheelEventGeneratedSignal(const Dali::WheelEvent& event); + + /** * @copydoc Dali::Integration::Scene::AddFrameRenderedCallback */ void AddFrameRenderedCallback(std::unique_ptr callback, int32_t frameId); @@ -337,6 +303,11 @@ public: Integration::Scene::KeyEventGeneratedSignalType& KeyEventGeneratedSignal(); /** + * @copydoc Integration::Scene::InterceptKeyEventSignal() + */ + Integration::Scene::KeyEventGeneratedSignalType& InterceptKeyEventSignal(); + + /** * @copydoc Integration::Scene::SignalEventProcessingFinished() */ Integration::Scene::EventProcessingFinishedSignalType& EventProcessingFinishedSignal(); @@ -352,11 +323,9 @@ public: Integration::Scene::WheelEventSignalType& WheelEventSignal(); /** - * @brief Get ItemsDirtyRects - * - * @return the ItemsDirtyRects + * @copydoc Integration::Scene::WheelEventGeneratedSignal() */ - std::vector& GetItemsDirtyRects(); + Integration::Scene::WheelEventGeneratedSignalType& WheelEventGeneratedSignal(); public: /** @@ -379,9 +348,10 @@ private: * Second-phase constructor. * * @param[in] size The size of the set surface - * @param[in] orientation The orientation of the set surface for this scene + * @param[in] windowOrientation The rotated angle of the set surface for this scene + * @param[in] screenOrientation The rotated angle of the screen */ - void Initialize(Size size, int32_t orientation); + void Initialize(Size size, int32_t windowOrientation, int32_t screenOrientation); // Undefined Scene(const Scene&) = delete; @@ -394,9 +364,10 @@ private: * * @param[in] width The width of rotated surface * @param[in] height The height of rotated surface - * @param[in] orientation The orientation of rotated surface + * @param[in] windowOrientation the current window orientation + * @param[in] screenOrientation the current screen orientation */ - void ChangedSurface(float width, float height, int32_t orientation); + void ChangedSurface(float width, float height, int32_t windowOrientation, int32_t screenOrientation); private: Internal::SceneGraph::Scene* mSceneObject; @@ -424,9 +395,13 @@ private: // The Surface's orientation int32_t mSurfaceOrientation; + // The Screen's orientation + int32_t mScreenOrientation; + // The key event signal Integration::Scene::KeyEventSignalType mKeyEventSignal; Integration::Scene::KeyEventGeneratedSignalType mKeyEventGeneratedSignal; + Integration::Scene::KeyEventGeneratedSignalType mInterceptKeyEventSignal; // The event processing finished signal Integration::Scene::EventProcessingFinishedSignalType mEventProcessingFinishedSignal; @@ -435,9 +410,8 @@ private: Integration::Scene::TouchEventSignalType mTouchedSignal; // The wheel event signal - Integration::Scene::WheelEventSignalType mWheelEventSignal; - - std::vector mItemsDirtyRects; + Integration::Scene::WheelEventSignalType mWheelEventSignal; + Integration::Scene::WheelEventGeneratedSignalType mWheelEventGeneratedSignal; }; } // namespace Internal