Supports IME window for Tizen keyboard application. 86/258586/22
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Thu, 29 Apr 2021 06:44:52 +0000 (15:44 +0900)
committerWonsik Jung <sidein@samsung.com>
Tue, 29 Jun 2021 06:27:40 +0000 (15:27 +0900)
It is only for internal Tizen keyboard application.
To do that, default window should be initialized with wayland input surface
and one wayland API should be called pre rendering.
So, new APIs does not work for the other window and application.

Change-Id: I21a332d57ea939afa7059d1b9b222fea16985a93

34 files changed:
automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
automated-tests/src/dali-adaptor/utc-Dali-Window.cpp
build/tizen/deps-check.cmake
dali/devel-api/adaptor-framework/application-devel.cpp
dali/devel-api/adaptor-framework/application-devel.h
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/adaptor/tizen-wayland/component-application-impl.cpp
dali/internal/adaptor/tizen-wayland/framework-tizen.cpp
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp
dali/internal/system/common/widget-application-impl.cpp
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/common/window-render-surface.h
dali/internal/window-system/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/public-api/adaptor-framework/application.cpp
dali/public-api/adaptor-framework/window-enumerations.h
dali/public-api/adaptor-framework/window.cpp
packaging/dali-adaptor.spec

index 232c4f7..0091f14 100644 (file)
@@ -132,6 +132,21 @@ int UtcDaliApplicationNew04(void)
   END_TEST;
 }
 
+int UtcDaliApplicationNew05(void)
+{
+  int         argc(1);
+  const char* argList[1] = {"program"};
+  char**      argv       = const_cast<char**>(argList);
+
+  Application application = DevelApplication::New(&argc, &argv, "stylesheet", Application::WINDOW_MODE::OPAQUE, PositionSize(), WindowType::IME);
+
+  MyTestApp testApp(application);
+
+  DALI_TEST_CHECK(application);
+
+  END_TEST;
+}
+
 int UtcDaliApplicationCopyAndAssignment(void)
 {
   Application application = Application::New();
index 96d3810..e0580d0 100644 (file)
@@ -262,6 +262,22 @@ int UtcDaliWindowGetPreferredOrientationN(void)
   END_TEST;
 }
 
+int UtcDaliWindowSetPositionSizeWithOrientationN(void)
+{
+  Dali::Window window;
+  try
+  {
+    DevelWindow::SetPositionSizeWithOrientation(window, PositionSize(0, 0, 200, 100), Dali::WindowOrientation::PORTRAIT);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliWindowGetNativeHandleN(void)
 {
   Dali::Window window;
index 449d848..d5beb9c 100644 (file)
@@ -127,7 +127,7 @@ ENDIF()
 
 IF( enable_wayland )
   IF( enable_ecore_wayland2 )
-    PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 xkbcommon libtbm )
+    PKG_CHECK_MODULES(WAYLAND ecore-wl2 egl wayland-egl wayland-egl-tizen wayland-client>=1.2.0 input-method-client xkbcommon libtbm )
   ELSE()
     PKG_CHECK_MODULES(WAYLAND ecore-wayland egl wayland-egl wayland-client>=1.2.0 xkbcommon libtbm)
   ENDIF()
index 792bc36..50f5772 100644 (file)
@@ -24,6 +24,34 @@ namespace Dali
 {
 namespace DevelApplication
 {
+Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type)
+{
+  Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
+  if(internal)
+  {
+    // Set Defaut Window type
+    internal->SetDefaultWindowType(type);
+
+    // pre-initialized application
+    internal->SetCommandLineOptions(argc, argv);
+    if(argc && (*argc > 0))
+    {
+      internal->GetWindow().SetClass((*argv)[0], "");
+    }
+    internal->SetStyleSheet(stylesheet);
+
+    internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
+
+    //Store only the value before adaptor is created
+    internal->StoreWindowPositionSize(positionSize);
+  }
+  else
+  {
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, type);
+  }
+  return Application(internal.Get());
+}
+
 bool AddIdleWithReturnValue(Application application, CallbackBase* callback)
 {
   return Internal::Adaptor::GetImplementation(application).AddIdle(callback, true);
index a49b204..e82281c 100644 (file)
@@ -26,6 +26,22 @@ namespace Dali
 namespace DevelApplication
 {
 /**
+   * @brief This is the constructor for applications.
+   * Especially, it is for keyboard application.
+   * If you want to create Ime window, use this API with WindowType::IME.
+   *
+   * @param[in,out]  argc                A pointer to the number of arguments
+   * @param[in,out]  argv                A pointer to the argument list
+   * @param[in]      stylesheet          The path to user defined theme file
+   * @param[in]      windowMode          A member of WINDOW_MODE
+   * @param[in]      positionSize        A position and a size of the window
+   * @param[in]      type                It is window type for default window.
+   * @return A handle to the Application
+   * @note If the stylesheet is not specified, then the library's default stylesheet will not be overridden.
+   */
+DALI_ADAPTOR_API Application New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type);
+
+/**
  * @brief Ensures that the function passed in is called from the main loop when it is idle.
  * @param[in] application A handle to the Application
  * @param[in] callback The function to call
index de22583..28dd6b5 100644 (file)
@@ -48,7 +48,7 @@ Window New(Any surface, PositionSize windowPosition, const std::string& name, co
 
   if(isNewWindowAllowed)
   {
-    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, isTransparent);
+    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, WindowType::NORMAL, isTransparent);
 
     Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
     if(isAdaptorAvailable)
@@ -151,6 +151,11 @@ void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> call
   GetImplementation(window).AddFramePresentedCallback(std::move(callback), frameId);
 }
 
+void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation)
+{
+  GetImplementation(window).SetPositionSizeWithOrientation(positionSize, orientation);
+}
+
 } // namespace DevelWindow
 
 } // namespace Dali
index e1cbda8..6d3d0bd 100644 (file)
@@ -255,6 +255,21 @@ DALI_ADAPTOR_API void AddFrameRenderedCallback(Window window, std::unique_ptr<Ca
  */
 DALI_ADAPTOR_API void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId);
 
+  /**
+   * @brief Sets window position and size for specific orientation.
+   * This api reserves the position and size per orientation to display server.
+   * When the device is rotated, the window is moved/resized with the reserved position/size by display server.
+   *
+   * @param[in] window The window instance
+   * @param[in] positionSize The reserved position and size for the orientation
+   * @param[in] orientation The orientation
+   *
+   * @note Currently, it only works when the window's type is WindowType::IME.
+   * @note To set WindowType::IME, use Application New(... WindowType type), not Window::SetType().
+   * @note This function is only useful in Tizen world.
+   */
+DALI_ADAPTOR_API void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation);
+
 } // namespace DevelWindow
 
 } // namespace Dali
