1 #ifndef DALI_TOOLKIT_SCENE_HOLDER_IMPL_H
2 #define DALI_TOOLKIT_SCENE_HOLDER_IMPL_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <test-render-surface.h>
23 #include <dali/integration-api/scene.h>
24 #include <dali/public-api/actors/layer.h>
25 #include <dali/public-api/object/base-object.h>
36 class SceneHolder : public Dali::BaseObject
40 SceneHolder( const Dali::Rect<int>& positionSize );
42 virtual ~SceneHolder();
44 void Add( Dali::Actor actor );
46 void Remove( Dali::Actor actor );
48 Dali::Layer GetRootLayer() const;
50 void SetBackgroundColor( Vector4 color );
52 Vector4 GetBackgroundColor() const;
54 void FeedTouchPoint( Dali::TouchPoint& point, int timeStamp );
56 void FeedWheelEvent( Dali::WheelEvent& wheelEvent );
58 void FeedKeyEvent( Dali::KeyEvent& keyEvent );
60 Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal();
62 Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
64 Dali::Integration::SceneHolder::TouchSignalType& TouchSignal();
66 Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal();
68 Integration::Scene GetScene();
70 Integration::RenderSurface& GetRenderSurface();
74 TestRenderSurface mRenderSurface;
75 Integration::Scene mScene;
78 } // namespace Adaptor
80 } // namespace Internal
82 inline Internal::Adaptor::SceneHolder& GetImplementation( Dali::Integration::SceneHolder& sceneHolder )
84 DALI_ASSERT_ALWAYS( sceneHolder && "SceneHolder handle is empty" );
85 BaseObject& object = sceneHolder.GetBaseObject();
86 return static_cast<Internal::Adaptor::SceneHolder&>( object );
89 inline const Internal::Adaptor::SceneHolder& GetImplementation( const Dali::Integration::SceneHolder& sceneHolder )
91 DALI_ASSERT_ALWAYS( sceneHolder && "SceneHolder handle is empty" );
92 const BaseObject& object = sceneHolder.GetBaseObject();
93 return static_cast<const Internal::Adaptor::SceneHolder&>( object );
98 #endif // DALI_TOOLKIT_SCENE_HOLDER_IMPL_H