[dali_1.4.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-window.cpp
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // EXTERNAL INCLUDES
19 #include <dali/public-api/actors/actor.h>
20 #include <dali/public-api/actors/layer.h>
21 #include <dali/public-api/common/stage.h>
22 #include <dali/public-api/object/base-object.h>
23
24 // INTERNAL INCLUDES
25 #include "toolkit-window.h"
26
27 namespace Dali
28 {
29
30 class Window;
31
32 /********************************************************************************
33  * Stub for Dali::Internal::Adaptor::Window
34  ********************************************************************************/
35
36 namespace Internal
37 {
38 namespace Adaptor
39 {
40
41 class Window : public Dali::BaseObject
42 {
43 public:
44
45   Window()
46   {
47   }
48
49   virtual ~Window()
50   {
51   }
52
53   static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
54   {
55     return new Window();
56   }
57
58   static Dali::Window Get( Dali::Actor actor )
59   {
60     return Dali::Window();
61   }
62 };
63
64 } // Adaptor
65 } // Internal
66
67 Window::Window()
68 {
69 }
70
71 Window::~Window()
72 {
73 }
74
75 Dali::Window Window::New( PositionSize windowPosition, const std::string& name, bool isTransparent )
76 {
77   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( windowPosition, name, "", isTransparent );
78   return Window( window );
79 }
80
81 Dali::Window Window::New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent )
82 {
83   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( windowPosition, name, className, isTransparent );
84   return Window( window );
85 }
86
87 Dali::Layer Window::GetRootLayer() const
88 {
89   return Dali::Stage::GetCurrent().GetRootLayer();
90 }
91
92 Window::Window( Internal::Adaptor::Window* window )
93 : BaseHandle( window )
94 {
95 }
96
97 namespace DevelWindow
98 {
99
100 Window Get( Actor actor )
101 {
102   return Internal::Adaptor::Window::Get( actor );
103 }
104
105 KeyEventSignalType& KeyEventSignal( Window window )
106 {
107   return Dali::Stage::GetCurrent().KeyEventSignal();
108 }
109
110 TouchSignalType& TouchSignal( Window window )
111 {
112   return Dali::Stage::GetCurrent().TouchSignal();
113 }
114
115 } // namespace DevelWindow
116
117 } // Dali