index 7d2c25c..69e4b4c 100644 (file)
@@ -63,9 +63,10 @@ ApplicationPtr Application::New(
   const std::string&             stylesheet,
   Dali::Application::WINDOW_MODE windowMode,
   const PositionSize&            positionSize,
-  Framework::Type                applicationType)
+  Framework::Type                applicationType,
+  WindowType                     type)
 {
-  ApplicationPtr application(new Application(argc, argv, stylesheet, windowMode, positionSize, applicationType));
+  ApplicationPtr application(new Application(argc, argv, stylesheet, windowMode, positionSize, applicationType, type));
   return application;
 }
 
@@ -75,13 +76,13 @@ void Application::PreInitialize(int* argc, char** argv[])
   {
     Dali::TextAbstraction::FontClientPreInitialize();
 
-    gPreInitializedApplication = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL);
+    gPreInitializedApplication = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL, WindowType::NORMAL);
     gPreInitializedApplication->CreateWindow(); // Only create window
     gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED;
   }
 }
 
-Application::Application(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType)
+Application::Application(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type)
 : mInitSignal(),
   mTerminateSignal(),
   mPauseSignal(),
@@ -102,6 +103,7 @@ Application::Application(int* argc, char** argv[], const std::string& stylesheet
   mEnvironmentOptions(),
   mWindowPositionSize(positionSize),
   mLaunchpadState(Launchpad::NONE),
+  mDefaultWindowType(type),
   mSlotDelegate(this)
 {
   // Get mName from environment options
@@ -190,7 +192,7 @@ void Application::CreateWindow()
 
   const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
 
-  Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mMainWindowMode == Dali::Application::TRANSPARENT);
+  Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
   mMainWindow                       = Dali::Window(window);
 
   // Quit the application when the window is closed
@@ -445,6 +447,12 @@ void Application::SetCommandLineOptions(int* argc, char** argv[])
   mFramework->SetCommandLineOptions(argc, argv);
 }
 
+void Application::SetDefaultWindowType(WindowType type)
+{
+  mDefaultWindowType = type;
+  mMainWindow.SetType(type);
+}
+
 ApplicationPtr Application::GetPreInitializedApplication()
 {
   return gPreInitializedApplication;
index 5244025..7693c51 100644 (file)
@@ -75,14 +75,15 @@ public:
 
   /**
    * Create a new application
-   * @param[in]  argc         A pointer to the number of arguments
-   * @param[in]  argv         A pointer to the argument list
-   * @param[in]  stylesheet   The path to user defined theme file
-   * @param[in]  windowMode   A member of Dali::Application::WINDOW_MODE
-   * @param[in]  positionSize A position and a size of the window
-   * @param[in]  applicationType  A member of Dali::Framework::Type
+   * @param[in]  argc              A pointer to the number of arguments
+   * @param[in]  argv              A pointer to the argument list
+   * @param[in]  stylesheet        The path to user defined theme file
+   * @param[in]  windowMode        A member of Dali::Application::WINDOW_MODE
+   * @param[in]  positionSize      A position and a size of the window
+   * @param[in]  applicationType   A member of Dali::Framework::Type
+   * @param[in]  type              It is window type for default window.
    */
-  static ApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType);
+  static ApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type);
 
   /**
    * @copydoc Dali::DevelApplication::PreInitialize()
@@ -235,6 +236,13 @@ public:
    */
   void SetCommandLineOptions(int* argc, char** argv[]);
 
+  /**
+   * Sets default window type.
+   * This is used in case of the preinitialized application.
+   * @param[in] type the window type for default window
+   */
+  void SetDefaultWindowType(WindowType type);
+
 public: // Signals
   /**
    * @copydoc Dali::Application::InitSignal()
@@ -322,14 +330,15 @@ public: // Signals
 protected:
   /**
    * Private Constructor
-   * @param[in]  argc         A pointer to the number of arguments
-   * @param[in]  argv         A pointer to the argument list
-   * @param[in]  stylesheet   The path to user defined theme file
-   * @param[in]  windowMode   A member of Dali::Application::WINDOW_MODE
-   * @param[in]  positionSize A position and a size of the window
-   * @param[in]  applicationType  A member of Dali::Framework::Type
+   * @param[in]  argc               A pointer to the number of arguments
+   * @param[in]  argv               A pointer to the argument list
+   * @param[in]  stylesheet         The path to user defined theme file
+   * @param[in]  windowMode         A member of Dali::Application::WINDOW_MODE
+   * @param[in]  positionSize       A position and a size of the window
+   * @param[in]  applicationType    A member of Dali::Framework::Type
+   * @param[in]  type               The default window's type.
    */
-  Application(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType);
+  Application(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type);
 
   /**
    * Destructor
@@ -341,7 +350,7 @@ protected:
   Application& operator=(Application&);
 
   /**
-   * Creates the window
+   * Creates the default window
    */
   void CreateWindow();
 
@@ -391,11 +400,12 @@ private:
   Dali::Application::WINDOW_MODE mMainWindowMode; ///< Window mode of the main window
   std::string                    mMainWindowName; ///< Name of the main window as obtained from environment options
 
