[3.0] Add default value into window member data
[platform/core/uifw/dali-adaptor.git] / adaptors / wayland / window-impl-wl.cpp
index da7a1c0..e6f3853 100644 (file)
@@ -63,8 +63,17 @@ struct Window::EventHandler
    */
   EventHandler( Window* window )
   : mWindow( window ),
+    mWindowPropertyHandler( NULL ),
+    mClientMessagehandler( NULL ),
     mEcoreWindow( 0 )
   {
+    // store ecore window handle
+    ECore::WindowRenderSurface* wlWindow( dynamic_cast< ECore::WindowRenderSurface * >( mWindow->mSurface ) );
+    if( wlWindow )
+    {
+      mEcoreWindow = wlWindow->GetWlWindow();
+    }
+    DALI_ASSERT_ALWAYS( mEcoreWindow != 0 && "There is no ecore wl window");
   }
 
   /**
@@ -104,11 +113,11 @@ struct Window::EventHandler
 };
 
 
-Window* Window::New(const PositionSize& posSize, const std::string& name, bool isTransparent)
+Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
 {
   Window* window = new Window();
   window->mIsTransparent = isTransparent;
-  window->Initialize(posSize, name);
+  window->Initialize(posSize, name, className);
   return window;
 }
 
@@ -148,11 +157,6 @@ RenderSurface* Window::GetSurface()
   return mSurface;
 }
 
-void Window::SetIndicatorStyle( Dali::Window::IndicatorStyle style )
-{
-  mIndicatorStyle = style;
-}
-
 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
 {
   DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "visible : %d\n", visibleMode );
@@ -184,7 +188,6 @@ void Window::SetClass(std::string name, std::string klass)
 
 Window::Window()
 : mSurface(NULL),
-  mIndicatorStyle(Dali::Window::CHANGEABLE_COLOR),
   mIndicatorVisible(Dali::Window::VISIBLE),
   mIndicatorIsShown(false),
   mShowRotatedIndicatorOnClose(false),
@@ -196,7 +199,9 @@ Window::Window()
   mNextIndicatorOrientation(Dali::Window::PORTRAIT),
   mIndicatorOpacityMode(Dali::Window::OPAQUE),
   mOverlay(NULL),
-  mAdaptor(NULL)
+  mAdaptor(NULL),
+  mEventHandler(NULL),
+  mPreferredOrientation(Dali::Window::PORTRAIT)
 {
 }
 
@@ -220,12 +225,16 @@ Window::~Window()
   delete mSurface;
 }
 
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name)
+void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
 {
   // create an Wayland window by default
   Any surface;
-  Any display;
-  mSurface = new ECore::WindowRenderSurface( windowPosition, surface, display, name, mIsTransparent );
+  ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+  SetClass( name, className );
+  windowSurface->Map();
+
+  mSurface = windowSurface;
+
   mOrientation = Orientation::New(this);
 
   // create event handler for Wayland window
@@ -238,7 +247,7 @@ void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
   {
     if( mIndicatorVisible != Dali::Window::INVISIBLE )
     {
-      mIndicator = new Indicator( mAdaptor, mIndicatorOrientation, mIndicatorStyle, this );
+      mIndicator = new Indicator( mAdaptor, mIndicatorOrientation, this );
       mIndicator->SetOpacityMode( mIndicatorOpacityMode );
       Dali::Actor actor = mIndicator->GetActor();
       SetIndicatorActorRotation();
@@ -411,11 +420,6 @@ void Window::OnDestroy()
   mAdaptor = NULL;
 }
 
-OrientationPtr Window::GetOrientation()
-{
-  return mOrientation;
-}
-
 void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation)
 {
   bool found = false;