#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>
/**
* 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);
{
// we own the surface about to created
mOwnSurface = true;
- CreateWindow(positionSize);
+ CreateInternalWindow(positionSize);
}
mWlSurface = ecore_wl2_window_surface_get(mEcoreWindow);
// 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
point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
}
}
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);
mTouchEventSignal.Emit(point, touchEvent->timestamp);
+#ifndef OVER_TIZEN_VERSION_8
+ mMouseFrameEventSignal.Emit();
+#endif
+
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
}
}
{
Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change)));
- if(!ev)
+ 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();
#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
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)
return mIsFrontBufferRendering;
}
-void WindowBaseEcoreWl2::SetEglWindowFrontBufferMode(bool enable)
+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;
+}
+
} // namespace Adaptor
} // namespace Internal