-  std::string        mStylesheet;
-  EnvironmentOptions mEnvironmentOptions;
-  PositionSize       mWindowPositionSize;
-  Launchpad::State   mLaunchpadState;
-  bool               mUseRemoteSurface;
+  std::string          mStylesheet;
+  EnvironmentOptions   mEnvironmentOptions;
+  PositionSize         mWindowPositionSize;
+  Launchpad::State     mLaunchpadState;
+  bool                 mUseRemoteSurface;
+  WindowType           mDefaultWindowType;         ///< Default window's type. It is used when Application is created.
 
   SlotDelegate<Application> mSlotDelegate;
 
index e5bb71a..ceec60a 100644 (file)
@@ -35,7 +35,7 @@ ComponentApplicationPtr ComponentApplication::New(
 }
 
 ComponentApplication::ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode)
-: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::COMPONENT)
+: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::COMPONENT, WindowType::NORMAL)
 {
 }
 
index 7cb27c2..25a1b58 100644 (file)
@@ -723,8 +723,6 @@ struct Framework::Impl
 #ifdef COMPONENT_APPLICATION_SUPPORT
   int AppComponentMain()
   {
-    int ret;
-
     /*Crate component_based_app_base_lifecycle_callback*/
     component_based_app_base_lifecycle_callback_s callback;
     callback.init      = AppInit;
index 4a03a7e..72cf282 100644 (file)
@@ -50,7 +50,7 @@ WatchApplicationPtr WatchApplication::New(
 }
 
 WatchApplication::WatchApplication(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode)
-: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH),
+: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH, WindowType::NORMAL),
   mState(UNINITIALIZED)
 {
 }
index c77c4ef..2b07db9 100644 (file)
@@ -48,7 +48,7 @@ WidgetApplicationPtr WidgetApplication::New(
 }
 
 WidgetApplication::WidgetApplication(int* argc, char** argv[], const std::string& stylesheet)
-: Application(argc, argv, stylesheet, Dali::WidgetApplication::OPAQUE, PositionSize(), Framework::WIDGET)
+: Application(argc, argv, stylesheet, Dali::WidgetApplication::OPAQUE, PositionSize(), Framework::WIDGET, WindowType::NORMAL)
 {
   DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n");
 }
index 352e8c1..4e53d59 100644 (file)
@@ -250,6 +250,11 @@ void WindowBaseAndroid::SetType(Dali::WindowType type)
 {
 }
 
+Dali::WindowType WindowBaseAndroid::GetType() const
+{
+  return Dali::WindowType::NORMAL;
+}
+
 Dali::WindowOperationResult WindowBaseAndroid::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
   return Dali::WindowOperationResult::NOT_SUPPORTED;
@@ -355,6 +360,18 @@ int WindowBaseAndroid::GetOrientation() const
   return 0;
 }
 
+void WindowBaseAndroid::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+}
+
+void WindowBaseAndroid::InitializeIme()
+{
+}
+
+void WindowBaseAndroid::ImeWindowReadyToRender()
+{
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 7cabb85..d8dab58 100644 (file)
@@ -264,6 +264,11 @@ public:
   void SetType(Dali::WindowType type) override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+   */
+  Dali::WindowType GetType() const override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
   Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
@@ -363,6 +368,21 @@ public:
    */
   int GetOrientation() const override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+   */
+  void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+   */
+  void InitializeIme() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+   */
+  void ImeWindowReadyToRender() override;
+
 private:
   /**
    * Second stage initialization
index a2b7ce4..22c6d7a 100644 (file)
@@ -250,6 +250,11 @@ public:
   virtual void SetType(Dali::WindowType type) = 0;
 
   /**
+   * @copydoc Dali::Window::GetType()
+   */
+  virtual Dali::WindowType GetType() const = 0;
+
+  /**
    * @copydoc Dali::Window::SetNotificationLevel()
    */
   virtual Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) = 0;
@@ -354,6 +359,23 @@ public:
    */
   virtual int CreateFramePresentedSyncFence() = 0;
 
