return 0;
}
-Rect<int> WindowBaseEcoreWl2::RecalculateInputRect(const Rect<int>& rect)
-{
- Rect<int> newRect;
-
- if(mWindowRotationAngle == 90)
- {
- newRect.x = rect.y;
- newRect.y = mWindowPositionSize.height - (rect.x + rect.width);
- newRect.width = rect.height;
- newRect.height = rect.width;
- }
- else if(mWindowRotationAngle == 180)
- {
- newRect.x = mWindowPositionSize.width - (rect.x + rect.width);
- newRect.y = mWindowPositionSize.height - (rect.y + rect.height);
- newRect.width = rect.width;
- newRect.height = rect.height;
- }
- else if(mWindowRotationAngle == 270)
- {
- newRect.x = mWindowPositionSize.width - (rect.y + rect.height);
- newRect.y = rect.x;
- newRect.width = rect.height;
- newRect.height = rect.width;
- }
- else
- {
- newRect.x = rect.x;
- newRect.y = rect.y;
- newRect.width = rect.width;
- newRect.height = rect.height;
- }
- return newRect;
-}
-
void WindowBaseEcoreWl2::SetInputRegion(const Rect<int>& inputRegion)
{
- Rect<int> convertRegion = RecalculateInputRect(inputRegion);
+ Rect<int> convertRegion = RecalculatePositionSizeToSystem(inputRegion);
Eina_Rectangle rect;
rect.x = convertRegion.x;
void WindowBaseEcoreWl2::IncludeInputRegion(const Rect<int>& inputRegion)
{
- Rect<int> convertRegion = RecalculateInputRect(inputRegion);
+ Rect<int> convertRegion = RecalculatePositionSizeToSystem(inputRegion);
Eina_Rectangle rect;
rect.x = convertRegion.x;
void WindowBaseEcoreWl2::ExcludeInputRegion(const Rect<int>& inputRegion)
{
- Rect<int> convertRegion = RecalculateInputRect(inputRegion);
+ Rect<int> convertRegion = RecalculatePositionSizeToSystem(inputRegion);
Eina_Rectangle rect;
rect.x = convertRegion.x;
*/
PositionSize RecalculatePositionSizeToCurrentOrientation(PositionSize positionSize);
- /**
- * @brief Return the rect value to recalulate with the default system coordinates.
- *
- * Some native window APIs work the geometry value based on the default system coordinates.
- * IncludeInputRegion() and ExcludeInputRegion() are one of them.
- * When the window is rotated, current window's geometry already were set with the rotated angle.
- * If IncludeInputRegion() or ExcludeInputRegion() are called with rotated angle by application,
- * the rect's area should be re-calcuated on the default system coordinates.
- *
- * @param[in] rect the window's current position and size with current window rotation angle.
- * @return the re-calculated rect on the default system coordinates.
- */
- Rect<int> RecalculateInputRect(const Rect<int>& rect);
-
protected:
// Undefined
WindowBaseEcoreWl2(const WindowBaseEcoreWl2&) = delete;