Implement wayland specfic indicator, window appId, ... 70/81370/3
authorsuhyung Eom <suhyung.eom@samsung.com>
Mon, 25 Jul 2016 23:17:37 +0000 (08:17 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Thu, 28 Jul 2016 01:03:21 +0000 (10:03 +0900)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: Ideaca62e0683fe6ea5b1c07158906b9db3c47dd9

adaptors/common/adaptor-impl.h
adaptors/ecore/wayland/event-handler-ecore-wl.cpp
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp
adaptors/integration-api/wayland/ecore-wl-render-surface.h
adaptors/tizen/adaptor-impl-tizen.cpp
adaptors/ubuntu/adaptor-impl-ubuntu.cpp

index e920459..40b9bb2 100644 (file)
@@ -324,6 +324,11 @@ public:
    */
   void NotifyLanguageChanged();
 
+  /**
+   * Gets AppId of current application
+   */
+  void GetAppId( std::string& appId );
+
 public:  //AdaptorInternalServices
 
   /**
index 419e880..1d38c49 100644 (file)
@@ -49,6 +49,7 @@
 #include <physical-keyboard-impl.h>
 #include <style-monitor-impl.h>
 #include <base/core-event-interface.h>
+#include <virtual-keyboard.h>
 
 namespace Dali
 {
@@ -184,6 +185,10 @@ struct EventHandler::Impl
       // Register Mouse wheel events
       mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL,        EcoreEventMouseWheel,      handler ) );
 
+      // Register Focus events
+      mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN,  EcoreEventWindowFocusIn,   handler ) );
+      mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut,  handler ) );
+
       // Register Key events
       mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN,           EcoreEventKeyDown,         handler ) );
       mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP,             EcoreEventKeyUp,           handler ) );
@@ -376,10 +381,10 @@ struct EventHandler::Impl
       {
         std::string keyName( keyEvent->keyname );
         std::string keyString( "" );
-        int keyCode = 0/*ecore_x_keysym_keycode_get(keyEvent->keyname)*/;
+        int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname);
+        keyCode = (keyCode == -1) ? 0 : keyCode;
         int modifier( keyEvent->modifiers );
         unsigned long time = keyEvent->timestamp;
-
         if (!strncmp(keyEvent->keyname, "Keycode-", 8))
           keyCode = atoi(keyEvent->keyname + 8);
 
@@ -443,10 +448,10 @@ struct EventHandler::Impl
       {
         std::string keyName( keyEvent->keyname );
         std::string keyString( "" );
-        int keyCode = 0/*ecore_x_keysym_keycode_get(keyEvent->keyname)*/;
+        int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname);
+        keyCode = (keyCode == -1) ? 0 : keyCode;
         int modifier( keyEvent->modifiers );
-        unsigned long time( keyEvent->timestamp );
-
+        unsigned long time = keyEvent->timestamp;
         if (!strncmp(keyEvent->keyname, "Keycode-", 8))
           keyCode = atoi(keyEvent->keyname + 8);
 
index 32d0227..41c7f36 100644 (file)
@@ -34,7 +34,6 @@
 #include <ecore-indicator-impl.h>
 #include <window-visibility-observer.h>
 #include <orientation-impl.h>
-
 namespace
 {
 const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds
@@ -162,6 +161,34 @@ void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
   DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "visible : %d\n", visibleMode );
   DALI_ASSERT_DEBUG(mOverlay);
 
+  ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+  DALI_ASSERT_DEBUG(wlSurface);
+  Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+
+  mIndicatorVisible = visibleMode;
+
+  if ( mIndicatorVisible == Dali::Window::VISIBLE )
+  {
+    // when the indicator is visible, set proper mode for indicator server according to bg mode
+    if ( mIndicatorOpacityMode == Dali::Window::OPAQUE )
+    {
+      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
+    }
+    else if ( mIndicatorOpacityMode == Dali::Window::TRANSLUCENT )
+    {
+      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSLUCENT);
+    }
+    else if ( mIndicatorOpacityMode == Dali::Window::TRANSPARENT )
+    {
+      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
+    }
+  }
+  else
+  {
+    // when the indicator is not visible, set TRANSPARENT mode for indicator server
+    ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
+  }
+
   DoShowIndicator( mIndicatorOrientation );
 }
 
@@ -235,6 +262,11 @@ void Window::Initialize(const PositionSize& windowPosition, const std::string& n
 
   mSurface = windowSurface;
 
+  std::string appId;
+  mAdaptor->GetAppId( appId );
+  Ecore_Wl_Window* wlWindow = windowSurface ->GetWlWindow();
+  ecore_wl_window_class_name_set(wlWindow, appId.c_str());
+
   mOrientation = Orientation::New(this);
 
   // create event handler for Wayland window
index a093174..da42e93 100644 (file)
@@ -260,8 +260,6 @@ void WindowRenderSurface::CreateWlRenderable()
   {
       DALI_ASSERT_ALWAYS(0 && "Failed to create X window");
   }
-
-  //FIXME
 }
 
 void WindowRenderSurface::UseExistingRenderable( unsigned int surfaceId )
index 99ceb45..4a30da7 100644 (file)
@@ -82,7 +82,7 @@ public: // API
    *
    * @return the Ecore X window handle
    */
-  Ecore_Wl_Window* GetWlWindow();
+  virtual Ecore_Wl_Window* GetWlWindow();
 
   /**
    * Get the surface as an Ecore_Wl_Window
index cc5f260..b4a56eb 100644 (file)
@@ -49,6 +49,22 @@ void Adaptor::GetDataStoragePath( std::string& path)
 
 }
 
+void Adaptor::GetAppId( std::string& appId )
+{
+#ifdef USE_APPFW
+  char *id;
+  app_get_id(&id);
+  if ( id )
+  {
+    appId = id;
+  }
+  else
+  {
+    appId = "";
+  }
+#endif
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 118816e..7574dc7 100644 (file)
@@ -32,6 +32,11 @@ void Adaptor::GetDataStoragePath( std::string& path)
   path = DALI_SHADERBIN_DIR;
 }
 
+void Adaptor::GetAppId( std::string& appId )
+{
+  appId = "";
+}
+
 } // namespace Adaptor
 
 } // namespace Internal