+  /**
+   * @copydoc Dali::Window::SetPositionSizeWithAngle()
+   */
+  virtual void SetPositionSizeWithAngle(PositionSize positionSize, int angle) = 0;
+
+  /**
+   * @brief Initialize for Ime window.
+   * It should be called when the window is only used for Ime keyboard window.
+   */
+  virtual void InitializeIme() = 0;
+
+  /**
+   * @brief Send the signal to display server for Ime Window is ready to render.
+   * It is used for compositing by display server.
+   */
+  virtual void ImeWindowReadyToRender() = 0;
+
   // Signals
 
   /**
index 4d60b1d..a1a1bf6 100644 (file)
@@ -58,17 +58,17 @@ Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "L
 
 } // unnamed namespace
 
-Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
 {
   Any surface;
-  return Window::New(surface, positionSize, name, className, isTransparent);
+  return Window::New(surface, positionSize, name, className, type, isTransparent);
 }
 
-Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
 {
   Window* window         = new Window();
   window->mIsTransparent = isTransparent;
-  window->Initialize(surface, positionSize, name, className);
+  window->Initialize(surface, positionSize, name, className, type);
   return window;
 }
 
@@ -79,7 +79,6 @@ Window::Window()
   mIsFocusAcceptable(true),
   mIconified(false),
   mOpaqueState(false),
-  mType(WindowType::NORMAL),
   mParentWindow(NULL),
   mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
   mRotationAngle(0),
@@ -114,7 +113,7 @@ Window::~Window()
   }
 }
 
-void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className)
+void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type)
 {
   // Create a window render surface
   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
@@ -124,6 +123,16 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
   // Get a window base
   mWindowBase = mWindowSurface->GetWindowBase();
 
+  // Set Window Type
+  mWindowBase->SetType(type);
+
+  // Initialize for Ime window type
+  if(type == WindowType::IME)
+  {
+    mWindowBase->InitializeIme();
+    mWindowSurface->InitializeImeSurface();
+  }
+
   // Connect signals
   mWindowBase->IconifyChangedSignal().Connect(this, &Window::OnIconifyChanged);
   mWindowBase->FocusChangedSignal().Connect(this, &Window::OnFocusChanged);
@@ -298,6 +307,12 @@ WindowOrientation Window::GetPreferredOrientation()
   return preferredOrientation;
 }
 
+void Window::SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation)
+{
+  int angle = ConvertToAngle(orientation);
+  mWindowBase->SetPositionSizeWithAngle(positionSize, angle);
+}
+
 void Window::SetAvailableAnlges(const std::vector<int>& angles)
 {
   if(angles.size() > 4)
@@ -498,24 +513,20 @@ void Window::SetInputRegion(const Rect<int>& inputRegion)
 
 void Window::SetType(WindowType type)
 {
-  if(type != mType)
-  {
-    mWindowBase->SetType(type);
-
-    mType = type;
-  }
+  mWindowBase->SetType(type);
 }
 
 WindowType Window::GetType() const
 {
-  return mType;
+  return mWindowBase->GetType();
 }
 
 WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level)
 {
-  if(mType != WindowType::NOTIFICATION)
+  WindowType type = mWindowBase->GetType();
+  if(type != WindowType::NOTIFICATION)
   {
-    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType);
+    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", type);
     return WindowOperationResult::INVALID_OPERATION;
   }
 
@@ -524,9 +535,10 @@ WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level
 
 WindowNotificationLevel Window::GetNotificationLevel() const
 {
-  if(mType != WindowType::NOTIFICATION)
+  WindowType type = mWindowBase->GetType();
+  if(type != WindowType::NOTIFICATION)
   {
-    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType);
+    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", type);
     return WindowNotificationLevel::NONE;
   }
 
index 6e3b382..305040c 100644 (file)
@@ -71,10 +71,11 @@ public:
    * @param[in] positionSize The position and size of the window
    * @param[in] name The window title
    * @param[in] className The window class name
+   * @param[in] type Window type.
    * @param[in] isTransparent Whether window is transparent
    * @return A newly allocated Window
    */
-  static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
+  static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent = false);
 
   /**
    * @brief Create a new Window. This should only be called once by the Application class
@@ -82,10 +83,11 @@ public:
    * @param[in] positionSize The position and size of the window
    * @param[in] name The window title
    * @param[in] className The window class name
+   * @param[in] type Window type.
    * @param[in] isTransparent Whether window is transparent
    * @return A newly allocated Window
    */
-  static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
+  static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className,  Dali::WindowType type, bool isTransparent = false);
 
   /**
    * @copydoc Dali::Window::SetClass()
@@ -353,6 +355,11 @@ public:
    */
   void SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations);
 
+  /**
+   * @copydoc Dali::DevelWindow::SetPositionSizeWithOrientation()
+   */
+  void SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation);
+
 public: // Dali::Internal::Adaptor::SceneHolder
   /**
    * @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle
@@ -396,7 +403,7 @@ private:
   /**
    * Second stage initialization
    */
