Dali 3D User Interface Engine
adaptor-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_ADAPTOR_IMPL_H__
2 #define __DALI_INTERNAL_ADAPTOR_IMPL_H__
3 
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
27 
28 // INTERNAL INCLUDES
29 #include <adaptor.h>
30 #include <render-surface.h>
31 #include <tts-player.h>
32 #include <imf-manager.h>
33 #include <clipboard.h>
34 
40 #include <damage-observer.h>
42 #include <kernel-trace.h>
43 #include <system-trace.h>
44 #include <trigger-event-factory.h>
46 
47 namespace Dali
48 {
49 
50 class RenderSurface;
51 class Window;
52 
53 namespace Integration
54 {
55 class Core;
56 class GlAbstraction;
57 }
58 
59 namespace Internal
60 {
61 
62 namespace Adaptor
63 {
64 class EventHandler;
65 class EglFactory;
66 class GestureManager;
67 class GlImplementation;
68 class GlSyncImplementation;
69 class ThreadController;
70 class TriggerEvent;
71 class CallbackManager;
72 class FeedbackPluginProxy;
73 class FeedbackController;
74 class RotationObserver;
75 class VSyncMonitor;
76 class PerformanceInterface;
77 class LifeCycleObserver;
78 class ObjectProfiler;
79 
85  public CoreEventInterface,
86  public DamageObserver,
88 {
89 public:
90 
91  typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
92 
102  static Dali::Adaptor* New( Any nativeWindow,
103  RenderSurface* surface,
104  Dali::Configuration::ContextLoss configuration,
105  EnvironmentOptions* environmentOptions );
106 
113  static Dali::Adaptor* New( Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions );
114 
118  void Initialize(Dali::Configuration::ContextLoss configuration);
119 
123  virtual ~Adaptor();
124 
128  static Dali::Adaptor& Get();
129 
133  static bool IsAvailable();
134 
138  void SceneCreated();
139 
140 public: // AdaptorInternalServices implementation
144  virtual void Start();
145 
149  virtual void Pause();
150 
154  virtual void Resume();
155 
159  virtual void Stop();
160 
164  virtual void ContextLost();
165 
169  virtual void ContextRegained();
170 
174  virtual void FeedTouchPoint( TouchPoint& point, int timeStamp );
175 
179  virtual void FeedWheelEvent( WheelEvent& wheelEvent );
180 
184  virtual void FeedKeyEvent( KeyEvent& keyEvent );
185 
189  virtual bool MoveResize( const PositionSize& positionSize );
190 
194  virtual void SurfaceResized( const PositionSize& positionSize );
195 
199  virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
200 
204  virtual RenderSurface& GetSurface() const;
205 
209  virtual void ReleaseSurfaceLock();
210 
217 
221  virtual bool AddIdle( CallbackBase* callback );
222 
223 public:
224 
228  virtual Dali::Integration::Core& GetCore();
229 
233  void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
234 
238  void SetUseHardwareVSync(bool useHardware);
239 
243  EglFactory& GetEGLFactory() const;
244 
250 
256 
262 
268  void SetRotationObserver( RotationObserver* observer );
269 
275 
282  void SetMinimumPinchDistance(float distance);
283 
290 
291 public:
292 
298  void AddObserver( LifeCycleObserver& observer );
299 
305  void RemoveObserver( LifeCycleObserver& observer );
306 
310  void SendNotificationEvent();
311 
315  void RequestUpdateOnce();
316 
320  void NotifySceneCreated();
321 
325  void NotifyLanguageChanged();
326 
327 public: //AdaptorInternalServices
328 
333 
338 
343 
347  virtual TriggerEventInterface& GetProcessCoreEventsTrigger();
348 
352  virtual TriggerEventFactoryInterface& GetTriggerEventFactoryInterface();
353 
358 
362  virtual RenderSurface* GetRenderSurfaceInterface();
363 
368 
373 
378 
383 
384 public: // Stereoscopy
385 
389  void SetViewMode( ViewMode viewMode );
390 
394  ViewMode GetViewMode() const;
395 
399  void SetStereoBase( float stereoBase );
400 
404  float GetStereoBase() const;
405 
406 public: // Signals
407 
412  {
413  return mResizedSignal;
414  }
415 
420  {
421  return mLanguageChangedSignal;
422  }
423 
424 private: // From Dali::Internal::Adaptor::CoreEventInterface
425 
429  virtual void QueueCoreEvent(const Dali::Integration::Event& event);
430 
434  virtual void ProcessCoreEvents();
435 
436 private: // From Dali::Integration::RenderController
437 
441  virtual void RequestUpdate();
442 
447  virtual void RequestProcessEventsOnIdle();
448 
449 private: // From Dali::Internal::Adaptor::WindowVisibilityObserver
450 
454  virtual void OnWindowShown();
455 
459  virtual void OnWindowHidden();
460 
461 private: // From Dali::Internal::Adaptor::DamageObserver
462 
466  void OnDamaged( const DamageArea& area );
467 
468 private:
469 
470  // Undefined
471  Adaptor(const Adaptor&);
473 
474 private:
475 
479  void SurfaceSizeChanged(const PositionSize& positionSize);
480 
485  void SetSurface(RenderSurface *surface);
486 
491 
496  void GetDataStoragePath(std::string& path);
497 
498 private:
499 
509  Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions );
510 
511 private: // Types
512 
513  enum State
514  {
520  };
521 
522  typedef std::vector<LifeCycleObserver*> ObserverContainer;
523 
524 private: // Data
525 
528 
529  Dali::Adaptor& mAdaptor;
535  GlSyncImplementation* mGlSync;
537 
539  RenderSurface* mSurface;
541 
545  TriggerEventInterface* mNotificationTrigger;
548  FeedbackController* mFeedbackController;
557  TriggerEventFactory mTriggerEventFactory;
561 public:
562  inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) {return *adaptor.mImpl;}
563 };
564 
565 } // namespace Internal
566 
567 } // namespace Adaptor
568 
569 } // namespace Dali
570 
571 #endif // __DALI_INTERNAL_ADAPTOR_IMPL_H__
Dali Docs Home
Read more about Dali