Add input region APIs about including and excluding.
Change-Id: Ie79dac83f202450b58b73401f0fd146a2284cb87
}
END_TEST;
}
+
+int UtcDaliWindowAddInputRegion(void)
+{
+ Dali::Window instance;
+ try
+ {
+ Rect<int> includedInputRegion(0,0,720,640);
+ DevelWindow::IncludeInputRegion(instance, includedInputRegion);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliWindowSubtractInputRegion(void)
+{
+ Dali::Window instance;
+ try
+ {
+ Rect<int> includedInputRegion(0,0,720,1280);
+ DevelWindow::IncludeInputRegion(instance, includedInputRegion);
+
+ Rect<int> excludedInputRegion(0,641,720,640);
+ DevelWindow::ExcludeInputRegion(instance, excludedInputRegion);
+
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
GetImplementation(window).EnableFloatingMode(enable);
}
+void IncludeInputRegion(Window window, const Rect<int>& inputRegion)
+{
+ GetImplementation(window).IncludeInputRegion(inputRegion);
+}
+
+void ExcludeInputRegion(Window window, const Rect<int>& inputRegion)
+{
+ GetImplementation(window).ExcludeInputRegion(inputRegion);
+}
+
} // namespace DevelWindow
} // namespace Dali
*/
DALI_ADAPTOR_API void EnableFloatingMode(Window window, bool enable);
+/**
+ * @brief Includes input region.
+ *
+ * This function inlcudes input regions.
+ * It can be used multiple times and supports multiple regions.
+ * It means input region will be extended.
+ *
+ * This input is related to mouse and touch event.
+ * If device has touch screen, this function is useful.
+ * Otherwise device does not have that, we can use it after connecting mouse to the device.
+ *
+ * @param[in] window The window instance.
+ * @param[in] inputRegion The added region to accept input events.
+ */
+DALI_ADAPTOR_API void IncludeInputRegion(Window window, const Rect<int>& inputRegion);
+
+/**
+ * @brief Excludes input region.
+ *
+ * This function excludes input regions.
+ * It can be used multiple times and supports multiple regions.
+ * It means input region will be reduced.
+ * Nofice, should be set input area by IncludeInputRegion() before this function is used.
+ *
+ * This input is related to mouse and touch event.
+ * If device has touch screen, this function is useful.
+ * Otherwise device does not have that, we can use it after connecting mouse to the device.
+ *
+ * @param[in] window The window instance.
+ * @param[in] inputRegion The subtracted region to except input events.
+ */
+DALI_ADAPTOR_API void ExcludeInputRegion(Window window, const Rect<int>& inputRegion);
+
} // namespace DevelWindow
} // namespace Dali
return false;
}
+void WindowBaseAndroid::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
+void WindowBaseAndroid::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
} // namespace Adaptor
} // namespace Internal
*/
bool IsFloatingModeEnabled() const override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
private:
/**
* Second stage initialization
*/
virtual void ImeWindowReadyToRender() = 0;
+ /**
+ * @brief Includes input region.
+ * @param[in] inputRegion The added region to accept input events.
+ */
+ virtual void IncludeInputRegion(const Rect<int>& inputRegion) = 0;
+
+ /**
+ * @brief Excludes input region.
+ * @param[in] inputRegion The subtracted region to except input events.
+ */
+ virtual void ExcludeInputRegion(const Rect<int>& inputRegion) = 0;
+
// Signals
/**
mWindowBase->EnableFloatingMode(enable);
}
+void Window::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+ mWindowBase->IncludeInputRegion(inputRegion);
+}
+
+void Window::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+ mWindowBase->ExcludeInputRegion(inputRegion);
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void EnableFloatingMode(bool enable);
+ /**
+ * @copydoc Dali::DevelWindow::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion);
+
+ /**
+ * @copydoc Dali::DevelWindow::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion);
+
private:
/**
* @brief Enumeration for orietation mode.
*/
bool IsFloatingModeEnabled() const override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
private:
// Undefined
WindowBaseCocoa(const WindowBaseCocoa&) = delete;
return false;
}
+void WindowBaseCocoa::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
+void WindowBaseCocoa::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
} // namespace Dali::Internal::Adaptor
@implementation CocoaView
return false;
}
+void WindowBaseEcoreWl::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
+void WindowBaseEcoreWl::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
} // namespace Adaptor
} // namespace Internal
*/
bool IsFloatingModeEnabled() const override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
private:
/**
* Second stage initialization
return ecore_wl2_window_floating_mode_get(mEcoreWindow);
}
+void WindowBaseEcoreWl2::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+ Eina_Rectangle rect;
+ rect.x = inputRegion.x;
+ rect.y = inputRegion.y;
+ rect.w = inputRegion.width;
+ rect.h = inputRegion.height;
+
+ ecore_wl2_window_input_rect_add(mEcoreWindow, &rect);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+}
+
+void WindowBaseEcoreWl2::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+ Eina_Rectangle rect;
+ rect.x = inputRegion.x;
+ rect.y = inputRegion.y;
+ rect.w = inputRegion.width;
+ rect.h = inputRegion.height;
+
+ ecore_wl2_window_input_rect_subtract(mEcoreWindow, &rect);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+}
+
} // namespace Adaptor
} // namespace Internal
*/
bool IsFloatingModeEnabled() const override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
private:
/**
* Second stage initialization
return false;
}
+void WindowBaseEcoreX::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
+void WindowBaseEcoreX::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
} // namespace Adaptor
} // namespace Internal
*/
bool IsFloatingModeEnabled() const override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
private:
/**
* Second stage initialization
return false;
}
+void WindowBaseWin::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
+void WindowBaseWin::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+}
+
} // namespace Adaptor
} // namespace Internal
*/
bool IsFloatingModeEnabled() const override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
+ */
+ void IncludeInputRegion(const Rect<int>& inputRegion) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
+ */
+ void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+
private:
/**
* Second stage initialization