/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
static Eina_Bool EcoreEventSeatKeyboardRepeatChanged(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed* keyboardRepeat = static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event);
- WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", keyboardRepeat->id);
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event)->id);
if(windowBase)
{
windowBase->OnKeyboardRepeatSettingsChanged();
static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Window_Redraw_Request* windowRedrawRequest = static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event);
- WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
- DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", windowRedrawRequest->win);
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event)->win);
if(windowBase)
{
windowBase->OnEcoreEventWindowRedrawRequest();
}
/////////////////////////////////////////////////////////////////////////////////////////////////
+// Window Auxiliary Message Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+static Eina_Bool EcoreEventWindowAuxiliaryMessage(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnEcoreEventWindowAuxiliaryMessage(event);
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
// ElDBus Accessibility Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
// Register Window redraw request event
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_REDRAW_REQUEST, EcoreEventWindowRedrawRequest, this));
+ // Register Window auxiliary event
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_AUX_MESSAGE, EcoreEventWindowAuxiliaryMessage, this));
+
// Register Vconf notify - font name and size
vconf_notify_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this);
vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this);
if(windowMoved || windowResized)
{
Dali::PositionSize newPositionSize(ev->x, ev->y, newWidth, newHeight);
+ mWindowPositionSize = newPositionSize;
+ DALI_LOG_RELEASE_INFO("Update position & resize signal by server, x[%d] y[%d] w[%d] h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
mUpdatePositionSizeSignal.Emit(newPositionSize);
}
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n");
- int direction = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
- int timeStamp = detentEvent->timestamp;
+ int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
- Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, direction, 0, Vector2(0.0f, 0.0f), 0, timeStamp);
+ Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
mWheelEventSignal.Emit(wheelEvent);
}
mWindowRedrawRequestSignal.Emit();
}
+void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event)
+{
+ Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
+ if(message)
+ {
+ DALI_LOG_RELEASE_INFO("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)
+ {
+ Eina_List* l;
+ void* data;
+ EINA_LIST_FOREACH(message->options, l, data)
+ {
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n", (char*)data);
+ std::string option(static_cast<char*>(data));
+ options.Add(option);
+ }
+ }
+
+ mAuxiliaryMessageSignal.Emit(key, value, options);
+ }
+}
+
void WindowBaseEcoreWl2::KeymapChanged(void* data, int type, void* event)
{
Ecore_Wl2_Event_Seat_Keymap_Changed* changed = static_cast<Ecore_Wl2_Event_Seat_Keymap_Changed*>(event);
return ecore_wl2_window_id_get(mEcoreWindow);
}
+std::string WindowBaseEcoreWl2::GetNativeWindowResourceId()
+{
+ return std::to_string(ecore_wl2_window_resource_id_get(mEcoreWindow));
+}
+
EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
{
int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
ecore_wl2_window_activate(mEcoreWindow);
}
+void WindowBaseEcoreWl2::Maximize(bool maximize)
+{
+ ecore_wl2_window_maximized_set(mEcoreWindow, maximize);
+}
+
+bool WindowBaseEcoreWl2::IsMaximized() const
+{
+ return ecore_wl2_window_maximized_get(mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::Minimize(bool minimize)
+{
+ ecore_wl2_window_iconified_set(mEcoreWindow, minimize);
+}
+
+bool WindowBaseEcoreWl2::IsMinimized() const
+{
+ return ecore_wl2_window_iconified_get(mEcoreWindow);
+}
+
void WindowBaseEcoreWl2::SetAvailableAnlges(const std::vector<int>& angles)
{
int rotations[4] = {0};
EINA_ITERATOR_FOREACH(globals, global)
{
+#ifdef OVER_TIZEN_VERSION_7
+ if(strcmp(global->interface, "zwp_input_panel_v1") == 0)
+ {
+ mWlInputPanel = (zwp_input_panel_v1*)wl_registry_bind(registry, global->id, &zwp_input_panel_v1_interface, 1);
+ }
+#else
if(strcmp(global->interface, "wl_input_panel") == 0)
{
mWlInputPanel = (wl_input_panel*)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
}
+#endif
else if(strcmp(global->interface, "wl_output") == 0)
{
mWlOutput = (wl_output*)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland output panel interface\n");
return;
}
-
+#ifdef OVER_TIZEN_VERSION_7
+ mWlInputPanelSurface = zwp_input_panel_v1_get_input_panel_surface(mWlInputPanel, mWlSurface);
+#else
mWlInputPanelSurface = wl_input_panel_get_input_panel_surface(mWlInputPanel, mWlSurface);
+#endif
if(!mWlInputPanelSurface)
{
DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel surface\n");
return;
}
-
+#ifdef OVER_TIZEN_VERSION_7
+ zwp_input_panel_surface_v1_set_toplevel(mWlInputPanelSurface, mWlOutput, ZWP_INPUT_PANEL_SURFACE_V1_POSITION_CENTER_BOTTOM);
+#else
wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+#endif
}
void WindowBaseEcoreWl2::ImeWindowReadyToRender()
DALI_LOG_ERROR("WindowBaseEcoreWl2::ImeWindowReadyToRender(), wayland input panel surface is null\n");
return;
}
-
+#ifdef OVER_TIZEN_VERSION_7
+ zwp_input_panel_surface_v1_set_ready(mWlInputPanelSurface, 1);
+#else
wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
+#endif
}
void WindowBaseEcoreWl2::RequestMoveToServer()