/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h>
// INTERNAL HEADERS
+#include <dali/internal/graphics/common/egl-include.h>
#include <dali/internal/input/common/key-impl.h>
#include <dali/internal/system/common/time-service.h>
#include <dali/internal/window-system/common/window-impl.h>
return ECORE_CALLBACK_PASS_ON;
}
+#ifdef OVER_TIZEN_VERSION_8
+/**
+ * Called when a touch motion is received.
+ */
+static Eina_Bool EcoreEventMouseFrame(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnMouseFrame(data, type, event);
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+/**
+ * Called when a touch motion is received.
+ */
+static Eina_Bool EcoreEventMouseButtonRelativeMove(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnMouseButtonRelativeMove(data, type, event);
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+#endif
+
/**
* Called when a touch is canceled.
*/
return ECORE_CALLBACK_PASS_ON;
}
+#ifdef OVER_TIZEN_VERSION_8
+/**
+ * Called when pointer constraints event is recevied.
+ */
+static Eina_Bool EcoreEventPointerConstraints(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnPointerConstraints(data, type, event);
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+#endif
+
/**
* Called when a mouse wheel is received.
*/
}
/////////////////////////////////////////////////////////////////////////////////////////////////
-// Window Device Info Callbacks
+// Conformant Change Callback
/////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Called when a device is added.
- */
-static Eina_Bool EcoreEventDeviceAdd(void* data, int type, void* event)
+static Eina_Bool EcoreEventConformantChange(void* data, int type, void* event)
{
WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
if(windowBase)
{
- windowBase->OnDeviceInfo(data, type, event, Dali::DevelWindow::DeviceInfoEvent::Type::CONNECTED);
+ windowBase->OnEcoreEventConformantChange(event);
}
- return ECORE_CALLBACK_PASS_ON;
-}
-
-/**
- * Called when a device is removed
- */
-static Eina_Bool EcoreEventDeviceDel(void* data, int type, void* event)
-{
- WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
- if(windowBase)
- {
- windowBase->OnDeviceInfo(data, type, event, Dali::DevelWindow::DeviceInfoEvent::Type::DISCONNECTED);
- }
- return ECORE_CALLBACK_PASS_ON;
+ return ECORE_CALLBACK_RENEW;
}
static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
static void TizenPolicyConformantArea(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->TizenPolicyConformantArea(data, tizenPolicy, surface, conformantPart, state, x, y, w, h);
+ }
}
static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state)
mScreenOffModeChangeDone(true),
mVisible(true),
mOwnSurface(false),
- mBrightnessChangeDone(true)
+ mBrightnessChangeDone(true),
+ mIsFrontBufferRendering(false),
+ mIsIMEWindowInitialized(false)
{
Initialize(positionSize, surface, isTransparent);
}
if(mOwnSurface)
{
- ecore_wl2_window_free(mEcoreWindow);
+ try
+ {
+ ecore_wl2_window_free(mEcoreWindow);
+ }
+ catch(std::bad_weak_ptr const& ex)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::~WindowBaseEcoreWl2() - window (%p) std::bad_weak_ptr caught: %s\n", mEcoreWindow, ex.what());
+ }
}
}
{
// we own the surface about to created
mOwnSurface = true;
- CreateWindow(positionSize);
+ CreateInternalWindow(positionSize);
}
mWlSurface = ecore_wl2_window_surface_get(mEcoreWindow);
SetTransparency(isTransparent);
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get(display);
+
+ if(ecoreWlInput)
+ {
+ mKeyMap = ecore_wl2_input_keymap_get(ecoreWlInput);
+
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED, EcoreEventSeatKeymapChanged, this));
+ }
+
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this));
+#ifdef OVER_TIZEN_VERSION_8
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_RELATIVE_MOVE, EcoreEventMouseButtonRelativeMove, this));
+
+ // Register pointer lock/unlock event
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_POINTER_CONSTRAINTS, EcoreEventPointerConstraints, this));
+
+ // Register mouse frame events
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_FRAME, EcoreEventMouseFrame, this));
+#endif
// Register Mouse wheel events
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this));
// Register Window auxiliary event
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_AUX_MESSAGE, EcoreEventWindowAuxiliaryMessage, this));
+ // Register Conformant change event
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, EcoreEventConformantChange, this));
+
#if defined(VCONF_ENABLED)
// Register Vconf notify - font name and size
vconf_notify_key_changed_for_ui_thread(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this);
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_MOVE_DONE, EcoreEventWindowMoveCompleted, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_RESIZE_DONE, EcoreEventWindowResizeCompleted, this));
- // Register Device Info
- mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_DEVICE_ADD, EcoreEventDeviceAdd, this));
- mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_DEVICE_DEL, EcoreEventDeviceDel, this));
-
- Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
- mDisplay = ecore_wl2_display_get(display);
-
+ mDisplay = ecore_wl2_display_get(display);
if(mDisplay)
{
wl_display* displayWrapper = static_cast<wl_display*>(wl_proxy_create_wrapper(mDisplay));
wl_registry* registry = wl_display_get_registry(displayWrapper);
wl_registry_add_listener(registry, ®istryListener, this);
+
+ // To support ECORE_WL2_EVENT_CONFORMANT_CHANGE event handler
+ ecore_wl2_window_conformant_set(mEcoreWindow, true);
}
wl_proxy_wrapper_destroy(displayWrapper);
}
}
- Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get(display);
-
- if(ecoreWlInput)
- {
- mKeyMap = ecore_wl2_input_keymap_get(ecoreWlInput);
-
- mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED, EcoreEventSeatKeymapChanged, this));
- }
-
// get auxiliary hint
Eina_List* hints = ecore_wl2_window_aux_hints_supported_get(mEcoreWindow);
if(hints)
Ecore_Wl2_Event_Window_Iconify_State_Change* iconifyChangedEvent(static_cast<Ecore_Wl2_Event_Window_Iconify_State_Change*>(event));
Eina_Bool handled(ECORE_CALLBACK_PASS_ON);
- if(iconifyChangedEvent->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(iconifyChangedEvent->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
if(iconifyChangedEvent->iconified == EINA_TRUE)
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnIconifyStateChanged, the window (%p) is iconified\n", mEcoreWindow);
mIconifyChangedSignal.Emit(true);
}
else
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnIconifyStateChanged, the window (%p) is not iconified\n", mEcoreWindow);
mIconifyChangedSignal.Emit(false);
}
handled = ECORE_CALLBACK_DONE;
{
Ecore_Wl2_Event_Focus_In* focusInEvent(static_cast<Ecore_Wl2_Event_Focus_In*>(event));
- if(focusInEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(focusInEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n");
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnFocusIn, Window (%p) EcoreEventWindowFocusIn\n", mEcoreWindow);
mFocusChangedSignal.Emit(true);
}
{
Ecore_Wl2_Event_Focus_Out* focusOutEvent(static_cast<Ecore_Wl2_Event_Focus_Out*>(event));
- if(focusOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(focusOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n");
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnFocusOut, Window (%p) EcoreEventWindowFocusOut\n", mEcoreWindow);
mFocusChangedSignal.Emit(false);
}
{
Ecore_Wl2_Event_Output_Transform* transformEvent(static_cast<Ecore_Wl2_Event_Output_Transform*>(event));
- if(transformEvent->output == ecore_wl2_window_output_find(mEcoreWindow))
+ if(transformEvent->output == ecore_wl2_window_output_find(mEcoreWindow) && Dali::Adaptor::IsAvailable())
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", mEcoreWindow);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnOutputTransform, Window (%p) EcoreEventOutputTransform\n", mEcoreWindow);
mScreenRotationAngle = GetScreenRotationAngle();
{
Ecore_Wl2_Event_Ignore_Output_Transform* ignoreTransformEvent(static_cast<Ecore_Wl2_Event_Ignore_Output_Transform*>(event));
- if(ignoreTransformEvent->win == mEcoreWindow)
+ if(ignoreTransformEvent->win == mEcoreWindow && Dali::Adaptor::IsAvailable())
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnIgnoreOutputTransform, Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow);
mScreenRotationAngle = GetScreenRotationAngle();
{
Ecore_Wl2_Event_Window_Rotation* ev(static_cast<Ecore_Wl2_Event_Window_Rotation*>(event));
- if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
- DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnRotation, Window (%p), angle: %d, width: %d, height: %d\n", mEcoreWindow, ev->angle, ev->w, ev->h);
RotationEvent rotationEvent;
rotationEvent.angle = ev->angle;
{
Ecore_Wl2_Event_Window_Configure* ev(static_cast<Ecore_Wl2_Event_Window_Configure*>(event));
- if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
// Note: To comply with the wayland protocol, Dali should make an ack_configure
// by calling ecore_wl2_window_commit
mWindowPositionSize.y = ev->y;
mWindowPositionSize.width = newWidth;
mWindowPositionSize.height = newHeight;
- DALI_LOG_RELEASE_INFO("Update position & resize signal by server, current angle [%d] x[%d] y[%d] w[%d] h[%d]\n", mWindowRotationAngle, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnConfiguration, Window (%p), Update position & resize signal by Ecore, current angle [%d] x[%d] y[%d] w[%d] h[%d]\n", mEcoreWindow, mWindowRotationAngle, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
{
Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
- if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_DOWN");
point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
{
Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
- if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_UP");
point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
{
Ecore_Event_Mouse_Move* touchEvent = static_cast<Ecore_Event_Mouse_Move*>(event);
- if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_MOVE");
point.SetDeviceSubclass(deviceSubclass);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
+#ifdef OVER_TIZEN_VERSION_8
+void WindowBaseEcoreWl2::OnMouseFrame(void* data, int type, void* event)
+{
+ Ecore_Event_Mouse_Frame* MouseFrameEvent = static_cast<Ecore_Event_Mouse_Frame*>(event);
+
+ if(MouseFrameEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_FRAME");
+ mMouseFrameEventSignal.Emit();
+ }
+}
+
+void WindowBaseEcoreWl2::OnMouseButtonRelativeMove(void* data, int type, void* event)
+{
+ Ecore_Event_Mouse_Relative_Move* relativeMoveEvent = static_cast<Ecore_Event_Mouse_Relative_Move*>(event);
+
+ if(relativeMoveEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_RELATIVE_MOVE");
+
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
+
+ GetDeviceClass(ecore_device_class_get(relativeMoveEvent->dev), deviceClass);
+ GetDeviceSubclass(ecore_device_subclass_get(relativeMoveEvent->dev), deviceSubclass);
+
+ Dali::DevelWindow::MouseRelativeEvent mouseRelativeEvent(Dali::DevelWindow::MouseRelativeEvent::Type::RELATIVE_MOVE, relativeMoveEvent->modifiers, relativeMoveEvent->timestamp, Vector2(relativeMoveEvent->dx, relativeMoveEvent->dy), Vector2(relativeMoveEvent->dx_unaccel, relativeMoveEvent->dy_unaccel), deviceClass, deviceSubclass);
+
+ mMouseRelativeEventSignal.Emit(mouseRelativeEvent);
+ }
+}
+#endif
+
void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
{
Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
- if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_CANCEL");
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
+
+ GetDeviceClass(ecore_device_class_get(touchEvent->dev), deviceClass);
+ GetDeviceSubclass(ecore_device_subclass_get(touchEvent->dev), deviceSubclass);
+
Integration::Point point;
point.SetDeviceId(touchEvent->multi.device);
point.SetState(PointState::INTERRUPTED);
- point.SetScreenPosition(Vector2(0.0f, 0.0f));
+ point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
+ point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y));
+ point.SetPressure(touchEvent->multi.pressure);
+ point.SetAngle(Degree(touchEvent->multi.angle));
+ point.SetDeviceClass(deviceClass);
+ point.SetDeviceSubclass(deviceSubclass);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
+
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
}
}
+#ifdef OVER_TIZEN_VERSION_8
+void WindowBaseEcoreWl2::OnPointerConstraints(void* data, int type, void* event)
+{
+ Ecore_Wl2_Event_Pointer_Constraints* constraintsEvent = static_cast<Ecore_Wl2_Event_Pointer_Constraints*>(event);
+
+ if(constraintsEvent && constraintsEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_POINTER_CONSTRAINTS");
+ Dali::Int32Pair position(constraintsEvent->x, constraintsEvent->y);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnPointerConstraints[%d, %d]\n", position.GetX(), position.GetY());
+
+ mPointerConstraintsSignal.Emit(position, constraintsEvent->locked, constraintsEvent->confined);
+ }
+}
+#endif
+
void WindowBaseEcoreWl2::OnMouseWheel(void* data, int type, void* event)
{
Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast<Ecore_Event_Mouse_Wheel*>(event);
- if(mouseWheelEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(mouseWheelEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_WHEEL");
{
Ecore_Event_Mouse_IO* mouseInOutEvent = static_cast<Ecore_Event_Mouse_IO*>(event);
- if(mouseInOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(mouseInOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_IN_OUT");
{
Ecore_Event_Detent_Rotate* detentEvent = static_cast<Ecore_Event_Detent_Rotate*>(event);
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n");
-
- int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnDetentRotation, Window (%p)\n", mEcoreWindow);
+ if(Dali::Adaptor::IsAvailable())
+ {
+ int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
- Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
+ Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
- mWheelEventSignal.Emit(wheelEvent);
+ mWheelEventSignal.Emit(wheelEvent);
+ }
}
void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
{
Ecore_Event_Key* keyEvent = static_cast<Ecore_Event_Key*>(event);
- if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
std::string keyName(keyEvent->keyname);
std::string logicalKey("");
GetDeviceClass(ecore_device_class_get(keyEvent->dev), deviceClass);
GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
+ bool isRepeat = false;
+#ifdef OVER_TIZEN_VERSION_8
+ if(keyEvent->event_flags & ECORE_EVENT_FLAG_REPEAT)
+ {
+ isRepeat = true;
+ }
+#endif
+
Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass);
+ keyEvent.isRepeat = isRepeat;
+ keyEvent.windowId = GetNativeWindowId();
mKeyEventSignal.Emit(keyEvent);
}
{
Ecore_Event_Key* keyEvent = static_cast<Ecore_Event_Key*>(event);
- if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 23)
// Cancel processing flag is sent because this key event will combine with the previous key. So, the event should not actually perform anything.
GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, deviceName, deviceClass, deviceSubclass);
+ keyEvent.windowId = GetNativeWindowId();
mKeyEventSignal.Emit(keyEvent);
}
void WindowBaseEcoreWl2::OnDataSend(void* data, int type, void* event)
{
- mSelectionDataSendSignal.Emit(event);
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mSelectionDataSendSignal.Emit(event);
+ }
}
void WindowBaseEcoreWl2::OnDataReceive(void* data, int type, void* event)
{
- mSelectionDataReceivedSignal.Emit(event);
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mSelectionDataReceivedSignal.Emit(event);
+ }
}
void WindowBaseEcoreWl2::OnFontNameChanged()
{
- mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_CHANGE);
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_CHANGE);
+ }
}
void WindowBaseEcoreWl2::OnFontSizeChanged()
{
- mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+ }
}
void WindowBaseEcoreWl2::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type)
{
- mTransitionEffectEventSignal.Emit(state, type);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnTransitionEffectEvent, Window (%p)\n", mEcoreWindow);
+
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mTransitionEffectEventSignal.Emit(state, type);
+ }
}
void WindowBaseEcoreWl2::OnKeyboardRepeatSettingsChanged()
{
- mKeyboardRepeatSettingsChangedSignal.Emit();
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mKeyboardRepeatSettingsChangedSignal.Emit();
+ }
}
void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
{
- mWindowRedrawRequestSignal.Emit();
+ if(Dali::Adaptor::IsAvailable())
+ {
+ mWindowRedrawRequestSignal.Emit();
+ }
}
void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event)
{
- Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
- if(message)
+ if(Dali::Adaptor::IsAvailable())
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, key:%s, value:%s \n", message->key, message->val);
- std::string key(message->key);
- std::string value(message->val);
- Dali::Property::Array options;
-
- if(message->options)
+ Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
+ if(message)
{
- Eina_List* l;
- void* data;
- EINA_LIST_FOREACH(message->options, l, data)
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, Window (%p), key:%s, value:%s \n", mEcoreWindow, message->key, message->val);
+ std::string key(message->key);
+ std::string value(message->val);
+ Dali::Property::Array options;
+
+ if(message->options)
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n", (char*)data);
- std::string option(static_cast<char*>(data));
- options.Add(option);
+ Eina_List* l;
+ void* data;
+ EINA_LIST_FOREACH(message->options, l, data)
+ {
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, Window (%p), option: %s\n", mEcoreWindow, (char*)data);
+ std::string option(static_cast<char*>(data));
+ options.Add(option);
+ }
}
+
+ mAuxiliaryMessageSignal.Emit(key, value, options);
}
+ }
+}
+
+void WindowBaseEcoreWl2::OnEcoreEventConformantChange(void* event)
+{
+ if(Dali::Adaptor::IsAvailable())
+ {
+ Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(event);
+ if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ {
+ WindowInsetsPartType partType = WindowInsetsPartType::STATUS_BAR;
+
+ int x = 0;
+ int y = 0;
+ int w = 0;
+ int h = 0;
+
+ switch(ev->part_type)
+ {
+ case ECORE_WL2_INDICATOR_PART:
+ {
+ partType = WindowInsetsPartType::STATUS_BAR;
+ ecore_wl2_window_indicator_geometry_get(mEcoreWindow, &x, &y, &w, &h);
+ break;
+ }
+ case ECORE_WL2_KEYBOARD_PART:
+ {
+ partType = WindowInsetsPartType::KEYBOARD;
+ ecore_wl2_window_keyboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
+ break;
+ }
+ case ECORE_WL2_CLIPBOARD_PART:
+ {
+ partType = WindowInsetsPartType::CLIPBOARD;
+ ecore_wl2_window_clipboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
- mAuxiliaryMessageSignal.Emit(key, value, options);
+ WindowInsetsPartState partState = WindowInsetsPartState::INVISIBLE;
+
+ int left = 0;
+ int right = 0;
+ int top = 0;
+ int bottom = 0;
+
+ // Insets are applied only if system UI(e.g. virtual keyboard) satisfies the following 2 conditions.
+ // 1. System UI fits to the window width or height.
+ // 2. System UI begins or ends from the edge of window.
+ // Otherwise, we should not resize window content because there would be empty space around system UI.
+ bool applyInsets = false;
+
+ // Zero insets are applied if state is invisible
+ if(!ev->state)
+ {
+ applyInsets = true;
+ }
+ else
+ {
+ partState = WindowInsetsPartState::VISIBLE;
+
+ int winX = mWindowPositionSize.x;
+ int winY = mWindowPositionSize.y;
+ int winW = mWindowPositionSize.width;
+ int winH = mWindowPositionSize.height;
+
+ if((x <= winX) && (x + w >= winX + winW))
+ {
+ if((y <= winY) && (y + h >= winY) && (y + h <= winY + winH))
+ {
+ top = y + h - winY;
+ applyInsets = true;
+ }
+ else if((y + h >= winY + winH) && (y >= winY) && (y <= winY + winH))
+ {
+ bottom = winY + winH - y;
+ applyInsets = true;
+ }
+ }
+ else if((y <= winY) && (y + h >= winY + winH))
+ {
+ if((x <= winX) && (x + w >= winX) && (x + w <= winX + winW))
+ {
+ left = x + w - winX;
+ applyInsets = true;
+ }
+ else if((x + w >= winX + winW) && (x >= winX) && (x <= winX + winW))
+ {
+ right = winX + winW - x;
+ applyInsets = true;
+ }
+ }
+ }
+
+ if(applyInsets)
+ {
+ mInsetsChangedSignal.Emit(partType, partState, Extents(left, right, top, bottom));
+ }
+ }
}
}
void WindowBaseEcoreWl2::OnMoveCompleted(void* event)
{
Ecore_Wl2_Event_Window_Interactive_Move_Done* movedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Move_Done*>(event);
- if(movedDoneEvent && movedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(movedDoneEvent && movedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
Dali::PositionSize orgPositionSize(movedDoneEvent->x, movedDoneEvent->y, movedDoneEvent->w, movedDoneEvent->h);
Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
Dali::Int32Pair newPosition(newPositionSize.x, newPositionSize.y);
- DALI_LOG_RELEASE_INFO("window(%p) has been moved by server[%d, %d]\n", mEcoreWindow, newPositionSize.x, newPositionSize.y);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnMoveCompleted, window(%p) has been moved by server[%d, %d]\n", mEcoreWindow, newPositionSize.x, newPositionSize.y);
mMoveCompletedSignal.Emit(newPosition);
}
}
void WindowBaseEcoreWl2::OnResizeCompleted(void* event)
{
Ecore_Wl2_Event_Window_Interactive_Resize_Done* resizedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Resize_Done*>(event);
- if(resizedDoneEvent && resizedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(resizedDoneEvent && resizedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
{
Dali::PositionSize orgPositionSize(resizedDoneEvent->x, resizedDoneEvent->y, resizedDoneEvent->w, resizedDoneEvent->h);
Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
Dali::Uint16Pair newSize(newPositionSize.width, newPositionSize.height);
- DALI_LOG_RELEASE_INFO("window(%p) has been resized by server[%d, %d]\n", mEcoreWindow, newPositionSize.width, newPositionSize.height);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnResizeCompleted, window(%p) has been resized by server[%d, %d]\n", mEcoreWindow, newPositionSize.width, newPositionSize.height);
mResizeCompletedSignal.Emit(newSize);
}
}
-void WindowBaseEcoreWl2::OnDeviceInfo(void* data, int type, void* event, Dali::DevelWindow::DeviceInfoEvent::Type action)
-{
- Ecore_Event_Device_Info* deviceInfo = static_cast<Ecore_Event_Device_Info*>(event);
-
- if(deviceInfo->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
- {
- DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_DEVICE_INFO");
-
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnDeviceInfo: name: %s, identifier: %s, seatname: %s\n", deviceInfo->name, deviceInfo->identifier, deviceInfo->seatname);
-
- std::string name(deviceInfo->name);
- std::string identifier(deviceInfo->identifier);
- std::string seatname(deviceInfo->seatname);
-
- Device::Class::Type deviceClass;
- Device::Subclass::Type deviceSubclass;
-
- GetDeviceClass(deviceInfo->clas, deviceClass);
- GetDeviceSubclass(deviceInfo->subclas, deviceSubclass);
-
- Dali::DevelWindow::DeviceInfoEvent deviceInfoEvent(action, name, identifier, seatname, deviceClass, deviceSubclass);
-
- mDeviceInfoEventSignal.Emit(deviceInfoEvent);
- }
-}
-
void WindowBaseEcoreWl2::RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
{
if(strcmp(interface, tizen_policy_interface.name) == 0)
mTizenDisplayPolicy = NULL;
}
+void WindowBaseEcoreWl2::TizenPolicyConformantArea(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
+{
+ int originalX, originalY, originalWidth, originalHeight;
+ bool changed = false;
+
+ if(!surface)
+ {
+ DALI_LOG_ERROR("Failed to get wayland surface in WindowBaseEcoreWl2::TizenPolicyConformantArea()\n");
+ return;
+ }
+
+ if(conformantPart == TIZEN_POLICY_CONFORMANT_PART_INDICATOR)
+ {
+ ecore_wl2_window_indicator_geometry_get(mEcoreWindow, &originalX, &originalY, &originalWidth, &originalHeight);
+ if((originalX != x) || (originalY != y) || (originalWidth != w) || (originalHeight != h))
+ {
+ ecore_wl2_window_indicator_geometry_set(mEcoreWindow, x, y, w, h);
+ changed = true;
+ }
+
+ /**
+ * The given state is based on the visibility value of indicator.
+ * Thus we need to add 1 to it before comparing with indicator state.
+ */
+ Ecore_Wl2_Indicator_State indState = ecore_wl2_window_indicator_state_get(mEcoreWindow);
+ if((state + 1) != indState)
+ {
+ ecore_wl2_window_indicator_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Indicator_State>(state + 1));
+ changed = true;
+ }
+ }
+ else if(conformantPart == TIZEN_POLICY_CONFORMANT_PART_KEYBOARD)
+ {
+ ecore_wl2_window_keyboard_geometry_get(mEcoreWindow, &originalX, &originalY, &originalWidth, &originalHeight);
+ if((originalX != x) || (originalY != y) || (originalWidth != w) || (originalHeight != h))
+ {
+ ecore_wl2_window_keyboard_geometry_set(mEcoreWindow, x, y, w, h);
+ changed = true;
+ }
+
+ /**
+ * The given state is based on the visibility value of virtual keyboard window.
+ * Thus we need to add 1 to it before comparing with keyboard state.
+ */
+ Ecore_Wl2_Virtual_Keyboard_State kbdState = ecore_wl2_window_keyboard_state_get(mEcoreWindow);
+ if((state + 1) != (kbdState))
+ {
+ ecore_wl2_window_keyboard_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Virtual_Keyboard_State>(state + 1));
+ changed = true;
+ }
+ }
+ else if(conformantPart == TIZEN_POLICY_CONFORMANT_PART_CLIPBOARD)
+ {
+ ecore_wl2_window_clipboard_geometry_get(mEcoreWindow, &originalX, &originalY, &originalWidth, &originalHeight);
+ if((originalX != x) || (originalY != y) || (originalWidth != w) || (originalHeight != h))
+ {
+ ecore_wl2_window_clipboard_geometry_set(mEcoreWindow, x, y, w, h);
+ changed = true;
+ }
+
+ /**
+ * The given state is based on the visibility value of clipboard window.
+ * Thus we need to add 1 to it before comparing with clipboard state.
+ */
+ Ecore_Wl2_Clipboard_State clipState = ecore_wl2_window_clipboard_state_get(mEcoreWindow);
+ if((state + 1) != clipState)
+ {
+ ecore_wl2_window_clipboard_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Clipboard_State>(state + 1));
+ changed = true;
+ }
+ }
+
+ if(changed)
+ {
+ Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change)));
+
+ if(DALI_UNLIKELY(!ev))
+ {
+ DALI_LOG_ERROR("Failed to allocate Ecore_Wl2_Event_Conformant_Change. calloc size : %zu\n", sizeof(Ecore_Wl2_Event_Conformant_Change));
+ return;
+ }
+ ev->win = GetNativeWindowId();
+ ev->part_type = static_cast<Ecore_Wl2_Conformant_Part_Type>(conformantPart);
+ ev->state = state;
+ ecore_event_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
+ }
+
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyConformantArea: conformantPart = %u, state = %u, position = (%d, %d), size = (%d, %d)\n", conformantPart, state, x, y, w, h);
+}
+
void WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state)
{
mNotificationLevel = level;
KeyCodeMap foundKeyCode;
sym = xkb_keysym_from_name(keyName.c_str(), XKB_KEYSYM_NO_FLAGS);
- if(sym == XKB_KEY_NoSymbol)
+ if(sym == XKB_KEY_NoSymbol || !mKeyMap)
{
- DALI_LOG_ERROR("Failed to get keysym in WindowBaseEcoreWl2\n");
+ DALI_LOG_ERROR("Failed to get keysym or keymap in WindowBaseEcoreWl2\n");
return;
}
#endif
}
-EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
+Dali::Any WindowBaseEcoreWl2::CreateWindow(int width, int height)
{
int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
}
FINISH_DURATION_CHECK("wl_egl_window_create");
- return static_cast<EGLNativeWindowType>(mEglWindow);
+ return static_cast<void*>(mEglWindow);
}
-void WindowBaseEcoreWl2::DestroyEglWindow()
+void WindowBaseEcoreWl2::DestroyWindow()
{
if(mEglWindow != NULL)
{
}
}
-void WindowBaseEcoreWl2::SetEglWindowRotation(int angle)
+void WindowBaseEcoreWl2::SetWindowRotation(int angle)
{
wl_egl_window_tizen_rotation rotation;
FINISH_DURATION_CHECK("wl_egl_window_tizen_set_rotation");
}
-void WindowBaseEcoreWl2::SetEglWindowBufferTransform(int angle)
+void WindowBaseEcoreWl2::SetWindowBufferTransform(int angle)
{
wl_output_transform bufferTransform;
FINISH_DURATION_CHECK("wl_egl_window_tizen_set_buffer_transform");
}
-void WindowBaseEcoreWl2::SetEglWindowTransform(int angle)
+void WindowBaseEcoreWl2::SetWindowTransform(int angle)
{
wl_output_transform windowTransform;
FINISH_DURATION_CHECK("wl_egl_window_tizen_set_window_transform");
}
-void WindowBaseEcoreWl2::ResizeEglWindow(PositionSize positionSize)
+void WindowBaseEcoreWl2::ResizeWindow(PositionSize positionSize)
{
DALI_LOG_RELEASE_INFO("wl_egl_window_resize(), (%d, %d) [%d x %d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height);
START_DURATION_CHECK();
FINISH_DURATION_CHECK("wl_egl_window functions");
}
-bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
+bool WindowBaseEcoreWl2::IsWindowRotationSupported()
{
START_DURATION_CHECK();
// Check capability
void WindowBaseEcoreWl2::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
{
+#ifdef OVER_TIZEN_VERSION_8
DALI_LOG_RELEASE_INFO("ecore_wl2_window_layout_set, numCols[%d], numRows[%d], column[%d], row[%d], colSpan[%d], rowSpan[%d]\n", numCols, numRows, column, row, colSpan, rowSpan);
START_DURATION_CHECK();
ecore_wl2_window_layout_set(mEcoreWindow, numCols, numRows, column, row, colSpan, rowSpan);
FINISH_DURATION_CHECK("ecore_wl2_window_layout_set");
+#endif
}
void WindowBaseEcoreWl2::SetClass(const std::string& name, const std::string& className)
{
case Dali::WindowType::NORMAL:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, Dali::WindowType::NORMAL\n");
windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
break;
}
case Dali::WindowType::NOTIFICATION:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, Dali::WindowType::NOTIFICATION\n");
windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
break;
}
case Dali::WindowType::UTILITY:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, Dali::WindowType::UTILITY\n");
windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
break;
}
case Dali::WindowType::DIALOG:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, Dali::WindowType::DIALOG\n");
windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
break;
}
case Dali::WindowType::IME:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, Dali::WindowType::IME\n");
windowType = ECORE_WL2_WINDOW_TYPE_NONE;
break;
}
case Dali::WindowType::DESKTOP:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, Dali::WindowType::DESKTOP\n");
windowType = ECORE_WL2_WINDOW_TYPE_DESKTOP;
break;
}
default:
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetType, default window type\n");
windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
break;
}
Dali::WindowType WindowBaseEcoreWl2::GetType() const
{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::GetType(), Window (%p), DALI WindType: %d, mIsIMEWindowInitialized: %d\n", mEcoreWindow, mType, mIsIMEWindowInitialized);
return mType;
}
int notificationLevel;
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetNotificationLevel(), Window (%p), level [%d]\n", mEcoreWindow, level);
switch(level)
{
case Dali::WindowNotificationLevel::NONE:
}
default:
{
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: invalid level [%d]\n", level);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetNotificationLevel(), invalid level [%d]\n", level);
notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
break;
}
FINISH_DURATION_CHECK("ecore_wl2_window_alpha_set");
}
-void WindowBaseEcoreWl2::CreateWindow(PositionSize positionSize)
+void WindowBaseEcoreWl2::CreateInternalWindow(PositionSize positionSize)
{
Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL);
if(!display)
Ecore_Wl2_Global* global;
Ecore_Wl2_Display* ecoreWl2Display;
+ if(mIsIMEWindowInitialized)
+ {
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::InitializeIme, IME Window is already initialized\n");
+ return;
+ }
+
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);
+ DALI_LOG_RELEASE_INFO("InitializeIme: Ecore_Wl2_Display: %p, ecore wl window: %p, mIsIMEWindowInitialized: %d\n", ecoreWl2Display, mEcoreWindow, mIsIMEWindowInitialized);
if(!(registry = ecore_wl2_display_registry_get(ecoreWl2Display)))
{
wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
#endif
FINISH_DURATION_CHECK("zwp_input_panel_surface_v1_set_toplevel");
+ mIsIMEWindowInitialized = true;
}
void WindowBaseEcoreWl2::ImeWindowReadyToRender()
ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
}
+bool WindowBaseEcoreWl2::PointerConstraintsLock()
+{
+#ifdef OVER_TIZEN_VERSION_8
+ return ecore_wl2_window_pointer_constraints_lock_pointer(mEcoreWindow);
+#else
+ return false;
+#endif
+}
+
+bool WindowBaseEcoreWl2::PointerConstraintsUnlock()
+{
+#ifdef OVER_TIZEN_VERSION_8
+ return ecore_wl2_window_pointer_constraints_unlock_pointer(mEcoreWindow);
+#else
+ return false;
+#endif
+}
+
+void WindowBaseEcoreWl2::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+#ifdef OVER_TIZEN_VERSION_8
+ ecore_wl2_window_locked_pointer_region_set(mEcoreWindow, x, y, width, height);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+#endif
+}
+
+void WindowBaseEcoreWl2::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+#ifdef OVER_TIZEN_VERSION_8
+ ecore_wl2_window_locked_pointer_cursor_position_hint_set(mEcoreWindow, x, y);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+#endif
+}
+
+bool WindowBaseEcoreWl2::PointerWarp(int32_t x, int32_t y)
+{
+ return ecore_wl2_window_pointer_warp(mEcoreWindow, x, y);
+}
+
+void WindowBaseEcoreWl2::CursorVisibleSet(bool visible)
+{
+#ifdef OVER_TIZEN_VERSION_8
+ ecore_wl2_window_cursor_visible_set(mEcoreWindow, visible);
+#endif
+}
+
+// Request grab key events according to the requested device subtype
+//(For now, subtype could be '0'/'11'/'12' which equals to ECORE_DEVICE_SUBCLASS_NONE/REMOCON/VIRTUAL_KEYBOARD)
+bool WindowBaseEcoreWl2::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+#ifdef OVER_TIZEN_VERSION_8
+ Ecore_Device_Subclass ecoreDeviceSubclass;
+ switch(deviceSubclass)
+ {
+ case Device::Subclass::NONE:
+ {
+ ecoreDeviceSubclass = ECORE_DEVICE_SUBCLASS_NONE;
+ break;
+ }
+ case Device::Subclass::REMOCON:
+ {
+ ecoreDeviceSubclass = ECORE_DEVICE_SUBCLASS_REMOCON;
+ break;
+ }
+ case Device::Subclass::VIRTUAL_KEYBOARD:
+ {
+ ecoreDeviceSubclass = ECORE_DEVICE_SUBCLASS_VIRTUAL_KEYBOARD;
+ break;
+ }
+ default:
+ {
+ DALI_LOG_ERROR("deviceSubclass : %d type is not support, subtype could be 'NONE', 'REMOCON', 'VIRTUAL_KEYBOARD'\n");
+ return false;
+ }
+ }
+ return ecore_wl2_window_keyboard_grab(mEcoreWindow, ecoreDeviceSubclass);
+#else
+ return false;
+#endif
+}
+
+// Request ungrab key events
+bool WindowBaseEcoreWl2::KeyboardUnGrab()
+{
+#ifdef OVER_TIZEN_VERSION_8
+ return ecore_wl2_window_keyboard_ungrab(mEcoreWindow);
+#else
+ return false;
+#endif
+}
+
+void WindowBaseEcoreWl2::SetFullScreen(bool fullscreen)
+{
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_fullscreen_set, window: [%p], fullscreen [%d]\n", mEcoreWindow, fullscreen);
+ START_DURATION_CHECK();
+ ecore_wl2_window_fullscreen_set(mEcoreWindow, fullscreen);
+ ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
+ FINISH_DURATION_CHECK("ecore_wl2_window_fullscreen_set");
+}
+
+bool WindowBaseEcoreWl2::GetFullScreen()
+{
+ return ecore_wl2_window_fullscreen_get(mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::SetFrontBufferRendering(bool enable)
+{
+ mIsFrontBufferRendering = enable;
+}
+
+bool WindowBaseEcoreWl2::GetFrontBufferRendering()
+{
+ return mIsFrontBufferRendering;
+}
+
+void WindowBaseEcoreWl2::SetWindowFrontBufferMode(bool enable)
+{
+ wl_egl_window_tizen_set_frontbuffer_mode(mEglWindow, enable);
+}
+
+void WindowBaseEcoreWl2::SetModal(bool modal)
+{
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_modal_set, window: [%p], flag [%d]\n", mEcoreWindow, modal);
+ START_DURATION_CHECK();
+ ecore_wl2_window_modal_set(mEcoreWindow, modal);
+ FINISH_DURATION_CHECK("ecore_wl2_window_modal_set");
+}
+
+bool WindowBaseEcoreWl2::IsModal()
+{
+ bool ret = ecore_wl2_window_modal_get(mEcoreWindow);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_modal_get, window: [%p], flag [%d]\n", mEcoreWindow, ret);
+ return ret;
+}
+
+void WindowBaseEcoreWl2::SetAlwaysOnTop(bool alwaysOnTop)
+{
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_pin_mode_set, window: [%p], flag [%d]\n", mEcoreWindow, alwaysOnTop);
+ START_DURATION_CHECK();
+ ecore_wl2_window_pin_mode_set(mEcoreWindow, alwaysOnTop);
+ FINISH_DURATION_CHECK("ecore_wl2_window_pin_mode_set");
+}
+
+bool WindowBaseEcoreWl2::IsAlwaysOnTop()
+{
+ bool ret = ecore_wl2_window_pin_mode_get(mEcoreWindow);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_pin_mode_get, window: [%p], flag [%d]\n", mEcoreWindow, ret);
+ return ret;
+}
+
+Any WindowBaseEcoreWl2::GetNativeBuffer() const
+{
+ DALI_LOG_RELEASE_INFO("Get wl_egl_window, ecore_window: [%p], wl_egl_window [%p]\n", mEcoreWindow, mEglWindow);
+ return mEglWindow;
+}
+
+bool WindowBaseEcoreWl2::RelativeMotionGrab(uint32_t boundary)
+{
+ Ecore_Wl2_Pointer_Boundary wlPointerBoundary = static_cast<Ecore_Wl2_Pointer_Boundary>(boundary);
+ bool ret = ecore_wl2_window_relative_motion_grab(mEcoreWindow, wlPointerBoundary);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_relative_motion_grab, window: [%p], boundary:[%d] flag [%d]\n", mEcoreWindow, wlPointerBoundary, ret);
+ return ret;
+}
+
+bool WindowBaseEcoreWl2::RelativeMotionUnGrab()
+{
+ bool ret = ecore_wl2_window_relative_motion_ungrab(mEcoreWindow);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_relative_motion_ungrab, window: [%p], flag [%d]\n", mEcoreWindow, ret);
+ return ret;
+}
+
+void WindowBaseEcoreWl2::SetBackgroundBlur(int blurRadius, int cornerRadius)
+{
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_background_blur_set, window: [%p], blur radius [%d], corner radius[%d]\n", mEcoreWindow, blurRadius, cornerRadius);
+ START_DURATION_CHECK();
+ ecore_wl2_window_background_blur_set(mEcoreWindow, blurRadius, cornerRadius, cornerRadius);
+ FINISH_DURATION_CHECK("ecore_wl2_window_background_blur_set");
+}
+
+int WindowBaseEcoreWl2::GetBackgroundBlur()
+{
+ int radius = ecore_wl2_window_background_blur_get(mEcoreWindow);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_background_blur_get, window: [%p], radius [%d]\n", mEcoreWindow, radius);
+ return radius;
+}
+
} // namespace Adaptor
} // namespace Internal