/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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/input/common/key-impl.h>
#include <dali/internal/window-system/common/window-impl.h>
-#include <dali/internal/window-system/common/window-system.h>
#include <dali/internal/window-system/common/window-render-surface.h>
-#include <dali/internal/input/common/key-impl.h>
+#include <dali/internal/window-system/common/window-system.h>
// EXTERNAL_HEADERS
-#include <dali/public-api/object/any.h>
-#include <dali/public-api/events/mouse-button.h>
-#include <dali/integration-api/debug.h>
#include <Ecore_Input.h>
-#include <vconf.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
+#include <dali/public-api/events/mouse-button.h>
+#include <dali/public-api/object/any.h>
#include <vconf-keys.h>
+#include <vconf.h>
#include <wayland-egl-tizen.h>
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
namespace
{
-
#if defined(DEBUG_ENABLED)
-Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" );
+Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW_BASE");
#endif
-const uint32_t MAX_TIZEN_CLIENT_VERSION = 7;
-const unsigned int PRIMARY_TOUCH_BUTTON_ID = 1;
+const uint32_t MAX_TIZEN_CLIENT_VERSION = 7;
+const unsigned int PRIMARY_TOUCH_BUTTON_ID = 1;
-const char* DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
+const char* DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
+#ifdef DALI_ELDBUS_AVAILABLE
// DBUS accessibility
-const char* BUS = "org.enlightenment.wm-screen-reader";
+const char* BUS = "org.enlightenment.wm-screen-reader";
const char* INTERFACE = "org.tizen.GestureNavigation";
-const char* PATH = "/org/tizen/GestureNavigation";
+const char* PATH = "/org/tizen/GestureNavigation";
+#endif // DALI_ELDBUS_AVAILABLE
struct KeyCodeMap
{
- xkb_keysym_t keySym;
+ xkb_keysym_t keySym;
xkb_keycode_t keyCode;
- bool isKeyCode;
+ bool isKeyCode;
};
/**
* Get the device name from the provided ecore key event
*/
-void GetDeviceName( Ecore_Event_Key* keyEvent, std::string& result )
+void GetDeviceName(Ecore_Event_Key* keyEvent, std::string& result)
{
- const char* ecoreDeviceName = ecore_device_name_get( keyEvent->dev );
+ const char* ecoreDeviceName = ecore_device_name_get(keyEvent->dev);
- if( ecoreDeviceName )
+ if(ecoreDeviceName)
{
result = ecoreDeviceName;
}
/**
* Get the device class from the provided ecore event
*/
-void GetDeviceClass( Ecore_Device_Class ecoreDeviceClass, Device::Class::Type& deviceClass )
+void GetDeviceClass(Ecore_Device_Class ecoreDeviceClass, Device::Class::Type& deviceClass)
{
- switch( ecoreDeviceClass )
+ switch(ecoreDeviceClass)
{
case ECORE_DEVICE_CLASS_SEAT:
{
}
}
-void GetDeviceSubclass( Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subclass::Type& deviceSubclass )
+void GetDeviceSubclass(Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subclass::Type& deviceSubclass)
{
- switch( ecoreDeviceSubclass )
+ switch(ecoreDeviceSubclass)
{
case ECORE_DEVICE_SUBCLASS_FINGER:
{
}
}
-
-void FindKeyCode( struct xkb_keymap* keyMap, xkb_keycode_t key, void* data )
+void FindKeyCode(struct xkb_keymap* keyMap, xkb_keycode_t key, void* data)
{
- KeyCodeMap* foundKeyCode = static_cast< KeyCodeMap* >( data );
- if( foundKeyCode->isKeyCode )
+ KeyCodeMap* foundKeyCode = static_cast<KeyCodeMap*>(data);
+ if(foundKeyCode->isKeyCode)
{
return;
}
- xkb_keysym_t keySym = foundKeyCode->keySym;
- int nsyms = 0;
+ xkb_keysym_t keySym = foundKeyCode->keySym;
+ int nsyms = 0;
const xkb_keysym_t* symsOut = NULL;
- nsyms = xkb_keymap_key_get_syms_by_level( keyMap, key, 0, 0, &symsOut );
+ nsyms = xkb_keymap_key_get_syms_by_level(keyMap, key, 0, 0, &symsOut);
- if( nsyms && symsOut )
+ if(nsyms && symsOut)
{
- if( *symsOut == keySym )
+ if(*symsOut == keySym)
{
- foundKeyCode->keyCode = key;
+ foundKeyCode->keyCode = key;
foundKeyCode->isKeyCode = true;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
/// Called when the window iconify state is changed.
-static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event )
+static Eina_Bool EcoreEventWindowIconifyStateChanged(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- return windowBase->OnIconifyStateChanged( data, type, event );
+ return windowBase->OnIconifyStateChanged(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/// Called when the window gains focus
-static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event )
+static Eina_Bool EcoreEventWindowFocusIn(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- return windowBase->OnFocusIn( data, type, event );
+ return windowBase->OnFocusIn(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/// Called when the window loses focus
-static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event )
+static Eina_Bool EcoreEventWindowFocusOut(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- return windowBase->OnFocusOut( data, type, event );
+ return windowBase->OnFocusOut(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/// Called when the output is transformed
-static Eina_Bool EcoreEventOutputTransform( void* data, int type, void* event )
+static Eina_Bool EcoreEventOutputTransform(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- return windowBase->OnOutputTransform( data, type, event );
+ return windowBase->OnOutputTransform(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/// Called when the output transform should be ignored
-static Eina_Bool EcoreEventIgnoreOutputTransform( void* data, int type, void* event )
+static Eina_Bool EcoreEventIgnoreOutputTransform(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- return windowBase->OnIgnoreOutputTransform( data, type, event );
+ return windowBase->OnIgnoreOutputTransform(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
/**
* Called when rotate event is recevied.
*/
-static Eina_Bool EcoreEventRotate( void* data, int type, void* event )
+static Eina_Bool EcoreEventRotate(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::EcoreEventRotate\n" );
- windowBase->OnRotation( data, type, event );
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::EcoreEventRotate\n");
+ windowBase->OnRotation(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when configure event is recevied.
*/
-static Eina_Bool EcoreEventConfigure( void* data, int type, void* event )
+static Eina_Bool EcoreEventConfigure(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnConfiguration( data, type, event );
+ windowBase->OnConfiguration(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a touch down is received.
*/
-static Eina_Bool EcoreEventMouseButtonDown( void* data, int type, void* event )
+static Eina_Bool EcoreEventMouseButtonDown(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnMouseButtonDown( data, type, event );
+ windowBase->OnMouseButtonDown(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a touch up is received.
*/
-static Eina_Bool EcoreEventMouseButtonUp( void* data, int type, void* event )
+static Eina_Bool EcoreEventMouseButtonUp(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnMouseButtonUp( data, type, event );
+ windowBase->OnMouseButtonUp(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a touch motion is received.
*/
-static Eina_Bool EcoreEventMouseButtonMove( void* data, int type, void* event )
+static Eina_Bool EcoreEventMouseButtonMove(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnMouseButtonMove( data, type, event );
+ windowBase->OnMouseButtonMove(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a touch is canceled.
*/
-static Eina_Bool EcoreEventMouseButtonCancel( void* data, int type, void* event )
+static Eina_Bool EcoreEventMouseButtonCancel(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnMouseButtonCancel( data, type, event );
+ windowBase->OnMouseButtonCancel(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a mouse wheel is received.
*/
-static Eina_Bool EcoreEventMouseWheel( void* data, int type, void* event )
+static Eina_Bool EcoreEventMouseWheel(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnMouseWheel( data, type, event );
+ windowBase->OnMouseWheel(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a detent rotation event is recevied.
*/
-static Eina_Bool EcoreEventDetentRotation( void* data, int type, void* event )
+static Eina_Bool EcoreEventDetentRotation(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnDetentRotation( data, type, event );
+ windowBase->OnDetentRotation(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a key down is received.
*/
-static Eina_Bool EcoreEventKeyDown( void* data, int type, void* event )
+static Eina_Bool EcoreEventKeyDown(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnKeyDown( data, type, event );
+ windowBase->OnKeyDown(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when a key up is received.
*/
-static Eina_Bool EcoreEventKeyUp( void* data, int type, void* event )
+static Eina_Bool EcoreEventKeyUp(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnKeyUp( data, type, event );
+ windowBase->OnKeyUp(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when the source window notifies us the content in clipboard is selected.
*/
-static Eina_Bool EcoreEventDataSend( void* data, int type, void* event )
+static Eina_Bool EcoreEventDataSend(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnDataSend( data, type, event );
+ windowBase->OnDataSend(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
* Called when the source window sends us about the selected content.
* For example, when item is selected in the clipboard.
*/
-static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event )
+static Eina_Bool EcoreEventDataReceive(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->OnDataReceive( data, type, event );
+ windowBase->OnDataReceive(data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
/**
* Called when transition animation of the window's shown/hidden is started by window manager.
*/
-static Eina_Bool EcoreEventEffectStart(void *data, int type, void *event)
+static Eina_Bool EcoreEventEffectStart(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- Ecore_Wl2_Event_Effect_Start *effectStart = static_cast<Ecore_Wl2_Event_Effect_Start*>( event );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventEffectStart, effect type[ %d ]\n", effectStart->type );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ Ecore_Wl2_Event_Effect_Start* effectStart = static_cast<Ecore_Wl2_Event_Effect_Start*>(event);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventEffectStart, effect type[ %d ]\n", effectStart->type);
+ if(windowBase)
{
- if( effectStart->type < 3 ) // only under restack
+ if(effectStart->type < 3) // only under restack
{
- windowBase->OnTransitionEffectEvent( DevelWindow::EffectState::START, static_cast<DevelWindow::EffectType>( effectStart->type ) );
+ windowBase->OnTransitionEffectEvent(WindowEffectState::START, static_cast<WindowEffectType>(effectStart->type));
}
}
return ECORE_CALLBACK_PASS_ON;
/**
* Called when transition animation of the window's shown/hidden is ended by window manager.
*/
-static Eina_Bool EcoreEventEffectEnd(void *data, int type, void *event)
+static Eina_Bool EcoreEventEffectEnd(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Effect_Start *effectEnd = static_cast<Ecore_Wl2_Event_Effect_Start*>( event );
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventEffectEnd, effect type[ %d ]\n", effectEnd->type );
- if( windowBase )
+ Ecore_Wl2_Event_Effect_Start* effectEnd = static_cast<Ecore_Wl2_Event_Effect_Start*>(event);
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventEffectEnd, effect type[ %d ]\n", effectEnd->type);
+ if(windowBase)
{
- if( effectEnd->type < 3 ) // only under restack
+ if(effectEnd->type < 3) // only under restack
{
- windowBase->OnTransitionEffectEvent( DevelWindow::EffectState::END, static_cast<DevelWindow::EffectType>( effectEnd->type ) );
+ windowBase->OnTransitionEffectEvent(WindowEffectState::END, static_cast<WindowEffectType>(effectEnd->type));
}
}
return ECORE_CALLBACK_PASS_ON;
// Keyboard Repeat Settings Changed Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
-static Eina_Bool EcoreEventSeatKeyboardRepeatChanged(void *data, int type, void *event)
+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 );
- if( windowBase )
- {
- windowBase->OnKeyboardRepeatSettingsChanged();
- }
+ 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);
+ if(windowBase)
+ {
+ windowBase->OnKeyboardRepeatSettingsChanged();
+ }
return ECORE_CALLBACK_RENEW;
}
// Keymap Changed Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
-static Eina_Bool EcoreEventSeatKeymapChanged(void *data, int type, void *event)
+static Eina_Bool EcoreEventSeatKeymapChanged(void* data, int type, void* event)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->KeymapChanged( data, type, event );
+ windowBase->KeymapChanged(data, type, event);
}
return ECORE_CALLBACK_RENEW;
/**
* Called when a font name is changed.
*/
-static void VconfNotifyFontNameChanged( keynode_t* node, void* data )
+static void VconfNotifyFontNameChanged(keynode_t* node, void* data)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
windowBase->OnFontNameChanged();
}
/**
* Called when a font size is changed.
*/
-static void VconfNotifyFontSizeChanged( keynode_t* node, void* data )
+static void VconfNotifyFontSizeChanged(keynode_t* node, void* data)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
windowBase->OnFontSizeChanged();
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
+// Window Redraw Request Event Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+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);
+ if(windowBase)
+ {
+ windowBase->OnEcoreEventWindowRedrawRequest();
+ }
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
// ElDBus Accessibility Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef DALI_ELDBUS_AVAILABLE
// Callback for Ecore ElDBus accessibility events.
-static void EcoreElDBusAccessibilityNotification( void* context, const Eldbus_Message* message )
+static void EcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( context );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(context);
+ if(windowBase)
{
- windowBase->OnEcoreElDBusAccessibilityNotification( context, message );
+ windowBase->OnEcoreElDBusAccessibilityNotification(context, message);
}
}
#endif // DALI_ELDBUS_AVAILABLE
-static void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
+static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->RegistryGlobalCallback( data, registry, name, interface, version );
+ windowBase->RegistryGlobalCallback(data, registry, name, interface, version);
}
}
-static void RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id )
+static void RegistryGlobalCallbackRemove(void* data, struct wl_registry* registry, uint32_t id)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->RegistryGlobalCallbackRemove( data, registry, id );
+ windowBase->RegistryGlobalCallbackRemove(data, registry, id);
}
}
-static void TizenPolicyConformant( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t isConformant )
+static void TizenPolicyConformant(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t isConformant)
{
}
-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 )
+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)
{
}
-static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state )
+static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->TizenPolicyNotificationChangeDone( data, tizenPolicy, surface, level, state );
+ windowBase->TizenPolicyNotificationChangeDone(data, tizenPolicy, surface, level, state);
}
}
-static void TizenPolicyTransientForDone( void* data, struct tizen_policy* tizenPolicy, uint32_t childId )
+static void TizenPolicyTransientForDone(void* data, struct tizen_policy* tizenPolicy, uint32_t childId)
{
}
-static void TizenPolicyScreenModeChangeDone( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state )
+static void TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->TizenPolicyScreenModeChangeDone( data, tizenPolicy, surface, mode, state );
+ windowBase->TizenPolicyScreenModeChangeDone(data, tizenPolicy, surface, mode, state);
}
}
-static void TizenPolicyIconifyStateChanged( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t iconified, uint32_t force )
+static void TizenPolicyIconifyStateChanged(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t iconified, uint32_t force)
{
}
-static void TizenPolicySupportedAuxiliaryHints( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, struct wl_array* hints, uint32_t numNints )
+static void TizenPolicySupportedAuxiliaryHints(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, struct wl_array* hints, uint32_t numNints)
{
}
-static void TizenPolicyAllowedAuxiliaryHint( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int id )
+static void TizenPolicyAllowedAuxiliaryHint(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int id)
{
}
-static void TizenPolicyAuxiliaryMessage( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, const char* key, const char* val, struct wl_array* options )
+static void TizenPolicyAuxiliaryMessage(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, const char* key, const char* val, struct wl_array* options)
{
}
-static void TizenPolicyConformantRegion( 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, uint32_t serial )
+static void TizenPolicyConformantRegion(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, uint32_t serial)
{
}
-static void DisplayPolicyBrightnessChangeDone( void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state )
+static void DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy* displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state)
{
- WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
- if( windowBase )
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
{
- windowBase->DisplayPolicyBrightnessChangeDone( data, displayPolicy, surface, brightness, state );
+ windowBase->DisplayPolicyBrightnessChangeDone(data, displayPolicy, surface, brightness, state);
}
}
const struct wl_registry_listener registryListener =
-{
- RegistryGlobalCallback,
- RegistryGlobalCallbackRemove
-};
+ {
+ RegistryGlobalCallback,
+ RegistryGlobalCallbackRemove};
const struct tizen_policy_listener tizenPolicyListener =
-{
- TizenPolicyConformant,
- TizenPolicyConformantArea,
- TizenPolicyNotificationChangeDone,
- TizenPolicyTransientForDone,
- TizenPolicyScreenModeChangeDone,
- TizenPolicyIconifyStateChanged,
- TizenPolicySupportedAuxiliaryHints,
- TizenPolicyAllowedAuxiliaryHint,
- TizenPolicyAuxiliaryMessage,
- TizenPolicyConformantRegion
-};
+ {
+ TizenPolicyConformant,
+ TizenPolicyConformantArea,
+ TizenPolicyNotificationChangeDone,
+ TizenPolicyTransientForDone,
+ TizenPolicyScreenModeChangeDone,
+ TizenPolicyIconifyStateChanged,
+ TizenPolicySupportedAuxiliaryHints,
+ TizenPolicyAllowedAuxiliaryHint,
+ TizenPolicyAuxiliaryMessage,
+ TizenPolicyConformantRegion};
const struct tizen_display_policy_listener tizenDisplayPolicyListener =
-{
- DisplayPolicyBrightnessChangeDone
-};
+ {
+ DisplayPolicyBrightnessChangeDone};
} // unnamed namespace
-WindowBaseEcoreWl2::WindowBaseEcoreWl2( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surface, bool isTransparent)
: mEcoreEventHandler(),
- mEcoreWindow( NULL ),
- mWlSurface( NULL ),
- mEglWindow( NULL ),
- mDisplay( NULL ),
- mEventQueue( NULL ),
- mTizenPolicy( NULL ),
- mTizenDisplayPolicy( NULL ),
- mKeyMap( NULL ),
+ mEcoreWindow(nullptr),
+ mWlSurface(nullptr),
+ mWlInputPanel(nullptr),
+ mWlOutput(nullptr),
+ mWlInputPanelSurface(nullptr),
+ mEglWindow(nullptr),
+ mDisplay(nullptr),
+ mEventQueue(nullptr),
+ mTizenPolicy(nullptr),
+ mTizenDisplayPolicy(nullptr),
+ mKeyMap(nullptr),
mSupportedAuxiliaryHints(),
+ mWindowPositionSize(positionSize),
mAuxiliaryHints(),
- mNotificationLevel( -1 ),
- mNotificationChangeState( 0 ),
- mNotificationLevelChangeDone( true ),
- mScreenOffMode( 0 ),
- mScreenOffModeChangeState( 0 ),
- mScreenOffModeChangeDone( true ),
- mBrightness( 0 ),
- mBrightnessChangeState( 0 ),
- mBrightnessChangeDone( true ),
- mVisible( true ),
- mWindowPositionSize( positionSize ),
- mOwnSurface( false ),
- mMoveResizeSerial( 0 ),
- mLastSubmittedMoveResizeSerial( 0 )
+ mType(WindowType::NORMAL),
+ mNotificationLevel(-1),
+ mScreenOffMode(0),
+ mBrightness(0),
+ mWindowRotationAngle(0),
+ mScreenRotationAngle(0),
+ mSupportedPreProtation(0),
+ mNotificationChangeState(0),
+ mScreenOffModeChangeState(0),
+ mBrightnessChangeState(0),
+ mLastSubmittedMoveResizeSerial(0),
+ mMoveResizeSerial(0),
+ mNotificationLevelChangeDone(true),
+ mScreenOffModeChangeDone(true),
+ mVisible(true),
+ mOwnSurface(false),
+ mBrightnessChangeDone(true)
#ifdef DALI_ELDBUS_AVAILABLE
- , mSystemConnection( NULL )
+ ,
+ mSystemConnection(NULL)
#endif
{
- Initialize( positionSize, surface, isTransparent );
+ Initialize(positionSize, surface, isTransparent);
}
WindowBaseEcoreWl2::~WindowBaseEcoreWl2()
{
#ifdef DALI_ELDBUS_AVAILABLE
- // Close down ElDBus connections.
- if( mSystemConnection )
- {
- eldbus_connection_unref( mSystemConnection );
- }
+ // Close down ElDBus connections.
+ if(mSystemConnection)
+ {
+ eldbus_connection_unref(mSystemConnection);
+ }
#endif // DALI_ELDBUS_AVAILABLE
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged );
+ vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged);
+ vconf_ignore_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged);
- for( Dali::Vector< Ecore_Event_Handler* >::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter )
+ for(Dali::Vector<Ecore_Event_Handler*>::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter)
{
- ecore_event_handler_del( *iter );
+ ecore_event_handler_del(*iter);
}
mEcoreEventHandler.Clear();
- if( mEventQueue )
+ if(mEventQueue)
{
- wl_event_queue_destroy( mEventQueue );
+ wl_event_queue_destroy(mEventQueue);
}
mSupportedAuxiliaryHints.clear();
mAuxiliaryHints.clear();
- if( mEglWindow != NULL )
+ if(mEglWindow != NULL)
{
- wl_egl_window_destroy( mEglWindow );
+ wl_egl_window_destroy(mEglWindow);
mEglWindow = NULL;
}
- if( mOwnSurface )
+ if(mOwnSurface)
{
- ecore_wl2_window_free( mEcoreWindow );
+ ecore_wl2_window_free(mEcoreWindow);
WindowSystem::Shutdown();
}
}
-void WindowBaseEcoreWl2::Initialize( PositionSize positionSize, Any surface, bool isTransparent )
+void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool isTransparent)
{
- if( surface.Empty() == false )
+ if(surface.Empty() == false)
{
// check we have a valid type
- DALI_ASSERT_ALWAYS( ( surface.GetType() == typeid (Ecore_Wl2_Window *) ) && "Surface type is invalid" );
+ DALI_ASSERT_ALWAYS((surface.GetType() == typeid(Ecore_Wl2_Window*)) && "Surface type is invalid");
- mEcoreWindow = AnyCast< Ecore_Wl2_Window* >( surface );
+ mEcoreWindow = AnyCast<Ecore_Wl2_Window*>(surface);
}
else
{
WindowSystem::Initialize();
mOwnSurface = true;
- CreateWindow( positionSize );
+ CreateWindow(positionSize);
}
- mWlSurface = ecore_wl2_window_surface_get( mEcoreWindow );
+ mWlSurface = ecore_wl2_window_surface_get(mEcoreWindow);
- SetTransparency( isTransparent );
+ SetTransparency(isTransparent);
- 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_WL2_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this ) );
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, 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_WL2_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this));
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this));
// Register Rotate event
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_ROTATE, EcoreEventRotate, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_ROTATE, EcoreEventRotate, this));
// Register Configure event
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_CONFIGURE, EcoreEventConfigure, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE, EcoreEventConfigure, this));
// Register Touch events
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, 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 ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, 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));
// Register Mouse wheel events
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this));
// Register Detent event
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetentRotation, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_DETENT_ROTATE, EcoreEventDetentRotation, this));
// Register Key events
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) );
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this));
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this));
// Register Selection event - clipboard selection
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this ) );
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this));
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, this));
// Register Effect Start/End event
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_EFFECT_START, EcoreEventEffectStart, this ) );
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_EFFECT_END, EcoreEventEffectEnd, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_EFFECT_START, EcoreEventEffectStart, this));
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_EFFECT_END, EcoreEventEffectEnd, this));
// Register Keyboard repeat event
- mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED, EcoreEventSeatKeyboardRepeatChanged, this ) );
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED, EcoreEventSeatKeyboardRepeatChanged, this));
+
+ // Register Window redraw request event
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_REDRAW_REQUEST, EcoreEventWindowRedrawRequest, 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 );
+ vconf_notify_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this);
+ vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this);
InitializeEcoreElDBus();
- Ecore_Wl2_Display* display = ecore_wl2_connected_display_get( NULL );
- mDisplay = ecore_wl2_display_get( display );
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ mDisplay = ecore_wl2_display_get(display);
- if( mDisplay )
+ if(mDisplay)
{
- wl_display* displayWrapper = static_cast< wl_display* >( wl_proxy_create_wrapper( mDisplay ) );
- if( displayWrapper )
+ wl_display* displayWrapper = static_cast<wl_display*>(wl_proxy_create_wrapper(mDisplay));
+ if(displayWrapper)
{
- mEventQueue = wl_display_create_queue( mDisplay );
- if( mEventQueue )
+ mEventQueue = wl_display_create_queue(mDisplay);
+ if(mEventQueue)
{
- wl_proxy_set_queue( reinterpret_cast< wl_proxy* >( displayWrapper ), mEventQueue );
+ wl_proxy_set_queue(reinterpret_cast<wl_proxy*>(displayWrapper), mEventQueue);
- wl_registry* registry = wl_display_get_registry( displayWrapper );
- wl_registry_add_listener( registry, ®istryListener, this );
+ wl_registry* registry = wl_display_get_registry(displayWrapper);
+ wl_registry_add_listener(registry, ®istryListener, this);
}
- wl_proxy_wrapper_destroy( displayWrapper );
+ wl_proxy_wrapper_destroy(displayWrapper);
}
}
- Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get( display );
+ Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get(display);
- if( ecoreWlInput )
+ if(ecoreWlInput)
{
- mKeyMap = ecore_wl2_input_keymap_get( 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_SEAT_KEYMAP_CHANGED, EcoreEventSeatKeymapChanged, this));
}
// get auxiliary hint
- Eina_List* hints = ecore_wl2_window_aux_hints_supported_get( mEcoreWindow );
- if( hints )
+ Eina_List* hints = ecore_wl2_window_aux_hints_supported_get(mEcoreWindow);
+ if(hints)
{
- Eina_List* l = NULL;
- char* hint = NULL;
+ Eina_List* l = NULL;
+ char* hint = NULL;
- for( l = hints, ( hint = static_cast< char* >( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( hint = static_cast< char* >( eina_list_data_get(l) ) ) )
+ for(l = hints, (hint = static_cast<char*>(eina_list_data_get(l))); l; l = eina_list_next(l), (hint = static_cast<char*>(eina_list_data_get(l))))
{
- mSupportedAuxiliaryHints.push_back( hint );
+ mSupportedAuxiliaryHints.push_back(hint);
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::Initialize: %s\n", hint );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::Initialize: %s\n", hint);
}
}
}
-Eina_Bool WindowBaseEcoreWl2::OnIconifyStateChanged( void* data, int type, void* event )
+Eina_Bool WindowBaseEcoreWl2::OnIconifyStateChanged(void* data, int type, void* event)
{
- 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 );
+ 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)))
{
- if( iconifyChangedEvent->iconified == EINA_TRUE )
+ if(iconifyChangedEvent->iconified == EINA_TRUE)
{
- mIconifyChangedSignal.Emit( true );
+ mIconifyChangedSignal.Emit(true);
}
else
{
- mIconifyChangedSignal.Emit( false );
+ mIconifyChangedSignal.Emit(false);
}
handled = ECORE_CALLBACK_DONE;
}
return handled;
}
-Eina_Bool WindowBaseEcoreWl2::OnFocusIn( void* data, int type, void* event )
+Eina_Bool WindowBaseEcoreWl2::OnFocusIn(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Focus_In* focusInEvent( static_cast< Ecore_Wl2_Event_Focus_In* >( event ) );
+ 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n");
- mFocusChangedSignal.Emit( true );
+ mFocusChangedSignal.Emit(true);
}
return ECORE_CALLBACK_PASS_ON;
}
-Eina_Bool WindowBaseEcoreWl2::OnFocusOut( void* data, int type, void* event )
+Eina_Bool WindowBaseEcoreWl2::OnFocusOut(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Focus_Out* focusOutEvent( static_cast< Ecore_Wl2_Event_Focus_Out* >( event ) );
+ 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n");
- mFocusChangedSignal.Emit( false );
+ mFocusChangedSignal.Emit(false);
}
return ECORE_CALLBACK_PASS_ON;
}
-Eina_Bool WindowBaseEcoreWl2::OnOutputTransform( void* data, int type, void* event )
+Eina_Bool WindowBaseEcoreWl2::OnOutputTransform(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Output_Transform* transformEvent( static_cast< Ecore_Wl2_Event_Output_Transform* >( event ) );
+ 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", mEcoreWindow );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", mEcoreWindow);
+
+ mScreenRotationAngle = GetScreenRotationAngle();
mOutputTransformedSignal.Emit();
}
return ECORE_CALLBACK_PASS_ON;
}
-Eina_Bool WindowBaseEcoreWl2::OnIgnoreOutputTransform( void* data, int type, void* event )
+Eina_Bool WindowBaseEcoreWl2::OnIgnoreOutputTransform(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Ignore_Output_Transform* ignoreTransformEvent( static_cast< Ecore_Wl2_Event_Ignore_Output_Transform* >( event ) );
+ 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow);
+
+ mScreenRotationAngle = GetScreenRotationAngle();
mOutputTransformedSignal.Emit();
}
return ECORE_CALLBACK_PASS_ON;
}
-void WindowBaseEcoreWl2::OnRotation( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnRotation(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Window_Rotation* ev( static_cast< Ecore_Wl2_Event_Window_Rotation* >( event ) );
+ 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_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h );
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h);
RotationEvent rotationEvent;
- rotationEvent.angle = ev->angle;
+ rotationEvent.angle = ev->angle;
rotationEvent.winResize = 0;
- if( ev->angle == 0 || ev->angle == 180 )
+ if(ev->w == 0 || ev->h == 0)
+ {
+ // Use previous client side window's size.
+ if(mWindowRotationAngle == 90 || mWindowRotationAngle == 270)
+ {
+ ev->w = mWindowPositionSize.height;
+ ev->h = mWindowPositionSize.width;
+ }
+ else
+ {
+ ev->w = mWindowPositionSize.width;
+ ev->h = mWindowPositionSize.height;
+ }
+ }
+
+ mWindowRotationAngle = ev->angle;
+
+ if(ev->angle == 0 || ev->angle == 180)
{
- rotationEvent.width = ev->w;
+ rotationEvent.width = ev->w;
rotationEvent.height = ev->h;
}
else
{
- rotationEvent.width = ev->h;
+ rotationEvent.width = ev->h;
rotationEvent.height = ev->w;
}
- mWindowPositionSize.width = rotationEvent.width;
+ mWindowPositionSize.width = rotationEvent.width;
mWindowPositionSize.height = rotationEvent.height;
- mRotationSignal.Emit( rotationEvent );
+ mRotationSignal.Emit(rotationEvent);
}
}
-void WindowBaseEcoreWl2::OnConfiguration( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnConfiguration(void* data, int type, void* event)
{
- Ecore_Wl2_Event_Window_Configure* ev( static_cast< Ecore_Wl2_Event_Window_Configure* >( event ) );
+ Ecore_Wl2_Event_Window_Configure* ev(static_cast<Ecore_Wl2_Event_Window_Configure*>(event));
- if( 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)))
{
// Note: To comply with the wayland protocol, Dali should make an ack_configure
// by calling ecore_wl2_window_commit
+
+ int tempWidth = static_cast<int>(ev->w);
+ int tempHeight = static_cast<int>(ev->h);
+
+ // Initialize with previous size for skip resize when new size is 0.
+ // When window is just moved or window is resized by client application,
+ // The configure notification event's size will be 0.
+ // If new size is 0, the resized work should be skip.
+ int newWidth = mWindowPositionSize.width;
+ int newHeight = mWindowPositionSize.height;
+ bool windowMoved = false, windowResized = false;
+
+ if(ev->x != mWindowPositionSize.x || ev->y != mWindowPositionSize.y)
+ {
+ windowMoved = true;
+ }
+
+ if(tempWidth != 0 && tempHeight != 0 && (tempWidth != mWindowPositionSize.width || tempHeight != mWindowPositionSize.height))
+ {
+ windowResized = true;
+ newWidth = tempWidth;
+ newHeight = tempHeight;
+ }
+
+ if(windowMoved || windowResized)
+ {
+ Dali::PositionSize newPositionSize(ev->x, ev->y, newWidth, newHeight);
+ mUpdatePositionSizeSignal.Emit(newPositionSize);
+ }
+
ecore_wl2_window_commit(mEcoreWindow, EINA_FALSE);
}
}
-void WindowBaseEcoreWl2::OnMouseButtonDown( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnMouseButtonDown(void* data, int type, void* event)
{
- Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( 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)))
{
- Device::Class::Type deviceClass;
+ Device::Class::Type deviceClass;
Device::Subclass::Type deviceSubclass;
- GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
- GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
+ GetDeviceClass(ecore_device_class_get(touchEvent->dev), deviceClass);
+ GetDeviceSubclass(ecore_device_subclass_get(touchEvent->dev), deviceSubclass);
- PointState::Type state ( PointState::DOWN );
+ PointState::Type state(PointState::DOWN);
- if( deviceClass != Device::Class::Type::MOUSE )
+ if(deviceClass != Device::Class::Type::MOUSE)
{
// Check if the buttons field is set and ensure it's the primary touch button.
// If this event was triggered by buttons other than the primary button (used for touch), then
// just send an interrupted event to Core.
- if( touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
+ if(touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID))
{
state = PointState::INTERRUPTED;
}
}
Integration::Point point;
- point.SetDeviceId( touchEvent->multi.device );
- point.SetState( state );
- 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 );
- point.SetMouseButton( static_cast< MouseButton::Type >( touchEvent->buttons) );
+ point.SetDeviceId(touchEvent->multi.device);
+ point.SetState(state);
+ 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);
+ point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
- mTouchEventSignal.Emit( point, touchEvent->timestamp );
+ mTouchEventSignal.Emit(point, touchEvent->timestamp);
}
}
-void WindowBaseEcoreWl2::OnMouseButtonUp( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnMouseButtonUp(void* data, int type, void* event)
{
- Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( 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)))
{
- Device::Class::Type deviceClass;
+ Device::Class::Type deviceClass;
Device::Subclass::Type deviceSubclass;
- GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
- GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), 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::UP );
- 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 );
- point.SetMouseButton( static_cast< MouseButton::Type >( touchEvent->buttons) );
+ point.SetDeviceId(touchEvent->multi.device);
+ point.SetState(PointState::UP);
+ 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);
+ point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
- mTouchEventSignal.Emit( point, touchEvent->timestamp );
+ mTouchEventSignal.Emit(point, touchEvent->timestamp);
}
}
-void WindowBaseEcoreWl2::OnMouseButtonMove( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnMouseButtonMove(void* data, int type, void* event)
{
- Ecore_Event_Mouse_Move* touchEvent = static_cast< Ecore_Event_Mouse_Move* >( event );
+ 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)))
{
- Device::Class::Type deviceClass;
+ Device::Class::Type deviceClass;
Device::Subclass::Type deviceSubclass;
- GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
- GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), 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::MOTION );
- 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 );
+ point.SetDeviceId(touchEvent->multi.device);
+ point.SetState(PointState::MOTION);
+ 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 );
+ mTouchEventSignal.Emit(point, touchEvent->timestamp);
}
}
-void WindowBaseEcoreWl2::OnMouseButtonCancel( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
{
- Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( 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)))
{
Integration::Point point;
- point.SetDeviceId( touchEvent->multi.device );
- point.SetState( PointState::INTERRUPTED );
- point.SetScreenPosition( Vector2( 0.0f, 0.0f ) );
+ point.SetDeviceId(touchEvent->multi.device);
+ point.SetState(PointState::INTERRUPTED);
+ point.SetScreenPosition(Vector2(0.0f, 0.0f));
- mTouchEventSignal.Emit( point, touchEvent->timestamp );
+ mTouchEventSignal.Emit(point, touchEvent->timestamp);
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
}
}
-void WindowBaseEcoreWl2::OnMouseWheel( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnMouseWheel(void* data, int type, void* event)
{
- Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast< Ecore_Event_Mouse_Wheel* >( 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z);
- Integration::WheelEvent wheelEvent( Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp );
+ Integration::WheelEvent wheelEvent(Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2(mouseWheelEvent->x, mouseWheelEvent->y), mouseWheelEvent->z, mouseWheelEvent->timestamp);
- mWheelEventSignal.Emit( wheelEvent );
+ mWheelEventSignal.Emit(wheelEvent);
}
}
-void WindowBaseEcoreWl2::OnDetentRotation( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnDetentRotation(void* data, int type, void* event)
{
- Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event );
+ Ecore_Event_Detent_Rotate* detentEvent = static_cast<Ecore_Event_Detent_Rotate*>(event);
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n");
- int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1;
+ int direction = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
int timeStamp = detentEvent->timestamp;
- Integration::WheelEvent wheelEvent( Integration::WheelEvent::CUSTOM_WHEEL, direction, 0, Vector2( 0.0f, 0.0f ), 0, timeStamp );
+ Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, direction, 0, Vector2(0.0f, 0.0f), 0, timeStamp);
- mWheelEventSignal.Emit( wheelEvent );
+ mWheelEventSignal.Emit(wheelEvent);
}
-void WindowBaseEcoreWl2::OnKeyDown( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
{
- Ecore_Event_Key* keyEvent = static_cast< Ecore_Event_Key* >( 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n");
- std::string keyName( keyEvent->keyname );
- std::string logicalKey( "" );
- std::string keyString( "" );
- std::string compose( "" );
+ std::string keyName(keyEvent->keyname);
+ std::string logicalKey("");
+ std::string keyString("");
+ std::string compose("");
// Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
- if( keyEvent->compose )
+ if(keyEvent->compose)
{
compose = keyEvent->compose;
}
// Ensure key symbol is not NULL as keys like SHIFT have a null string.
- if( keyEvent->key )
+ if(keyEvent->key)
{
logicalKey = keyEvent->key;
}
int keyCode = 0;
- GetKeyCode( keyName, keyCode ); // Get key code dynamically.
+ GetKeyCode(keyName, keyCode); // Get key code dynamically.
- if( keyCode == 0 )
+ if(keyCode == 0)
{
// Get a specific key code from dali key look up table.
- keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname );
+ keyCode = KeyLookup::GetDaliKeyCode(keyEvent->keyname);
}
- keyCode = ( keyCode == -1 ) ? 0 : keyCode;
- int modifier( keyEvent->modifiers );
+ keyCode = (keyCode == -1) ? 0 : keyCode;
+ int modifier(keyEvent->modifiers);
unsigned long time = keyEvent->timestamp;
- if( !strncmp( keyEvent->keyname, "Keycode-", 8 ) )
+ if(!strncmp(keyEvent->keyname, "Keycode-", 8))
{
- keyCode = atoi( keyEvent->keyname + 8 );
+ keyCode = atoi(keyEvent->keyname + 8);
}
// Ensure key event string is not NULL as keys like SHIFT have a null string.
- if( keyEvent->string )
+ if(keyEvent->string)
{
keyString = keyEvent->string;
}
- std::string deviceName;
- Device::Class::Type deviceClass;
+ std::string deviceName;
+ Device::Class::Type deviceClass;
Device::Subclass::Type deviceSubclass;
- GetDeviceName( keyEvent, deviceName );
- GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass );
- GetDeviceSubclass( ecore_device_subclass_get( keyEvent->dev ), deviceSubclass );
+ GetDeviceName(keyEvent, deviceName);
+ GetDeviceClass(ecore_device_class_get(keyEvent->dev), deviceClass);
+ GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
- Integration::KeyEvent keyEvent( keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass );
+ Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass);
- mKeyEventSignal.Emit( keyEvent );
+ mKeyEventSignal.Emit(keyEvent);
}
}
-void WindowBaseEcoreWl2::OnKeyUp( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
{
- Ecore_Event_Key* keyEvent = static_cast< Ecore_Event_Key* >( 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_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n");
#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.
- if( keyEvent->event_flags & ECORE_EVENT_FLAG_CANCEL )
+ if(keyEvent->event_flags & ECORE_EVENT_FLAG_CANCEL)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp: This event flag indicates the event is canceled. \n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp: This event flag indicates the event is canceled. \n");
return;
}
#endif // Since ecore 1.23 version
- std::string keyName( keyEvent->keyname );
- std::string logicalKey( "" );
- std::string keyString( "" );
- std::string compose( "" );
+ std::string keyName(keyEvent->keyname);
+ std::string logicalKey("");
+ std::string keyString("");
+ std::string compose("");
// Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
- if( keyEvent->compose )
+ if(keyEvent->compose)
{
compose = keyEvent->compose;
}
// Ensure key symbol is not NULL as keys like SHIFT have a null string.
- if( keyEvent->key )
+ if(keyEvent->key)
{
logicalKey = keyEvent->key;
}
int keyCode = 0;
- GetKeyCode( keyName, keyCode ); // Get key code dynamically.
+ GetKeyCode(keyName, keyCode); // Get key code dynamically.
- if( keyCode == 0 )
+ if(keyCode == 0)
{
// Get a specific key code from dali key look up table.
- keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname );
+ keyCode = KeyLookup::GetDaliKeyCode(keyEvent->keyname);
}
- keyCode = ( keyCode == -1 ) ? 0 : keyCode;
- int modifier( keyEvent->modifiers );
+ keyCode = (keyCode == -1) ? 0 : keyCode;
+ int modifier(keyEvent->modifiers);
unsigned long time = keyEvent->timestamp;
- if( !strncmp( keyEvent->keyname, "Keycode-", 8 ) )
+ if(!strncmp(keyEvent->keyname, "Keycode-", 8))
{
- keyCode = atoi( keyEvent->keyname + 8 );
+ keyCode = atoi(keyEvent->keyname + 8);
}
// Ensure key event string is not NULL as keys like SHIFT have a null string.
- if( keyEvent->string )
+ if(keyEvent->string)
{
keyString = keyEvent->string;
}
- std::string deviceName;
- Device::Class::Type deviceClass;
+ std::string deviceName;
+ Device::Class::Type deviceClass;
Device::Subclass::Type deviceSubclass;
- GetDeviceName( keyEvent, deviceName );
- GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass );
- GetDeviceSubclass( ecore_device_subclass_get( keyEvent->dev ), deviceSubclass );
+ GetDeviceName(keyEvent, deviceName);
+ GetDeviceClass(ecore_device_class_get(keyEvent->dev), deviceClass);
+ GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
- Integration::KeyEvent keyEvent( keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, deviceName, deviceClass, deviceSubclass );
+ Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, deviceName, deviceClass, deviceSubclass);
- mKeyEventSignal.Emit( keyEvent );
+ mKeyEventSignal.Emit(keyEvent);
}
}
-void WindowBaseEcoreWl2::OnDataSend( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnDataSend(void* data, int type, void* event)
{
- mSelectionDataSendSignal.Emit( event );
+ mSelectionDataSendSignal.Emit(event);
}
-void WindowBaseEcoreWl2::OnDataReceive( void* data, int type, void* event )
+void WindowBaseEcoreWl2::OnDataReceive(void* data, int type, void* event)
{
- mSelectionDataReceivedSignal.Emit( event );
+ mSelectionDataReceivedSignal.Emit(event);
}
void WindowBaseEcoreWl2::OnFontNameChanged()
{
- mStyleChangedSignal.Emit( StyleChange::DEFAULT_FONT_CHANGE );
+ mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_CHANGE);
}
void WindowBaseEcoreWl2::OnFontSizeChanged()
{
- mStyleChangedSignal.Emit( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
+ mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE);
}
-void WindowBaseEcoreWl2::OnEcoreElDBusAccessibilityNotification( void* context, const Eldbus_Message* message )
-{
#ifdef DALI_ELDBUS_AVAILABLE
+void WindowBaseEcoreWl2::OnEcoreElDBusAccessibilityNotification(void* context, const Eldbus_Message* message)
+{
AccessibilityInfo info;
// The string defines the arg-list's respective types.
- if( !eldbus_message_arguments_get( message, "iiiiiiu", &info.gestureValue, &info.startX, &info.startY, &info.endX, &info.endY, &info.state, &info.eventTime ) )
+ if(!eldbus_message_arguments_get(message, "iiiiiiu", &info.gestureValue, &info.startX, &info.startY, &info.endX, &info.endY, &info.state, &info.eventTime))
{
- DALI_LOG_ERROR( "OnEcoreElDBusAccessibilityNotification: Error getting arguments\n" );
+ DALI_LOG_ERROR("OnEcoreElDBusAccessibilityNotification: Error getting arguments\n");
}
- mAccessibilitySignal.Emit( info );
-#endif
+ mAccessibilitySignal.Emit(info);
}
+#endif // DALI_ELDBUS_AVAILABLE
-void WindowBaseEcoreWl2::OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type )
+void WindowBaseEcoreWl2::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type)
{
- mTransitionEffectEventSignal.Emit( state, type );
+ mTransitionEffectEventSignal.Emit(state, type);
}
void WindowBaseEcoreWl2::OnKeyboardRepeatSettingsChanged()
mKeyboardRepeatSettingsChangedSignal.Emit();
}
-void WindowBaseEcoreWl2::KeymapChanged(void *data, int type, void *event)
+void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
+{
+ mWindowRedrawRequestSignal.Emit();
+}
+
+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 );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::KeymapChanged, keymap id[ %d ]\n", changed->id );
- Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get( changed->display );
- if( ecoreWlInput )
+ Ecore_Wl2_Event_Seat_Keymap_Changed* changed = static_cast<Ecore_Wl2_Event_Seat_Keymap_Changed*>(event);
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::KeymapChanged, keymap id[ %d ]\n", changed->id);
+ Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get(changed->display);
+ if(ecoreWlInput)
{
- mKeyMap = ecore_wl2_input_keymap_get( ecoreWlInput );
+ mKeyMap = ecore_wl2_input_keymap_get(ecoreWlInput);
}
}
-void WindowBaseEcoreWl2::RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
+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 )
+ if(strcmp(interface, tizen_policy_interface.name) == 0)
{
- uint32_t clientVersion = std::min( version, MAX_TIZEN_CLIENT_VERSION );
+ uint32_t clientVersion = std::min(version, MAX_TIZEN_CLIENT_VERSION);
- mTizenPolicy = static_cast< tizen_policy* >( wl_registry_bind( registry, name, &tizen_policy_interface, clientVersion ) );
- if( !mTizenPolicy )
+ mTizenPolicy = static_cast<tizen_policy*>(wl_registry_bind(registry, name, &tizen_policy_interface, clientVersion));
+ if(!mTizenPolicy)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n");
return;
}
- tizen_policy_add_listener( mTizenPolicy, &tizenPolicyListener, data );
+ tizen_policy_add_listener(mTizenPolicy, &tizenPolicyListener, data);
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: tizen_policy_add_listener is called.\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: tizen_policy_add_listener is called.\n");
}
- else if( strcmp( interface, tizen_display_policy_interface.name ) == 0 )
+ else if(strcmp(interface, tizen_display_policy_interface.name) == 0)
{
- mTizenDisplayPolicy = static_cast< tizen_display_policy* >( wl_registry_bind( registry, name, &tizen_display_policy_interface, version ) );
- if( !mTizenDisplayPolicy )
+ mTizenDisplayPolicy = static_cast<tizen_display_policy*>(wl_registry_bind(registry, name, &tizen_display_policy_interface, version));
+ if(!mTizenDisplayPolicy)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: wl_registry_bind(tizen_display_policy_interface) is failed.\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: wl_registry_bind(tizen_display_policy_interface) is failed.\n");
return;
}
- tizen_display_policy_add_listener( mTizenDisplayPolicy, &tizenDisplayPolicyListener, data );
+ tizen_display_policy_add_listener(mTizenDisplayPolicy, &tizenDisplayPolicyListener, data);
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: tizen_display_policy_add_listener is called.\n" );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: tizen_display_policy_add_listener is called.\n");
}
}
-void WindowBaseEcoreWl2::RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id )
+void WindowBaseEcoreWl2::RegistryGlobalCallbackRemove(void* data, struct wl_registry* registry, uint32_t id)
{
- mTizenPolicy = NULL;
+ mTizenPolicy = NULL;
mTizenDisplayPolicy = NULL;
}
-void WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state )
+void WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state)
{
- mNotificationLevel = level;
- mNotificationChangeState = state;
+ mNotificationLevel = level;
+ mNotificationChangeState = state;
mNotificationLevelChangeDone = true;
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state);
}
-void WindowBaseEcoreWl2::TizenPolicyScreenModeChangeDone( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state )
+void WindowBaseEcoreWl2::TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state)
{
- mScreenOffMode = mode;
+ mScreenOffMode = mode;
mScreenOffModeChangeState = state;
- mScreenOffModeChangeDone = true;
+ mScreenOffModeChangeDone = true;
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state);
}
-void WindowBaseEcoreWl2::DisplayPolicyBrightnessChangeDone( void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state )
+void WindowBaseEcoreWl2::DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy* displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state)
{
- mBrightness = brightness;
+ mBrightness = brightness;
mBrightnessChangeState = state;
- mBrightnessChangeDone = true;
+ mBrightnessChangeDone = true;
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::DisplayPolicyBrightnessChangeDone: brightness = %d, state = %d\n", brightness, state );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::DisplayPolicyBrightnessChangeDone: brightness = %d, state = %d\n", brightness, state);
}
-void WindowBaseEcoreWl2::GetKeyCode( std::string keyName, int32_t& keyCode )
+void WindowBaseEcoreWl2::GetKeyCode(std::string keyName, int32_t& keyCode)
{
xkb_keysym_t sym = XKB_KEY_NoSymbol;
- KeyCodeMap foundKeyCode;
+ KeyCodeMap foundKeyCode;
- sym = xkb_keysym_from_name( keyName.c_str(), XKB_KEYSYM_NO_FLAGS );
- if( sym == XKB_KEY_NoSymbol )
+ sym = xkb_keysym_from_name(keyName.c_str(), XKB_KEYSYM_NO_FLAGS);
+ if(sym == XKB_KEY_NoSymbol)
{
- DALI_LOG_ERROR( "Failed to get keysym in WindowBaseEcoreWl2\n" );
+ DALI_LOG_ERROR("Failed to get keysym in WindowBaseEcoreWl2\n");
return;
}
- foundKeyCode.keySym = sym;
+ foundKeyCode.keySym = sym;
foundKeyCode.isKeyCode = false;
- xkb_keymap_key_for_each( mKeyMap, FindKeyCode, &foundKeyCode );
- keyCode = static_cast< int32_t >( foundKeyCode.keyCode );
+ xkb_keymap_key_for_each(mKeyMap, FindKeyCode, &foundKeyCode);
+ keyCode = static_cast<int32_t>(foundKeyCode.keyCode);
}
Any WindowBaseEcoreWl2::GetNativeWindow()
int WindowBaseEcoreWl2::GetNativeWindowId()
{
- return ecore_wl2_window_id_get( mEcoreWindow );
+ return ecore_wl2_window_id_get(mEcoreWindow);
}
-EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow( int width, int height )
+EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
{
- mEglWindow = wl_egl_window_create( mWlSurface, width, height );
+ int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+ if(totalAngle == 90 || totalAngle == 270)
+ {
+ mEglWindow = wl_egl_window_create(mWlSurface, height, width);
+ }
+ else
+ {
+ mEglWindow = wl_egl_window_create(mWlSurface, width, height);
+ }
- return static_cast< EGLNativeWindowType >( mEglWindow );
+ return static_cast<EGLNativeWindowType>(mEglWindow);
}
void WindowBaseEcoreWl2::DestroyEglWindow()
{
- if( mEglWindow != NULL )
+ if(mEglWindow != NULL)
{
- wl_egl_window_destroy( mEglWindow );
+ wl_egl_window_destroy(mEglWindow);
mEglWindow = NULL;
}
}
-void WindowBaseEcoreWl2::SetEglWindowRotation( int angle )
+void WindowBaseEcoreWl2::SetEglWindowRotation(int angle)
{
wl_egl_window_tizen_rotation rotation;
- switch( angle )
+ switch(angle)
{
case 0:
{
- rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0 ;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0;
break;
}
case 90:
}
default:
{
- rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0 ;
+ rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0;
break;
}
}
- wl_egl_window_tizen_set_rotation( mEglWindow, rotation );
+ wl_egl_window_tizen_set_rotation(mEglWindow, rotation);
}
-void WindowBaseEcoreWl2::SetEglWindowBufferTransform( int angle )
+void WindowBaseEcoreWl2::SetEglWindowBufferTransform(int angle)
{
wl_output_transform bufferTransform;
- switch( angle )
+ switch(angle)
{
case 0:
{
}
}
- wl_egl_window_tizen_set_buffer_transform( mEglWindow, bufferTransform );
+ wl_egl_window_tizen_set_buffer_transform(mEglWindow, bufferTransform);
}
-void WindowBaseEcoreWl2::SetEglWindowTransform( int angle )
+void WindowBaseEcoreWl2::SetEglWindowTransform(int angle)
{
wl_output_transform windowTransform;
- switch( angle )
+ switch(angle)
{
case 0:
{
}
}
- wl_egl_window_tizen_set_window_transform( mEglWindow, windowTransform );
+ wl_egl_window_tizen_set_window_transform(mEglWindow, windowTransform);
}
-void WindowBaseEcoreWl2::ResizeEglWindow( PositionSize positionSize )
+void WindowBaseEcoreWl2::ResizeEglWindow(PositionSize positionSize)
{
- wl_egl_window_resize( mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y );
+ wl_egl_window_resize(mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y);
// Note: Both "Resize" and "MoveResize" cases can reach here, but only "MoveResize" needs to submit serial number
- if( mMoveResizeSerial != mLastSubmittedMoveResizeSerial )
+ if(mMoveResizeSerial != mLastSubmittedMoveResizeSerial)
{
- wl_egl_window_tizen_set_window_serial( mEglWindow, mMoveResizeSerial );
+ wl_egl_window_tizen_set_window_serial(mEglWindow, mMoveResizeSerial);
mLastSubmittedMoveResizeSerial = mMoveResizeSerial;
}
}
bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
{
// Check capability
- wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) );
- if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED )
+ wl_egl_window_tizen_capability capability = static_cast<wl_egl_window_tizen_capability>(wl_egl_window_tizen_get_capabilities(mEglWindow));
+ if(capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED)
{
+ mSupportedPreProtation = true;
return true;
}
-
+ mSupportedPreProtation = false;
return false;
}
-void WindowBaseEcoreWl2::Move( PositionSize positionSize )
+void WindowBaseEcoreWl2::Move(PositionSize positionSize)
{
mWindowPositionSize = positionSize;
- ecore_wl2_window_position_set( mEcoreWindow, positionSize.x, positionSize.y );
+ ecore_wl2_window_position_set(mEcoreWindow, positionSize.x, positionSize.y);
}
-void WindowBaseEcoreWl2::Resize( PositionSize positionSize )
+void WindowBaseEcoreWl2::Resize(PositionSize positionSize)
{
mWindowPositionSize = positionSize;
- ecore_wl2_window_geometry_set( mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+ ecore_wl2_window_geometry_set(mEcoreWindow, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
}
-void WindowBaseEcoreWl2::MoveResize( PositionSize positionSize )
+void WindowBaseEcoreWl2::MoveResize(PositionSize positionSize)
{
mWindowPositionSize = positionSize;
- ecore_wl2_window_sync_geometry_set( mEcoreWindow, ++mMoveResizeSerial, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+ ecore_wl2_window_sync_geometry_set(mEcoreWindow, ++mMoveResizeSerial, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
}
-void WindowBaseEcoreWl2::SetClass( const std::string& name, const std::string& className )
+void WindowBaseEcoreWl2::SetClass(const std::string& name, const std::string& className)
{
- ecore_wl2_window_title_set( mEcoreWindow, name.c_str() );
- ecore_wl2_window_class_set( mEcoreWindow, className.c_str() );
+ ecore_wl2_window_title_set(mEcoreWindow, name.c_str());
+ ecore_wl2_window_class_set(mEcoreWindow, className.c_str());
}
void WindowBaseEcoreWl2::Raise()
{
// Use ecore_wl2_window_activate to prevent the window shown without rendering
- ecore_wl2_window_activate( mEcoreWindow );
+ ecore_wl2_window_activate(mEcoreWindow);
}
void WindowBaseEcoreWl2::Lower()
{
- ecore_wl2_window_lower( mEcoreWindow );
+ ecore_wl2_window_lower(mEcoreWindow);
}
void WindowBaseEcoreWl2::Activate()
{
- ecore_wl2_window_activate( mEcoreWindow );
+ ecore_wl2_window_activate(mEcoreWindow);
}
-void WindowBaseEcoreWl2::SetAvailableAnlges( const std::vector< int >& angles )
+void WindowBaseEcoreWl2::SetAvailableAnlges(const std::vector<int>& angles)
{
- int rotations[4] = { 0 };
- DALI_LOG_RELEASE_INFO( "WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size() );
- for( std::size_t i = 0; i < angles.size(); ++i )
+ int rotations[4] = {0};
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size());
+ for(std::size_t i = 0; i < angles.size(); ++i)
{
- rotations[i] = static_cast< int >( angles[i] );
- DALI_LOG_RELEASE_INFO( "%d ", rotations[i] );
+ rotations[i] = static_cast<int>(angles[i]);
+ DALI_LOG_RELEASE_INFO("%d ", rotations[i]);
}
- ecore_wl2_window_available_rotations_set( mEcoreWindow, rotations, angles.size() );
+ ecore_wl2_window_available_rotations_set(mEcoreWindow, rotations, angles.size());
}
-void WindowBaseEcoreWl2::SetPreferredAngle( int angle )
+void WindowBaseEcoreWl2::SetPreferredAngle(int angle)
{
- ecore_wl2_window_preferred_rotation_set( mEcoreWindow, angle );
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle);
+ ecore_wl2_window_preferred_rotation_set(mEcoreWindow, angle);
}
-void WindowBaseEcoreWl2::SetAcceptFocus( bool accept )
+void WindowBaseEcoreWl2::SetAcceptFocus(bool accept)
{
- ecore_wl2_window_focus_skip_set( mEcoreWindow, !accept );
+ ecore_wl2_window_focus_skip_set(mEcoreWindow, !accept);
}
void WindowBaseEcoreWl2::Show()
{
- if( !mVisible )
+ if(!mVisible)
{
- ecore_wl2_window_geometry_set( mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height );
+ // Ecore-wl2 has the original window size
+ // and he always sends the window rotation event with the swapped size.
+ // So, to restore, dali should set the reswapped size(original window size) to ecore-wl2 for restoring.
+ if(mWindowRotationAngle == 0 || mWindowRotationAngle == 180)
+ {
+ ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
+ }
+ else
+ {
+ ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.height, mWindowPositionSize.width);
+ }
}
mVisible = true;
- ecore_wl2_window_show( mEcoreWindow );
+ ecore_wl2_window_show(mEcoreWindow);
}
void WindowBaseEcoreWl2::Hide()
{
mVisible = false;
- ecore_wl2_window_hide( mEcoreWindow );
+ ecore_wl2_window_hide(mEcoreWindow);
}
unsigned int WindowBaseEcoreWl2::GetSupportedAuxiliaryHintCount() const
return mSupportedAuxiliaryHints.size();
}
-std::string WindowBaseEcoreWl2::GetSupportedAuxiliaryHint( unsigned int index ) const
+std::string WindowBaseEcoreWl2::GetSupportedAuxiliaryHint(unsigned int index) const
{
- if( index >= GetSupportedAuxiliaryHintCount() )
+ if(index >= GetSupportedAuxiliaryHintCount())
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index);
}
return mSupportedAuxiliaryHints[index];
}
-unsigned int WindowBaseEcoreWl2::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+unsigned int WindowBaseEcoreWl2::AddAuxiliaryHint(const std::string& hint, const std::string& value)
{
bool supported = false;
// Check if the hint is suppported
- for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
+ for(std::vector<std::string>::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter)
{
- if( *iter == hint )
+ if(*iter == hint)
{
supported = true;
break;
}
}
- if( !supported )
+ if(!supported)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str());
return 0;
}
// Check if the hint is already added
- for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+ for(unsigned int i = 0; i < mAuxiliaryHints.size(); i++)
{
- if( mAuxiliaryHints[i].first == hint )
+ if(mAuxiliaryHints[i].first == hint)
{
// Just change the value
mAuxiliaryHints[i].second = value;
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1);
- return i + 1; // id is index + 1
+ return i + 1; // id is index + 1
}
}
// Add the hint
- mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
+ mAuxiliaryHints.push_back(std::pair<std::string, std::string>(hint, value));
unsigned int id = mAuxiliaryHints.size();
- ecore_wl2_window_aux_hint_add( mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
+ ecore_wl2_window_aux_hint_add(mEcoreWindow, static_cast<int>(id), hint.c_str(), value.c_str());
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id);
return id;
}
-bool WindowBaseEcoreWl2::RemoveAuxiliaryHint( unsigned int id )
+bool WindowBaseEcoreWl2::RemoveAuxiliaryHint(unsigned int id)
{
- if( id == 0 || id > mAuxiliaryHints.size() )
+ if(id == 0 || id > mAuxiliaryHints.size())
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::RemoveAuxiliaryHint: Invalid id [%d]\n", id );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::RemoveAuxiliaryHint: Invalid id [%d]\n", id);
return false;
}
mAuxiliaryHints[id - 1].second = std::string();
- ecore_wl2_window_aux_hint_del( mEcoreWindow, static_cast< int >( id ) );
+ ecore_wl2_window_aux_hint_del(mEcoreWindow, static_cast<int>(id));
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str() );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str());
return true;
}
-bool WindowBaseEcoreWl2::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+bool WindowBaseEcoreWl2::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
{
- if( id == 0 || id > mAuxiliaryHints.size() )
+ if(id == 0 || id > mAuxiliaryHints.size())
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::SetAuxiliaryHintValue: Invalid id [%d]\n", id );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::SetAuxiliaryHintValue: Invalid id [%d]\n", id);
return false;
}
mAuxiliaryHints[id - 1].second = value;
- ecore_wl2_window_aux_hint_change( mEcoreWindow, static_cast< int >( id ), value.c_str() );
+ ecore_wl2_window_aux_hint_change(mEcoreWindow, static_cast<int>(id), value.c_str());
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str());
return true;
}
-std::string WindowBaseEcoreWl2::GetAuxiliaryHintValue( unsigned int id ) const
+std::string WindowBaseEcoreWl2::GetAuxiliaryHintValue(unsigned int id) const
{
- if( id == 0 || id > mAuxiliaryHints.size() )
+ if(id == 0 || id > mAuxiliaryHints.size())
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::GetAuxiliaryHintValue: Invalid id [%d]\n", id );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::GetAuxiliaryHintValue: Invalid id [%d]\n", id);
return std::string();
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str());
return mAuxiliaryHints[id - 1].second;
}
-unsigned int WindowBaseEcoreWl2::GetAuxiliaryHintId( const std::string& hint ) const
+unsigned int WindowBaseEcoreWl2::GetAuxiliaryHintId(const std::string& hint) const
{
- for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+ for(unsigned int i = 0; i < mAuxiliaryHints.size(); i++)
{
- if( mAuxiliaryHints[i].first == hint )
+ if(mAuxiliaryHints[i].first == hint)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1 );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1);
return i + 1;
}
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str() );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str());
return 0;
}
-void WindowBaseEcoreWl2::SetInputRegion( const Rect< int >& inputRegion )
+void WindowBaseEcoreWl2::SetInputRegion(const Rect<int>& inputRegion)
{
- ecore_wl2_window_input_region_set( mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
+ ecore_wl2_window_input_region_set(mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height);
}
-void WindowBaseEcoreWl2::SetType( Dali::Window::Type type )
+void WindowBaseEcoreWl2::SetType(Dali::WindowType type)
{
- Ecore_Wl2_Window_Type windowType;
-
- switch( type )
+ if(mType != type)
{
- case Dali::Window::NORMAL:
- {
- windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
- break;
- }
- case Dali::Window::NOTIFICATION:
- {
- windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
- break;
- }
- case Dali::Window::UTILITY:
- {
- windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
- break;
- }
- case Dali::Window::DIALOG:
- {
- windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
- break;
- }
- default:
+ mType = type;
+ Ecore_Wl2_Window_Type windowType;
+
+ switch(type)
{
- windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
- break;
+ case Dali::WindowType::NORMAL:
+ {
+ windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
+ break;
+ }
+ case Dali::WindowType::NOTIFICATION:
+ {
+ windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
+ break;
+ }
+ case Dali::WindowType::UTILITY:
+ {
+ windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
+ break;
+ }
+ case Dali::WindowType::DIALOG:
+ {
+ windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
+ break;
+ }
+ case Dali::WindowType::IME:
+ {
+ windowType = ECORE_WL2_WINDOW_TYPE_NONE;
+ break;
+ }
+ default:
+ {
+ windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
+ break;
+ }
}
+ ecore_wl2_window_type_set(mEcoreWindow, windowType);
}
+}
- ecore_wl2_window_type_set( mEcoreWindow, windowType );
+Dali::WindowType WindowBaseEcoreWl2::GetType() const
+{
+ return mType;
}
-bool WindowBaseEcoreWl2::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
{
- while( !mTizenPolicy )
+ while(!mTizenPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
int notificationLevel;
- switch( level )
+ switch(level)
{
- case Dali::Window::NotificationLevel::NONE:
+ case Dali::WindowNotificationLevel::NONE:
{
notificationLevel = TIZEN_POLICY_LEVEL_NONE;
break;
}
- case Dali::Window::NotificationLevel::BASE:
+ case Dali::WindowNotificationLevel::BASE:
{
notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
break;
}
- case Dali::Window::NotificationLevel::MEDIUM:
+ case Dali::WindowNotificationLevel::MEDIUM:
{
notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
break;
}
- case Dali::Window::NotificationLevel::HIGH:
+ case Dali::WindowNotificationLevel::HIGH:
{
notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
break;
}
- case Dali::Window::NotificationLevel::TOP:
+ case Dali::WindowNotificationLevel::TOP:
{
notificationLevel = TIZEN_POLICY_LEVEL_TOP;
break;
}
default:
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: invalid level [%d]\n", level );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: invalid level [%d]\n", level);
notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
break;
}
}
mNotificationLevelChangeDone = false;
- mNotificationChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
+ mNotificationChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
- tizen_policy_set_notification_level( mTizenPolicy, ecore_wl2_window_surface_get( mEcoreWindow ), notificationLevel );
+ tizen_policy_set_notification_level(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), notificationLevel);
int count = 0;
- while( !mNotificationLevelChangeDone && count < 3 )
+ while(!mNotificationLevelChangeDone && count < 3)
{
- ecore_wl2_display_flush( ecore_wl2_connected_display_get( NULL ) );
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
count++;
}
- if( !mNotificationLevelChangeDone )
+ if(!mNotificationLevelChangeDone)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState );
- return false;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
+ return Dali::WindowOperationResult::UNKNOWN_ERROR;
}
- else if( mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+ else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Permission denied! [%d]\n", level );
- return false;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Permission denied! [%d]\n", level);
+ return Dali::WindowOperationResult::PERMISSION_DENIED;
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel);
- return true;
+ return Dali::WindowOperationResult::SUCCEED;
}
-Dali::Window::NotificationLevel::Type WindowBaseEcoreWl2::GetNotificationLevel() const
+Dali::WindowNotificationLevel WindowBaseEcoreWl2::GetNotificationLevel() const
{
- while( !mTizenPolicy )
+ while(!mTizenPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
int count = 0;
- while( !mNotificationLevelChangeDone && count < 3 )
+ while(!mNotificationLevelChangeDone && count < 3)
{
- ecore_wl2_display_flush( ecore_wl2_connected_display_get( NULL ) );
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
count++;
}
- if( !mNotificationLevelChangeDone )
+ if(!mNotificationLevelChangeDone)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: Error! [%d]\n", mNotificationChangeState );
- return Dali::Window::NotificationLevel::NONE;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: Error! [%d]\n", mNotificationChangeState);
+ return Dali::WindowNotificationLevel::NONE;
}
- Dali::Window::NotificationLevel::Type level;
+ Dali::WindowNotificationLevel level;
- switch( mNotificationLevel )
+ switch(mNotificationLevel)
{
case TIZEN_POLICY_LEVEL_NONE:
{
- level = Dali::Window::NotificationLevel::NONE;
+ level = Dali::WindowNotificationLevel::NONE;
break;
}
case TIZEN_POLICY_LEVEL_DEFAULT:
{
- level = Dali::Window::NotificationLevel::BASE;
+ level = Dali::WindowNotificationLevel::BASE;
break;
}
case TIZEN_POLICY_LEVEL_MEDIUM:
{
- level = Dali::Window::NotificationLevel::MEDIUM;
+ level = Dali::WindowNotificationLevel::MEDIUM;
break;
}
case TIZEN_POLICY_LEVEL_HIGH:
{
- level = Dali::Window::NotificationLevel::HIGH;
+ level = Dali::WindowNotificationLevel::HIGH;
break;
}
case TIZEN_POLICY_LEVEL_TOP:
{
- level = Dali::Window::NotificationLevel::TOP;
+ level = Dali::WindowNotificationLevel::TOP;
break;
}
default:
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: invalid level [%d]\n", mNotificationLevel );
- level = Dali::Window::NotificationLevel::NONE;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: invalid level [%d]\n", mNotificationLevel);
+ level = Dali::WindowNotificationLevel::NONE;
break;
}
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: level [%d]\n", mNotificationLevel );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: level [%d]\n", mNotificationLevel);
return level;
}
-void WindowBaseEcoreWl2::SetOpaqueState( bool opaque )
+void WindowBaseEcoreWl2::SetOpaqueState(bool opaque)
{
- while( !mTizenPolicy )
+ while(!mTizenPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
- tizen_policy_set_opaque_state( mTizenPolicy, ecore_wl2_window_surface_get( mEcoreWindow ), ( opaque ? 1 : 0 ) );
+ tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), (opaque ? 1 : 0));
}
-bool WindowBaseEcoreWl2::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
- while( !mTizenPolicy )
+ while(!mTizenPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
- mScreenOffModeChangeDone = false;
+ mScreenOffModeChangeDone = false;
mScreenOffModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
unsigned int mode = 0;
- switch( screenOffMode )
+ switch(screenOffMode)
{
- case Dali::Window::ScreenOffMode::TIMEOUT:
+ case WindowScreenOffMode::TIMEOUT:
{
mode = 0;
break;
}
- case Dali::Window::ScreenOffMode::NEVER:
+ case WindowScreenOffMode::NEVER:
{
mode = 1;
break;
}
}
- tizen_policy_set_window_screen_mode( mTizenPolicy, ecore_wl2_window_surface_get( mEcoreWindow ), mode );
+ tizen_policy_set_window_screen_mode(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), mode);
int count = 0;
- while( !mScreenOffModeChangeDone && count < 3 )
+ while(!mScreenOffModeChangeDone && count < 3)
{
- ecore_wl2_display_flush( ecore_wl2_connected_display_get( NULL ) );
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
count++;
}
- if( !mScreenOffModeChangeDone )
+ if(!mScreenOffModeChangeDone)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState );
- return false;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState);
+ return Dali::WindowOperationResult::UNKNOWN_ERROR;
}
- else if( mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+ else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode );
- return false;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode);
+ return Dali::WindowOperationResult::PERMISSION_DENIED;
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode);
- return true;
+ return Dali::WindowOperationResult::SUCCEED;
}
-Dali::Window::ScreenOffMode::Type WindowBaseEcoreWl2::GetScreenOffMode() const
+WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const
{
- while( !mTizenPolicy )
+ while(!mTizenPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
int count = 0;
- while( !mScreenOffModeChangeDone && count < 3 )
+ while(!mScreenOffModeChangeDone && count < 3)
{
- ecore_wl2_display_flush( ecore_wl2_connected_display_get( NULL ) );
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
count++;
}
- if( !mScreenOffModeChangeDone )
+ if(!mScreenOffModeChangeDone)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: Error! [%d]\n", mScreenOffModeChangeState );
- return Dali::Window::ScreenOffMode::TIMEOUT;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: Error! [%d]\n", mScreenOffModeChangeState);
+ return WindowScreenOffMode::TIMEOUT;
}
- Dali::Window::ScreenOffMode::Type screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
+ WindowScreenOffMode screenMode = WindowScreenOffMode::TIMEOUT;
- switch( mScreenOffMode )
+ switch(mScreenOffMode)
{
case 0:
{
- screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
+ screenMode = WindowScreenOffMode::TIMEOUT;
break;
}
case 1:
{
- screenMode = Dali::Window::ScreenOffMode::NEVER;
+ screenMode = WindowScreenOffMode::NEVER;
break;
}
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: screen mode [%d]\n", mScreenOffMode );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: screen mode [%d]\n", mScreenOffMode);
return screenMode;
}
-bool WindowBaseEcoreWl2::SetBrightness( int brightness )
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetBrightness(int brightness)
{
- while( !mTizenDisplayPolicy )
+ while(!mTizenDisplayPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
- mBrightnessChangeDone = false;
+ mBrightnessChangeDone = false;
mBrightnessChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
- tizen_display_policy_set_window_brightness( mTizenDisplayPolicy, ecore_wl2_window_surface_get( mEcoreWindow ), brightness );
+ tizen_display_policy_set_window_brightness(mTizenDisplayPolicy, ecore_wl2_window_surface_get(mEcoreWindow), brightness);
int count = 0;
- while( !mBrightnessChangeDone && count < 3 )
+ while(!mBrightnessChangeDone && count < 3)
{
- ecore_wl2_display_flush( ecore_wl2_connected_display_get( NULL ) );
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
count++;
}
- if( !mBrightnessChangeDone )
+ if(!mBrightnessChangeDone)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState );
- return false;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState);
+ return Dali::WindowOperationResult::UNKNOWN_ERROR;
}
- else if( mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+ else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Permission denied! [%d]\n", brightness );
- return false;
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Permission denied! [%d]\n", brightness);
+ return Dali::WindowOperationResult::PERMISSION_DENIED;
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness is changed [%d]\n", mBrightness );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness is changed [%d]\n", mBrightness);
- return true;
+ return Dali::WindowOperationResult::SUCCEED;
}
int WindowBaseEcoreWl2::GetBrightness() const
{
- while( !mTizenDisplayPolicy )
+ while(!mTizenDisplayPolicy)
{
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
}
int count = 0;
- while( !mBrightnessChangeDone && count < 3 )
+ while(!mBrightnessChangeDone && count < 3)
{
- ecore_wl2_display_flush( ecore_wl2_connected_display_get( NULL ) );
- wl_display_dispatch_queue( mDisplay, mEventQueue );
+ ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
+ wl_display_dispatch_queue(mDisplay, mEventQueue);
count++;
}
- if( !mBrightnessChangeDone )
+ if(!mBrightnessChangeDone)
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetBrightness: Error! [%d]\n", mBrightnessChangeState );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetBrightness: Error! [%d]\n", mBrightnessChangeState);
return 0;
}
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetBrightness: Brightness [%d]\n", mBrightness );
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetBrightness: Brightness [%d]\n", mBrightness);
return mBrightness;
}
-bool WindowBaseEcoreWl2::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
+bool WindowBaseEcoreWl2::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode)
{
Ecore_Wl2_Window_Keygrab_Mode mode;
- switch( grabMode )
+ switch(grabMode)
{
case KeyGrab::TOPMOST:
{
}
}
- return ecore_wl2_window_keygrab_set( mEcoreWindow, KeyLookup::GetKeyName( key ), 0, 0, 0, mode );
+ return ecore_wl2_window_keygrab_set(mEcoreWindow, KeyLookup::GetKeyName(key), 0, 0, 0, mode);
}
-bool WindowBaseEcoreWl2::UngrabKey( Dali::KEY key )
+bool WindowBaseEcoreWl2::UngrabKey(Dali::KEY key)
{
- return ecore_wl2_window_keygrab_unset( mEcoreWindow, KeyLookup::GetKeyName( key ), 0, 0 );
+ return ecore_wl2_window_keygrab_unset(mEcoreWindow, KeyLookup::GetKeyName(key), 0, 0);
}
-bool WindowBaseEcoreWl2::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
+bool WindowBaseEcoreWl2::GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result)
{
- int keyCount = key.Count();
+ int keyCount = key.Count();
int keyGrabModeCount = grabMode.Count();
- if( keyCount != keyGrabModeCount || keyCount == 0 )
+ if(keyCount != keyGrabModeCount || keyCount == 0)
{
return false;
}
eina_init();
- Eina_List* keyList = NULL;
- Ecore_Wl2_Window_Keygrab_Info* info = new Ecore_Wl2_Window_Keygrab_Info[keyCount];
+ Eina_List* keyList = NULL;
+ Ecore_Wl2_Window_Keygrab_Info* info = new Ecore_Wl2_Window_Keygrab_Info[keyCount];
- for( int index = 0; index < keyCount; ++index )
+ for(int index = 0; index < keyCount; ++index)
{
- info[index].key = const_cast< char* >( KeyLookup::GetKeyName( key[index] ) );
+ info[index].key = const_cast<char*>(KeyLookup::GetKeyName(key[index]));
- switch( grabMode[index] )
+ switch(grabMode[index])
{
case KeyGrab::TOPMOST:
{
}
}
- keyList = eina_list_append( keyList, &info );
+ keyList = eina_list_append(keyList, &info);
}
- Eina_List* grabList = ecore_wl2_window_keygrab_list_set( mEcoreWindow, keyList );
+ Eina_List* grabList = ecore_wl2_window_keygrab_list_set(mEcoreWindow, keyList);
- result.Resize( keyCount, true );
+ result.Resize(keyCount, true);
- Eina_List* l = NULL;
- Eina_List* m = NULL;
- void* listData = NULL;
- void* data = NULL;
- if( grabList != NULL )
+ Eina_List* l = NULL;
+ Eina_List* m = NULL;
+ void* listData = NULL;
+ void* data = NULL;
+ if(grabList != NULL)
{
- EINA_LIST_FOREACH( grabList, m, data )
+ EINA_LIST_FOREACH(grabList, m, data)
{
int index = 0;
- EINA_LIST_FOREACH( keyList, l, listData )
+ EINA_LIST_FOREACH(keyList, l, listData)
{
- if( static_cast< Ecore_Wl2_Window_Keygrab_Info* >( listData )->key == NULL )
+ if(static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key == NULL)
{
- DALI_LOG_ERROR( "input key list has null data!" );
+ DALI_LOG_ERROR("input key list has null data!");
break;
}
- if( strcmp( static_cast< char* >( data ), static_cast< Ecore_Wl2_Window_Keygrab_Info* >( listData )->key ) == 0 )
+ if(strcmp(static_cast<char*>(data), static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key) == 0)
{
result[index] = false;
}
}
}
- delete [] info;
+ delete[] info;
- eina_list_free( keyList );
- eina_list_free( grabList );
+ eina_list_free(keyList);
+ eina_list_free(grabList);
eina_shutdown();
return true;
}
-bool WindowBaseEcoreWl2::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
+bool WindowBaseEcoreWl2::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result)
{
int keyCount = key.Count();
- if( keyCount == 0 )
+ if(keyCount == 0)
{
return false;
}
eina_init();
- Eina_List* keyList = NULL;
- Ecore_Wl2_Window_Keygrab_Info* info = new Ecore_Wl2_Window_Keygrab_Info[keyCount];
+ Eina_List* keyList = NULL;
+ Ecore_Wl2_Window_Keygrab_Info* info = new Ecore_Wl2_Window_Keygrab_Info[keyCount];
- for( int index = 0; index < keyCount; ++index )
+ for(int index = 0; index < keyCount; ++index)
{
- info[index].key = const_cast< char* >( KeyLookup::GetKeyName( key[index] ) );
- keyList = eina_list_append( keyList, &info );
+ info[index].key = const_cast<char*>(KeyLookup::GetKeyName(key[index]));
+ keyList = eina_list_append(keyList, &info);
}
- Eina_List* ungrabList = ecore_wl2_window_keygrab_list_unset( mEcoreWindow, keyList );
+ Eina_List* ungrabList = ecore_wl2_window_keygrab_list_unset(mEcoreWindow, keyList);
- result.Resize( keyCount, true );
+ result.Resize(keyCount, true);
- Eina_List* l = NULL;
- Eina_List* m = NULL;
- void *listData = NULL;
- void *data = NULL;
+ Eina_List* l = NULL;
+ Eina_List* m = NULL;
+ void* listData = NULL;
+ void* data = NULL;
- if( ungrabList != NULL )
+ if(ungrabList != NULL)
{
- EINA_LIST_FOREACH( ungrabList, m, data )
+ EINA_LIST_FOREACH(ungrabList, m, data)
{
int index = 0;
- EINA_LIST_FOREACH( keyList, l, listData )
+ EINA_LIST_FOREACH(keyList, l, listData)
{
- if( strcmp( static_cast< char* >( data ), static_cast< Ecore_Wl2_Window_Keygrab_Info* >( listData )->key ) == 0 )
+ if(strcmp(static_cast<char*>(data), static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key) == 0)
{
result[index] = false;
}
}
}
- delete [] info;
+ delete[] info;
- eina_list_free( keyList );
- eina_list_free( ungrabList );
+ eina_list_free(keyList);
+ eina_list_free(ungrabList);
eina_shutdown();
return true;
}
-void WindowBaseEcoreWl2::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+void WindowBaseEcoreWl2::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
{
// calculate DPI
float xres, yres;
- Ecore_Wl2_Output* output = ecore_wl2_window_output_find( mEcoreWindow );
+ Ecore_Wl2_Output* output = ecore_wl2_window_output_find(mEcoreWindow);
// 1 inch = 25.4 millimeters
- xres = ecore_wl2_output_dpi_get( output );
- yres = ecore_wl2_output_dpi_get( output );
+ xres = ecore_wl2_output_dpi_get(output);
+ yres = ecore_wl2_output_dpi_get(output);
- dpiHorizontal = int( xres + 0.5f ); // rounding
- dpiVertical = int( yres + 0.5f );
+ dpiHorizontal = int(xres + 0.5f); // rounding
+ dpiVertical = int(yres + 0.5f);
+}
+
+int WindowBaseEcoreWl2::GetOrientation() const
+{
+ int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
+ if(mSupportedPreProtation)
+ {
+ orientation = 0;
+ }
+ return orientation;
}
int WindowBaseEcoreWl2::GetScreenRotationAngle()
{
int transform = 0;
- if( ecore_wl2_window_ignore_output_transform_get( mEcoreWindow ) )
+ if(ecore_wl2_window_ignore_output_transform_get(mEcoreWindow))
{
transform = 0;
}
else
{
- transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) );
+ transform = ecore_wl2_output_transform_get(ecore_wl2_window_output_find(mEcoreWindow));
}
-
- return transform * 90;
+ mScreenRotationAngle = transform * 90;
+ return mScreenRotationAngle;
}
-void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree )
+void WindowBaseEcoreWl2::SetWindowRotationAngle(int degree)
{
- ecore_wl2_window_rotation_set( mEcoreWindow, degree );
+ mWindowRotationAngle = degree;
+ ecore_wl2_window_rotation_set(mEcoreWindow, degree);
}
-void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height )
+void WindowBaseEcoreWl2::WindowRotationCompleted(int degree, int width, int height)
{
- ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height );
+ ecore_wl2_window_rotation_change_done_send(mEcoreWindow, degree, width, height);
}
-void WindowBaseEcoreWl2::SetTransparency( bool transparent )
+void WindowBaseEcoreWl2::SetTransparency(bool transparent)
{
- ecore_wl2_window_alpha_set( mEcoreWindow, transparent );
+ ecore_wl2_window_alpha_set(mEcoreWindow, transparent);
}
void WindowBaseEcoreWl2::InitializeEcoreElDBus()
{
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Object* object;
- Eldbus_Proxy* manager;
+ Eldbus_Proxy* manager;
- if( !( mSystemConnection = eldbus_connection_get( ELDBUS_CONNECTION_TYPE_SYSTEM ) ) )
+ if(!(mSystemConnection = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM)))
{
- DALI_LOG_ERROR( "Unable to get system bus\n" );
+ DALI_LOG_ERROR("Unable to get system bus\n");
}
- object = eldbus_object_get( mSystemConnection, BUS, PATH );
- if( !object )
+ object = eldbus_object_get(mSystemConnection, BUS, PATH);
+ if(!object)
{
- DALI_LOG_ERROR( "Getting object failed\n" );
+ DALI_LOG_ERROR("Getting object failed\n");
return;
}
- manager = eldbus_proxy_get( object, INTERFACE );
- if( !manager )
+ manager = eldbus_proxy_get(object, INTERFACE);
+ if(!manager)
{
- DALI_LOG_ERROR( "Getting proxy failed\n" );
+ DALI_LOG_ERROR("Getting proxy failed\n");
return;
}
- if( !eldbus_proxy_signal_handler_add( manager, "GestureDetected", EcoreElDBusAccessibilityNotification, this ) )
+ if(!eldbus_proxy_signal_handler_add(manager, "GestureDetected", EcoreElDBusAccessibilityNotification, this))
{
- DALI_LOG_ERROR( "No signal handler returned\n" );
+ DALI_LOG_ERROR("No signal handler returned\n");
}
#endif
}
-void WindowBaseEcoreWl2::CreateWindow( PositionSize positionSize )
+void WindowBaseEcoreWl2::CreateWindow(PositionSize positionSize)
{
- Ecore_Wl2_Display* display = ecore_wl2_display_connect( NULL );
- if( !display )
+ Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL);
+ if(!display)
{
- DALI_ASSERT_ALWAYS( 0 && "Failed to get display" );
+ DALI_ASSERT_ALWAYS(0 && "Failed to get display");
}
- ecore_wl2_display_sync( display );
+ ecore_wl2_display_sync(display);
- mEcoreWindow = ecore_wl2_window_new( display, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+ mEcoreWindow = ecore_wl2_window_new(display, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
- if ( mEcoreWindow == 0 )
+ if(mEcoreWindow == 0)
{
- DALI_ASSERT_ALWAYS( 0 && "Failed to create Wayland window" );
+ DALI_ASSERT_ALWAYS(0 && "Failed to create Wayland window");
}
// Set default type
- ecore_wl2_window_type_set( mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL );
+ ecore_wl2_window_type_set(mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL);
}
-void WindowBaseEcoreWl2::SetParent( WindowBase* parentWinBase )
+void WindowBaseEcoreWl2::SetParent(WindowBase* parentWinBase, bool belowParent)
{
Ecore_Wl2_Window* ecoreParent = NULL;
- if( parentWinBase )
+ if(parentWinBase)
{
- WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>( parentWinBase );
- ecoreParent = winBaseEcore2->mEcoreWindow;
+ WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>(parentWinBase);
+ ecoreParent = winBaseEcore2->mEcoreWindow;
}
- ecore_wl2_window_parent_set( mEcoreWindow, ecoreParent );
+ ecore_wl2_window_transient_parent_set(mEcoreWindow, ecoreParent, belowParent);
}
int WindowBaseEcoreWl2::CreateFrameRenderedSyncFence()
{
- return wl_egl_window_tizen_create_commit_sync_fd( mEglWindow );
+ return wl_egl_window_tizen_create_commit_sync_fd(mEglWindow);
}
int WindowBaseEcoreWl2::CreateFramePresentedSyncFence()
{
- return wl_egl_window_tizen_create_presentation_sync_fd( mEglWindow );
+ return wl_egl_window_tizen_create_presentation_sync_fd(mEglWindow);
+}
+
+void WindowBaseEcoreWl2::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
+{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetPositionSizeWithAngle, angle: %d, x: %d, y: %d, w: %d, h: %d\n", angle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
+ ecore_wl2_window_rotation_geometry_set(mEcoreWindow, angle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
+}
+
+void WindowBaseEcoreWl2::InitializeIme()
+{
+ Eina_Iterator* globals;
+ struct wl_registry* registry;
+ Ecore_Wl2_Global* global;
+ Ecore_Wl2_Display* ecoreWl2Display;
+
+ 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);
+
+ if(!(registry = ecore_wl2_display_registry_get(ecoreWl2Display)))
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 display registry\n");
+ return;
+ }
+
+ if(!(globals = ecore_wl2_display_globals_get(ecoreWl2Display)))
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 globals\n");
+ return;
+ }
+
+ EINA_ITERATOR_FOREACH(globals, global)
+ {
+ if(strcmp(global->interface, "wl_input_panel") == 0)
+ {
+ mWlInputPanel = (wl_input_panel*)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
+ }
+ else if(strcmp(global->interface, "wl_output") == 0)
+ {
+ mWlOutput = (wl_output*)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
+ }
+ }
+
+ if(!mWlInputPanel)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel interface\n");
+ return;
+ }
+
+ if(!mWlOutput)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland output panel interface\n");
+ return;
+ }
+
+ mWlInputPanelSurface = wl_input_panel_get_input_panel_surface(mWlInputPanel, mWlSurface);
+ if(!mWlInputPanelSurface)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel surface\n");
+ return;
+ }
+
+ wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+}
+
+void WindowBaseEcoreWl2::ImeWindowReadyToRender()
+{
+ if(!mWlInputPanelSurface)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::ImeWindowReadyToRender(), wayland input panel surface is null\n");
+ return;
+ }
+
+ wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
+}
+
+void WindowBaseEcoreWl2::RequestMoveToServer()
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ if(!display)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get ecore_wl2_display\n");
+ return;
+ }
+
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ if(!input)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get default Ecore_Wl2_Input\n");
+ return;
+ }
+
+ ecore_wl2_window_move(mEcoreWindow, input);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestMoveToServer, starts the window[%p] is moved by server\n", mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::RequestResizeToServer(WindowResizeDirection direction)
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ if(!display)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get ecore_wl2_display\n");
+ return;
+ }
+
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ if(!input)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get default Ecore_Wl2_Input\n");
+ return;
+ }
+
+ int location = 0;
+ switch(direction)
+ {
+ case WindowResizeDirection::TOP_LEFT:
+ {
+ location = 5;
+ break;
+ }
+ case WindowResizeDirection::TOP:
+ {
+ location = 1;
+ break;
+ }
+ case WindowResizeDirection::TOP_RIGHT:
+ {
+ location = 9;
+ break;
+ }
+ case WindowResizeDirection::LEFT:
+ {
+ location = 4;
+ break;
+ }
+ case WindowResizeDirection::RIGHT:
+ {
+ location = 8;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM_LEFT:
+ {
+ location = 6;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM:
+ {
+ location = 2;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM_RIGHT:
+ {
+ location = 10;
+ break;
+ }
+ default:
+ {
+ location = 0;
+ break;
+ }
+ }
+
+ ecore_wl2_window_resize(mEcoreWindow, input, location);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestResizeToServer, starts the window[%p] is resized by server, mode:%d\n", mEcoreWindow, location);
+}
+
+void WindowBaseEcoreWl2::EnableFloatingMode(bool enable)
+{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::EnableFloatingMode, floating mode flag: [%p], enable [%d]\n", mEcoreWindow, enable);
+ if(enable == true)
+ {
+ ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_TRUE);
+ }
+ else
+ {
+ ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_FALSE);
+ }
+}
+
+bool WindowBaseEcoreWl2::IsFloatingModeEnabled() const
+{
+ 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