-  void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className);
+  void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type);
 
   /**
    * Called when the window becomes iconified or deiconified.
@@ -573,22 +580,21 @@ private:
   bool                 mIsFocusAcceptable : 1;
   bool                 mIconified : 1;
   bool                 mOpaqueState : 1;
-  WindowType           mType;
   Dali::Window         mParentWindow;
 
   OrientationPtr   mOrientation;
   std::vector<int> mAvailableAngles;
   int              mPreferredAngle;
 
-  int mRotationAngle; ///< The angle of the rotation
-  int mWindowWidth;   ///< The width of the window
-  int mWindowHeight;  ///< The height of the window
+  int mRotationAngle;                    ///< The angle of the rotation
+  int mWindowWidth;                      ///< The width of the window
+  int mWindowHeight;                     ///< The height of the window
 
-  EventHandlerPtr mEventHandler; ///< The window events handler
+  EventHandlerPtr mEventHandler;         ///< The window events handler
 
-  OrientationMode mOrientationMode;
+  OrientationMode mOrientationMode;      ///< The physical screen mode is portrait or landscape
 
-  int mNativeWindowId; ///< The Native Window Id
+  int mNativeWindowId;                   ///< The Native Window Id
 
   // Signals
   SignalType                              mDeleteRequestSignal;
index 4a7a8e7..b1ba7a1 100644 (file)
@@ -127,7 +127,7 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su
   mWindowBase(),
   mThreadSynchronization(nullptr),
   mRenderNotification(nullptr),
-  mRotationTrigger(nullptr),
+  mPostRenderTrigger(),
   mFrameRenderedTrigger(),
   mGraphics(nullptr),
   mEGLSurface(nullptr),
@@ -145,7 +145,8 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su
   mWindowRotationFinished(true),
   mScreenRotationFinished(true),
   mResizeFinished(true),
-  mDefaultScreenRotationAvailable(false)
+  mDefaultScreenRotationAvailable(false),
+  mIsImeWindowSurface(false)
 {
   DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n");
   Initialize(surface);
@@ -153,10 +154,6 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su
 
 WindowRenderSurface::~WindowRenderSurface()
 {
-  if(mRotationTrigger)
-  {
-    delete mRotationTrigger;
-  }
 }
 
 void WindowRenderSurface::Initialize(Any surface)
@@ -215,9 +212,10 @@ void WindowRenderSurface::SetTransparency(bool transparent)
 
 void WindowRenderSurface::RequestRotation(int angle, int width, int height)
 {
-  if(!mRotationTrigger)
+  if(!mPostRenderTrigger)
   {
-    mRotationTrigger = TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessRotationRequest), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
+    mPostRenderTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessPostRender),
+                                                                                                        TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
   }
 
   mPositionSize.width  = width;
@@ -225,6 +223,7 @@ void WindowRenderSurface::RequestRotation(int angle, int width, int height)
 
   mWindowRotationAngle    = angle;
   mWindowRotationFinished = false;
+  mResizeFinished = false;
 
   mWindowBase->SetWindowRotationAngle(mWindowRotationAngle);
 
@@ -544,7 +543,7 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vector<Rect
       mWindowBase->ResizeEglWindow(positionSize);
       mResizeFinished = true;
 
-      DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set resize\n");
+      DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set resize, x: %d, y: %d, w: %d, h:%d\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height);
     }
 
     SetFullSwapNextFrame();
@@ -573,25 +572,23 @@ void WindowRenderSurface::PostRender()
     GlImplementation& mGLES = eglGraphics->GetGlesInterface();
     mGLES.PostRender();
 
-    if(mIsResizing)
+    if((mIsResizing && !mWindowRotationFinished) || mIsImeWindowSurface)
     {
-      if(!mWindowRotationFinished)
+      if(mThreadSynchronization)
       {
-        if(mThreadSynchronization)
-        {
-          // Enable PostRender flag
-          mThreadSynchronization->PostRenderStarted();
-        }
-
-        DALI_LOG_RELEASE_INFO("WindowRenderSurface::PostRender: Trigger rotation event\n");
+        // Enable PostRender flag
+        mThreadSynchronization->PostRenderStarted();
+      }
 
-        mRotationTrigger->Trigger();
+      if(!mWindowRotationFinished || mIsImeWindowSurface)
+      {
+        mPostRenderTrigger->Trigger();
+      }
 
-        if(mThreadSynchronization)
-        {
-          // Wait until the event-thread complete the rotation event processing
-          mThreadSynchronization->PostRenderWaitForCompletion();
-        }
+      if(mThreadSynchronization)
+      {
+        // Wait until the event-thread complete the rotation event processing
+        mThreadSynchronization->PostRenderWaitForCompletion();
       }
     }
 
@@ -643,6 +640,16 @@ Integration::StencilBufferAvailable WindowRenderSurface::GetStencilBufferRequire
   return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
 }
 
+void WindowRenderSurface::InitializeImeSurface()
+{
+  mIsImeWindowSurface = true;
+  if(!mPostRenderTrigger)
+  {
+    mPostRenderTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessPostRender),
+                                                                                                        TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
+  }
+}
+
 void WindowRenderSurface::OutputTransformed()
 {
   int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
@@ -663,13 +670,19 @@ void WindowRenderSurface::OutputTransformed()
   }
 }
 
-void WindowRenderSurface::ProcessRotationRequest()
+void WindowRenderSurface::ProcessPostRender()
 {
-  mWindowRotationFinished = true;
-
-  mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height);
+  if(!mWindowRotationFinished)
+  {
+    mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height);
+    DALI_LOG_RELEASE_INFO("WindowRenderSurface::ProcessPostRender: Rotation Done\n");
+    mWindowRotationFinished = true;
+  }
 
-  DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::ProcessRotationRequest: Rotation Done\n");
+  if(mIsImeWindowSurface)
+  {
+    mWindowBase->ImeWindowReadyToRender();
+  }
 
   if(mThreadSynchronization)
   {
index 2661adc..bd15471 100644 (file)
@@ -109,6 +109,16 @@ public: // API
   WindowBase* GetWindowBase();
 
   /**
+   * @brief Intiailize Ime Surface for Ime window rendering.
+   *
+   * It sets one flag and callback function for Ime window rendering
+   * This callback function calls one special native window function for ready to commit buffer.
+   * The special function notify to display server.
+   * It is only used for Ime window.
+   */
+  void InitializeImeSurface();
+
+  /**
    * @brief This signal is emitted when the output is transformed.
    */
   OutputSignalType& OutputTransformedSignal();
@@ -215,9 +225,10 @@ private:
   void OutputTransformed();
 
   /**
-   * @brief Used as the callback for the rotation-trigger.
+   * @brief Used as the callback for the post render.
+   * It is used both window rotation and supporting Ime window
    */
-  void ProcessRotationRequest();
+  void ProcessPostRender();
 
   /**
    * @brief Used as the callback for the frame rendered / presented.
@@ -287,7 +298,7 @@ private: // Data
   std::unique_ptr<WindowBase>            mWindowBase;
   ThreadSynchronizationInterface*        mThreadSynchronization;
   TriggerEventInterface*                 mRenderNotification; ///< Render notification trigger
-  TriggerEventInterface*                 mRotationTrigger;
+  std::unique_ptr<TriggerEventInterface> mPostRenderTrigger;  ///< Post render callback function
   std::unique_ptr<TriggerEventInterface> mFrameRenderedTrigger;
   GraphicsInterface*                     mGraphics; ///< Graphics interface
   EGLSurface                             mEGLSurface;
@@ -307,6 +318,7 @@ private: // Data
   bool                                   mScreenRotationFinished;
   bool                                   mResizeFinished;
   bool                                   mDefaultScreenRotationAvailable;
+  bool                                   mIsImeWindowSurface;
 
 }; // class WindowRenderSurface
 
index 1637f36..1d6c091 100644 (file)
@@ -193,6 +193,11 @@ public:
   void SetType(Dali::WindowType type) override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+   */
+  Dali::WindowType GetType() const override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
   WindowOperationResult SetNotificationLevel(WindowNotificationLevel level) override;
@@ -297,6 +302,21 @@ public:
    */
   int CreateFramePresentedSyncFence() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+   */
+  void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+   */
+  void InitializeIme() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+   */
+  void ImeWindowReadyToRender() override;
+
 private:
   // Undefined
   WindowBaseCocoa(const WindowBaseCocoa&) = delete;
index 7015c2b..6a93269 100644 (file)
@@ -535,6 +535,11 @@ void WindowBaseCocoa::SetType( Dali::WindowType type )
 {
 }
 
+Dali::WindowType WindowBaseCocoa::GetType() const
+{
+  return Dali::WindowType::NORMAL;
+}
+
 WindowOperationResult WindowBaseCocoa::SetNotificationLevel( WindowNotificationLevel level )
 {
   return WindowOperationResult::NOT_SUPPORTED;
@@ -646,6 +651,18 @@ int WindowBaseCocoa::CreateFramePresentedSyncFence()
   return -1;
 }
 
+void WindowBaseCocoa::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+}
+
+void WindowBaseCocoa::InitializeIme()
+{
+}
+
+void WindowBaseCocoa::ImeWindowReadyToRender()
+{
+}
+
 } // namespace Dali::Internal::Adaptor
 
 @implementation CocoaView
index c177432..ce7b744 100644 (file)
@@ -1565,6 +1565,11 @@ void WindowBaseEcoreWl::SetType(Dali::WindowType type)
   ecore_wl_window_type_set(mEcoreWindow, windowType);
 }
 
+Dali::WindowType WindowBaseEcoreWl::GetType() const
+{
+  return Dali::WindowType::NORMAL;
+}
+
 Dali::WindowOperationResult WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
   while(!mTizenPolicy)
@@ -2175,6 +2180,18 @@ int WindowBaseEcoreWl::CreateFramePresentedSyncFence()
   return -1;
 }
 
+void WindowBaseEcoreWl::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+}
+
+void WindowBaseEcoreWl::InitializeIme()
+{
+}
+
+void WindowBaseEcoreWl::ImeWindowReadyToRender()
+{
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 7c3bdd7..9c39f23 100644 (file)
@@ -331,6 +331,11 @@ public:
   void SetType(Dali::WindowType type) override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+   */
+  Dali::WindowType GetType() const override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
   Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
@@ -430,6 +435,21 @@ public:
    */
   int CreateFramePresentedSyncFence() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+   */
+  void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+   */
+  void InitializeIme() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+   */
+  void ImeWindowReadyToRender() override;
+
 private:
   /**
    * Second stage initialization
index b8227e0..6e72f90 100644 (file)
@@ -698,6 +698,9 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf
 : mEcoreEventHandler(),
   mEcoreWindow(nullptr),
   mWlSurface(nullptr),
+  mWlInputPanel(nullptr),
+  mWlOutput(nullptr),
+  mWlInputPanelSurface(nullptr),
   mEglWindow(nullptr),
   mDisplay(nullptr),
   mEventQueue(nullptr),
@@ -705,24 +708,25 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf
   mTizenDisplayPolicy(nullptr),
   mKeyMap(nullptr),
   mSupportedAuxiliaryHints(),
+  mWindowPositionSize(positionSize),
   mAuxiliaryHints(),
+  mType(WindowType::NORMAL),
   mNotificationLevel(-1),
-  mNotificationChangeState(0),
-  mNotificationLevelChangeDone(true),
   mScreenOffMode(0),
-  mScreenOffModeChangeState(0),
-  mScreenOffModeChangeDone(true),
   mBrightness(0),
+  mWindowRotationAngle(0),
+  mScreenRotationAngle(0),
+  mSupportedPreProtation(0),
+  mNotificationChangeState(0),
+  mScreenOffModeChangeState(0),
   mBrightnessChangeState(0),
-  mBrightnessChangeDone(true),
+  mLastSubmittedMoveResizeSerial(0),
+  mMoveResizeSerial(0),
+  mNotificationLevelChangeDone(true),
+  mScreenOffModeChangeDone(true),
   mVisible(true),
-  mWindowPositionSize(positionSize),
   mOwnSurface(false),
-  mMoveResizeSerial(0),
-  mLastSubmittedMoveResizeSerial(0),
-  mWindowRotationAngle(0),
-  mScreenRotationAngle(0),
-  mSupportedPreProtation(0)
+  mBrightnessChangeDone(true)
 #ifdef DALI_ELDBUS_AVAILABLE
   ,
   mSystemConnection(NULL)
@@ -843,7 +847,7 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool
   InitializeEcoreElDBus();
 
   Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
-  mDisplay                   = ecore_wl2_display_get(display);
+  mDisplay = ecore_wl2_display_get(display);
 
   if(mDisplay)
   {
@@ -1861,38 +1865,51 @@ void WindowBaseEcoreWl2::SetInputRegion(const Rect<int>& inputRegion)
 
 void WindowBaseEcoreWl2::SetType(Dali::WindowType type)
 {
-  Ecore_Wl2_Window_Type windowType;
-
-  switch(type)
+  if(mType != type)
   {
-    case Dali::WindowType::NORMAL:
-    {
-      windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
-      break;
-    }
-    case Dali::WindowType::NOTIFICATION:
-    {
-      windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
-      break;
-    }
-    case Dali::WindowType::UTILITY:
-    {
-      windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
-      break;
-    }
-    case Dali::WindowType::DIALOG:
-    {
-      windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
-      break;
-    }
-    default:
+    mType = type;
+    Ecore_Wl2_Window_Type windowType;
+
+    switch(type)
     {
-      windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
-      break;
+      case Dali::WindowType::NORMAL:
+      {
+        windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
+        break;
+      }
+      case Dali::WindowType::NOTIFICATION:
+      {
+        windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
+        break;
+      }
+      case Dali::WindowType::UTILITY:
+      {
+        windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
+        break;
+      }
+      case Dali::WindowType::DIALOG:
+      {
+        windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
+        break;
+      }
+      case Dali::WindowType::IME:
+      {
+        windowType = ECORE_WL2_WINDOW_TYPE_NONE;
+        break;
+      }
+      default:
+      {
+        windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
+        break;
+      }
     }
+    ecore_wl2_window_type_set(mEcoreWindow, windowType);
   }
+}
 
-  ecore_wl2_window_type_set(mEcoreWindow, windowType);
+Dali::WindowType WindowBaseEcoreWl2::GetType() const
+{
+  return mType;
 }
 
 Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
@@ -2517,6 +2534,84 @@ int WindowBaseEcoreWl2::CreateFramePresentedSyncFence()
   return wl_egl_window_tizen_create_presentation_sync_fd(mEglWindow);
 }
 
+void WindowBaseEcoreWl2::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+  DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetPositionSizeWithAngle, angle: %d, x: %d, y: %d, w: %d, h: %d\n", angle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
+  ecore_wl2_window_rotation_geometry_set(mEcoreWindow, angle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
+}
+
+void WindowBaseEcoreWl2::InitializeIme()
+{
+  Eina_Iterator*      globals;
+  struct wl_registry* registry;
+  Ecore_Wl2_Global*   global;
+  Ecore_Wl2_Display*  ecoreWl2Display;
+
+  if(!(ecoreWl2Display = ecore_wl2_connected_display_get(NULL)))
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 connected display\n");
+    return;
+  }
+
+  DALI_LOG_RELEASE_INFO("InitializeIme:  Ecore_Wl2_Display: %p, ecore wl window: %p\n", ecoreWl2Display, mEcoreWindow);
+
+  if(!(registry = ecore_wl2_display_registry_get(ecoreWl2Display)))
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 display registry\n");
+    return;
+  }
+
+  if(!(globals = ecore_wl2_display_globals_get(ecoreWl2Display)))
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 globals\n");
+    return;
+  }
+
+  EINA_ITERATOR_FOREACH(globals, global)
+  {
+    if(strcmp(global->interface, "wl_input_panel") == 0)
+    {
+      mWlInputPanel = (wl_input_panel*)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
+    }
+    else if(strcmp(global->interface, "wl_output") == 0)
+    {
+      mWlOutput = (wl_output*)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
+    }
+  }
+
+  if(!mWlInputPanel)
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel interface\n");
+    return;
+  }
+
+  if(!mWlOutput)
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland output panel interface\n");
+    return;
+  }
+
+  mWlInputPanelSurface = wl_input_panel_get_input_panel_surface(mWlInputPanel, mWlSurface);
+  if(!mWlInputPanelSurface)
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel surface\n");
+    return;
+  }
+
+  wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+}
+
+void WindowBaseEcoreWl2::ImeWindowReadyToRender()
+{
+  if(!mWlInputPanelSurface)
+  {
+    DALI_LOG_ERROR("WindowBaseEcoreWl2::ImeWindowReadyToRender(), wayland input panel surface is null\n");
+    return;
+  }
+
+  wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 338d234..e7426a6 100644 (file)
@@ -24,6 +24,7 @@
 // EXTERNAL HEADERS
 #include <Ecore.h>
 #include <Ecore_Wl2.h>
+#include <input-method-client-protocol.h>
 #include <tizen-extension-client-protocol.h>
 #include <wayland-egl.h>
 #include <xkbcommon/xkbcommon.h>
@@ -362,6 +363,11 @@ public:
   void SetType(Dali::WindowType type) override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+   */
+  Dali::WindowType GetType() const override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
   Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
@@ -461,6 +467,21 @@ public:
    */
   int CreateFramePresentedSyncFence() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+   */
+  void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+   */
+  void InitializeIme() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+   */
+  void ImeWindowReadyToRender() override;
+
 private:
   /**
    * Second stage initialization
@@ -486,11 +507,14 @@ protected:
 
 private:
   typedef std::vector<std::pair<std::string, std::string> > AuxiliaryHints;
+  Dali::Vector<Ecore_Event_Handler*>                        mEcoreEventHandler;
+  Ecore_Wl2_Window*                                         mEcoreWindow;
 
-  Dali::Vector<Ecore_Event_Handler*> mEcoreEventHandler;
+  wl_surface*             mWlSurface;
+  wl_input_panel*         mWlInputPanel;
+  wl_output*              mWlOutput;
+  wl_input_panel_surface* mWlInputPanelSurface;
 
-  Ecore_Wl2_Window*     mEcoreWindow;
-  wl_surface*           mWlSurface;
   wl_egl_window*        mEglWindow;
   wl_display*           mDisplay;
   wl_event_queue*       mEventQueue;
@@ -499,31 +523,30 @@ private:
   xkb_keymap*           mKeyMap;
 
   std::vector<std::string> mSupportedAuxiliaryHints;
-  AuxiliaryHints           mAuxiliaryHints;
-
-  int      mNotificationLevel;
-  uint32_t mNotificationChangeState;
-  bool     mNotificationLevelChangeDone;
-
-  int      mScreenOffMode;
-  uint32_t mScreenOffModeChangeState;
-  bool     mScreenOffModeChangeDone;
-
-  int      mBrightness;
-  uint32_t mBrightnessChangeState;
-  bool     mBrightnessChangeDone;
 
-  bool               mVisible : 1;
   Dali::PositionSize mWindowPositionSize;
+  AuxiliaryHints     mAuxiliaryHints;
+
+  WindowType mType;
+  int        mNotificationLevel;
+  int        mScreenOffMode;
+  int        mBrightness;
+  int        mWindowRotationAngle;
+  int        mScreenRotationAngle;
+  int        mSupportedPreProtation;
+
+  uint32_t          mNotificationChangeState;
+  uint32_t          mScreenOffModeChangeState;
+  uint32_t          mBrightnessChangeState;
+  uint32_t          mLastSubmittedMoveResizeSerial;
+  volatile uint32_t mMoveResizeSerial;
 
+  bool mNotificationLevelChangeDone;
+  bool mScreenOffModeChangeDone;
+  bool mVisible : 1;
   bool mOwnSurface;
+  bool mBrightnessChangeDone;
 
-  volatile uint32_t mMoveResizeSerial;
-  uint32_t          mLastSubmittedMoveResizeSerial;
-
-  int mWindowRotationAngle;
-  int mScreenRotationAngle;
-  int mSupportedPreProtation;
 #ifdef DALI_ELDBUS_AVAILABLE
   Eldbus_Connection* mSystemConnection;
 #endif // DALI_ELDBUS_AVAILABLE
index 0eea078..1efb01c 100644 (file)
@@ -768,6 +768,11 @@ void WindowBaseEcoreX::SetType(Dali::WindowType type)
 {
 }
 
+Dali::WindowType WindowBaseEcoreX::GetType() const
+{
+  return Dali::WindowType::NORMAL;
+}
+
 Dali::WindowOperationResult WindowBaseEcoreX::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
   return Dali::WindowOperationResult::NOT_SUPPORTED;
@@ -921,6 +926,18 @@ int WindowBaseEcoreX::CreateFramePresentedSyncFence()
   return -1;
 }
 
+void WindowBaseEcoreX::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+}
+
+void WindowBaseEcoreX::InitializeIme()
+{
+}
+
+void WindowBaseEcoreX::ImeWindowReadyToRender()
+{
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 2630578..cd6f241 100644 (file)
@@ -265,6 +265,11 @@ public:
   void SetType(Dali::WindowType type) override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+   */
+  Dali::WindowType GetType() const override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
   Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
@@ -364,6 +369,21 @@ public:
    */
   int CreateFramePresentedSyncFence() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+   */
+  void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+   */
+  void InitializeIme() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+   */
+  void ImeWindowReadyToRender() override;
+
 private:
   /**
    * Second stage initialization
index 6382e43..5941dca 100644 (file)
@@ -372,6 +372,11 @@ void WindowBaseWin::SetType(Dali::WindowType type)
 {
 }
 
+Dali::WindowType WindowBaseWin::GetType() const
+{
+  return Dali::WindowType::NORMAL;
+}
+
 Dali::WindowOperationResult WindowBaseWin::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
   return Dali::WindowOperationResult::NOT_SUPPORTED;
@@ -577,6 +582,18 @@ int WindowBaseWin::CreateFramePresentedSyncFence()
   return -1;
 }
 
+void WindowBaseWin::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+}
+
+void WindowBaseWin::InitializeIme()
+{
+}
+
+void WindowBaseWin::ImeWindowReadyToRender()
+{
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 57b51c4..ec87a4a 100644 (file)
@@ -252,6 +252,11 @@ public:
   void SetType(Dali::WindowType type) override;
 
   /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
+   */
+  Dali::WindowType GetType() const override;
+
+  /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
   Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
@@ -351,6 +356,21 @@ public:
    */
   int CreateFramePresentedSyncFence() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
+   */
+  void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
+   */
+  void InitializeIme() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
+   */
+  void ImeWindowReadyToRender() override;
+
 private:
   /**
    * Second stage initialization
index 7bcc796..9542dff 100644 (file)
@@ -43,14 +43,12 @@ Application Application::New(int* argc, char** argv[])
     {
       internal->GetWindow().SetClass((*argv)[0], "");
     }
-
-    return Application(internal.Get());
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, "", OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL);
-    return Application(internal.Get());
+    internal = Internal::Adaptor::Application::New(argc, argv, "", OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL);
   }
+  return Application(internal.Get());
 }
 
 Application Application::New(int* argc, char** argv[], const std::string& stylesheet)
@@ -65,14 +63,12 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
       internal->GetWindow().SetClass((*argv)[0], "");
     }
     internal->SetStyleSheet(stylesheet);
-
-    return Application(internal.Get());
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL);
-    return Application(internal.Get());
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL);
   }
+  return Application(internal.Get());
 }
 
 Application Application::New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode)
@@ -89,14 +85,12 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
     internal->SetStyleSheet(stylesheet);
 
     internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
-
-    return Application(internal.Get());
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, PositionSize(), Internal::Adaptor::Framework::NORMAL);
-    return Application(internal.Get());
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL);
   }
+  return Application(internal.Get());
 }
 
 Application Application::New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize)
@@ -116,14 +110,12 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
 
     //Store only the value before adaptor is created
     internal->StoreWindowPositionSize(positionSize);
-
-    return Application(internal.Get());
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL);
-    return Application(internal.Get());
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL);
   }
+  return Application(internal.Get());
 }
 
 Application::~Application()
index 9797af1..c77ce66 100644 (file)
@@ -38,6 +38,13 @@ enum class WindowOrientation
 
 /**
  * @brief An enum of Window types.
+ * Window type has effect of DALi window's behavior, window's stack and extra functions.
+ * The default window type is NORMAL. If application does not set the specific window type, this type will be set.
+ *
+ * Ime window type is special type. It can only set by one Application::New function.
+ * The fuction is "New(int* argc, char** argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize, WindowType type)".
+ * Ime window type can not set by Window::SetType().
+ *
  * @SINCE_2_0.0
  */
 enum class WindowType
@@ -45,7 +52,8 @@ enum class WindowType
   NORMAL,       ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type. @SINCE_2_0.0
   NOTIFICATION, ///< A notification window, like a warning about battery life or a new E-Mail received. @SINCE_2_0.0
   UTILITY,      ///< A persistent utility window, like a toolbox or palette. @SINCE_2_0.0
-  DIALOG        ///< Used for simple dialog windows. @SINCE_2_0.0
+  DIALOG,       ///< Used for simple dialog window. @SINCE_2_0.0
+  IME           ///< Used for Ime keyboard window. It should be set in application New function. @SINCE_2_0.33
 };
 
 /**
index 0000add..edb98e0 100644 (file)
@@ -48,7 +48,7 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str
 
   if(isNewWindowAllowed)
   {
-    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
+    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, WindowType::NORMAL, isTransparent);
 
     Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
 
index 80e9fe3..0e11a19 100644 (file)
@@ -71,6 +71,7 @@ BuildRequires:  pkgconfig(cairo)
 
 BuildRequires:  pkgconfig(wayland-egl)
 BuildRequires:  pkgconfig(wayland-client)
+BuildRequires:  pkgconfig(input-method-client)
 BuildRequires:  wayland-devel
 BuildRequires:  wayland-extension-client-devel