return textureSet;
}
-PropertyBuffer CreatePropertyBuffer()
+VertexBuffer CreateVertexBuffer()
{
Property::Map texturedQuadVertexFormat;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer vertexData = PropertyBuffer::New( texturedQuadVertexFormat );
+ VertexBuffer vertexData = VertexBuffer::New( texturedQuadVertexFormat );
return vertexData;
}
Geometry CreateQuadGeometry(void)
{
- PropertyBuffer vertexData = CreatePropertyBuffer();
+ VertexBuffer vertexData = CreateVertexBuffer();
const float halfQuadSize = .5f;
struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
TexturedQuadVertex texturedQuadVertexData[4] = {
TextureSet CreateTextureSet();
TextureSet CreateTextureSet( Texture texture );
Geometry CreateQuadGeometry();
-PropertyBuffer CreatePropertyBuffer();
+VertexBuffer CreateVertexBuffer();
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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 <stdlib.h>
#include <iostream>
#include <dali.h>
+#include <dali/devel-api/events/key-event-devel.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
// Generate a KeyPressEvent to send to Core
Dali::KeyEvent GenerateKeyPress( const std::string& keyName )
{
- KeyEvent keyPress;
- keyPress.keyPressedName = keyName;
+ Dali::KeyEvent keyPress = DevelKeyEvent::New(keyName, "", "", -1, 0, 0lu, Dali::KeyEvent::Down, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
return keyPress;
}
{
class WheelEvent;
-struct KeyEvent;
+class KeyEvent;
struct TouchPoint;
namespace EventFeeder
namespace Dali
{
-struct KeyEvent;
+class KeyEvent;
class TouchEvent;
class WheelEvent;
class RenderTaskList;
class Layer;
class WheelEvent;
struct TouchPoint;
-struct KeyEvent;
+class KeyEvent;
namespace Integration
{
void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
{
- Integration::KeyEvent convertedEvent( keyEvent );
- GetImplementation(*this).FeedKeyEvent( convertedEvent );
+ Integration::KeyEvent event( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
+ GetImplementation(*this).FeedKeyEvent( event );
}
SceneHolder SceneHolder::Get( Actor actor )
class TouchEvent;
class WheelEvent;
struct TouchPoint;
-struct KeyEvent;
+class KeyEvent;
namespace Internal DALI_INTERNAL
{
#include <dali/integration-api/adaptor-framework/android/android-framework.h>
#include <dali/public-api/events/touch-point.h>
#include <dali/public-api/events/key-event.h>
+#include <dali/devel-api/events/key-event-devel.h>
// INTERNAL INCLUDES
#include <dali/internal/system/common/callback-manager.h>
int32_t action = AKeyEvent_getAction( event );
int64_t timeStamp = AKeyEvent_getEventTime( event );
- KeyEvent::State state = KeyEvent::Down;
+ Dali::KeyEvent::State state = Dali::KeyEvent::Down;
switch ( action )
{
case AKEY_EVENT_ACTION_DOWN:
break;
case AKEY_EVENT_ACTION_UP:
- state = KeyEvent::Up;
+ state = Dali::KeyEvent::Up;
break;
}
default:
break;
}
- Dali::KeyEvent keyEvent( keyName, "", keyCode, 0, timeStamp, state );
+ Dali::KeyEvent keyEvent = Dali::DevelKeyEvent::New( keyName, "", "", keyCode, 0, timeStamp, state, "", "", Device::Class::NONE, Device::Subclass::NONE );
Dali::Internal::Adaptor::Framework::Impl::NativeAppKeyEvent( framework, keyEvent );
return 1;
}
mWindows.front()->FeedWheelEvent( event );
}
-void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
+void Adaptor::FeedKeyEvent( Dali::KeyEvent& keyEvent )
{
- Integration::KeyEvent convertedEvent( keyEvent );
+ Integration::KeyEvent convertedEvent( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
mWindows.front()->FeedKeyEvent( convertedEvent );
}
/**
* @copydoc Dali::EventFeeder::FeedKeyEvent()
*/
- virtual void FeedKeyEvent( KeyEvent& keyEvent );
+ virtual void FeedKeyEvent( Dali::KeyEvent& keyEvent );
/**
* @copydoc Dali::Adaptor::ReplaceSurface()
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
bool IsKey( const Dali::KeyEvent& keyEvent, Dali::KEY daliKey)
{
- int key = globalKeyLookup.GetDaliKeyEnum( keyEvent.keyPressedName.c_str() );
+ int key = globalKeyLookup.GetDaliKeyEnum( keyEvent.GetKeyName().c_str() );
return daliKey == key;
}
bool eventHandled( false );
// If a device key then skip ecore_imf_context_filter_event.
- if ( ! KeyLookup::IsDeviceButton( keyEvent.keyPressedName.c_str() ))
+ if ( ! KeyLookup::IsDeviceButton( keyEvent.GetKeyName().c_str() ))
{
//check whether it's key down or key up event
- if ( keyEvent.state == KeyEvent::Down )
+ if ( keyEvent.GetState() == Dali::KeyEvent::Down )
{
eventHandled = ProcessEventKeyDown( keyEvent );
}
- else if ( keyEvent.state == KeyEvent::Up )
+ else if ( keyEvent.GetState() == Dali::KeyEvent::Up )
{
eventHandled = ProcessEventKeyUp( keyEvent );
}
attrs = mPreeditAttrs;
}
-bool InputMethodContextEcoreWl::ProcessEventKeyDown( const KeyEvent& keyEvent )
+bool InputMethodContextEcoreWl::ProcessEventKeyDown( const Dali::KeyEvent& keyEvent )
{
bool eventHandled( false );
if ( mIMFContext )
{
- Integration::KeyEvent integKeyEvent( keyEvent );
+ Integration::KeyEvent integKeyEvent( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
std::string key = integKeyEvent.logicalKey;
- std::string compose = keyEvent.GetCompose();
- std::string deviceName = keyEvent.GetDeviceName();
+ std::string compose = integKeyEvent.compose;
+ std::string deviceName = integKeyEvent.deviceName;
// We're consuming key down event so we have to pass to InputMethodContext so that it can parse it as well.
Ecore_IMF_Event_Key_Down ecoreKeyDownEvent;
- ecoreKeyDownEvent.keyname = keyEvent.keyPressedName.c_str();
+ ecoreKeyDownEvent.keyname = integKeyEvent.keyName.c_str();
ecoreKeyDownEvent.key = key.c_str();
- ecoreKeyDownEvent.string = keyEvent.keyPressed.c_str();
+ ecoreKeyDownEvent.string = integKeyEvent.keyString.c_str();
ecoreKeyDownEvent.compose = compose.c_str();
- ecoreKeyDownEvent.timestamp = keyEvent.time;
- ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( keyEvent.keyModifier );
- ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent.keyModifier );
+ ecoreKeyDownEvent.timestamp = integKeyEvent.time;
+ ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( integKeyEvent.keyModifier );
+ ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( integKeyEvent.keyModifier );
ecoreKeyDownEvent.dev_name = deviceName.c_str();
- ecoreKeyDownEvent.dev_class = static_cast<Ecore_IMF_Device_Class> ( keyEvent.GetDeviceClass() );//ECORE_IMF_DEVICE_CLASS_KEYBOARD;
- ecoreKeyDownEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass> ( keyEvent.GetDeviceSubclass() );//ECORE_IMF_DEVICE_SUBCLASS_NONE;
+ ecoreKeyDownEvent.dev_class = static_cast<Ecore_IMF_Device_Class> ( integKeyEvent.deviceClass );//ECORE_IMF_DEVICE_CLASS_KEYBOARD;
+ ecoreKeyDownEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass> ( integKeyEvent.deviceSubclass );//ECORE_IMF_DEVICE_SUBCLASS_NONE;
#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 22)
- ecoreKeyDownEvent.keycode = keyEvent.keyCode; // Ecore_IMF_Event structure has added 'keycode' variable since ecore_imf 1.22 version.
+ ecoreKeyDownEvent.keycode = integKeyEvent.keyCode; // Ecore_IMF_Event structure has added 'keycode' variable since ecore_imf 1.22 version.
#endif // Since ecore_imf 1.22 version
// If the device is IME and the focused key is the direction keys, then we should send a key event to move a key cursor.
- if ((keyEvent.GetDeviceName() == "ime") && ((!strncmp(keyEvent.keyPressedName.c_str(), "Left", 4)) ||
- (!strncmp(keyEvent.keyPressedName.c_str(), "Right", 5)) ||
- (!strncmp(keyEvent.keyPressedName.c_str(), "Up", 2)) ||
- (!strncmp(keyEvent.keyPressedName.c_str(), "Down", 4))))
+ if ((integKeyEvent.deviceName == "ime") && ((!strncmp(integKeyEvent.keyName.c_str(), "Left", 4)) ||
+ (!strncmp(integKeyEvent.keyName.c_str(), "Right", 5)) ||
+ (!strncmp(integKeyEvent.keyName.c_str(), "Up", 2)) ||
+ (!strncmp(integKeyEvent.keyName.c_str(), "Down", 4))))
{
eventHandled = 0;
}
// If the event has not been handled by InputMethodContext then check if we should reset our input method context
if (!eventHandled)
{
- if (!strcmp(keyEvent.keyPressedName.c_str(), "Escape") ||
- !strcmp(keyEvent.keyPressedName.c_str(), "Return") ||
- !strcmp(keyEvent.keyPressedName.c_str(), "KP_Enter"))
+ if (!strcmp(integKeyEvent.keyName.c_str(), "Escape") ||
+ !strcmp(integKeyEvent.keyName.c_str(), "Return") ||
+ !strcmp(integKeyEvent.keyName.c_str(), "KP_Enter"))
{
ecore_imf_context_reset(mIMFContext);
}
return eventHandled;
}
-bool InputMethodContextEcoreWl::ProcessEventKeyUp( const KeyEvent& keyEvent )
+bool InputMethodContextEcoreWl::ProcessEventKeyUp( const Dali::KeyEvent& keyEvent )
{
bool eventHandled( false );
if( mIMFContext )
{
- Integration::KeyEvent integKeyEvent( keyEvent );
+ Integration::KeyEvent integKeyEvent( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
std::string key = integKeyEvent.logicalKey;
- std::string compose = keyEvent.GetCompose();
- std::string deviceName = keyEvent.GetDeviceName();
+ std::string compose = integKeyEvent.compose;
+ std::string deviceName = integKeyEvent.deviceName;
// We're consuming key up event so we have to pass to InputMethodContext so that it can parse it as well.
Ecore_IMF_Event_Key_Up ecoreKeyUpEvent;
- ecoreKeyUpEvent.keyname = keyEvent.keyPressedName.c_str();
+ ecoreKeyUpEvent.keyname = integKeyEvent.keyName.c_str();
ecoreKeyUpEvent.key = key.c_str();
- ecoreKeyUpEvent.string = keyEvent.keyPressed.c_str();
+ ecoreKeyUpEvent.string = integKeyEvent.keyString.c_str();
ecoreKeyUpEvent.compose = compose.c_str();
- ecoreKeyUpEvent.timestamp = keyEvent.time;
- ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( keyEvent.keyModifier );
- ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent.keyModifier );
+ ecoreKeyUpEvent.timestamp = integKeyEvent.time;
+ ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( integKeyEvent.keyModifier );
+ ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( integKeyEvent.keyModifier );
ecoreKeyUpEvent.dev_name = deviceName.c_str();
- ecoreKeyUpEvent.dev_class = static_cast<Ecore_IMF_Device_Class> ( keyEvent.GetDeviceClass() );//ECORE_IMF_DEVICE_CLASS_KEYBOARD;
- ecoreKeyUpEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass> ( keyEvent.GetDeviceSubclass() );//ECORE_IMF_DEVICE_SUBCLASS_NONE;
+ ecoreKeyUpEvent.dev_class = static_cast<Ecore_IMF_Device_Class> ( integKeyEvent.deviceClass );//ECORE_IMF_DEVICE_CLASS_KEYBOARD;
+ ecoreKeyUpEvent.dev_subclass = static_cast<Ecore_IMF_Device_Subclass> ( integKeyEvent.deviceSubclass );//ECORE_IMF_DEVICE_SUBCLASS_NONE;
#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 22)
- ecoreKeyUpEvent.keycode = keyEvent.keyCode; // Ecore_IMF_Event structure has added 'keycode' variable since ecore_imf 1.22 version.
+ ecoreKeyUpEvent.keycode = integKeyEvent.keyCode; // Ecore_IMF_Event structure has added 'keycode' variable since ecore_imf 1.22 version.
#endif // Since ecore_imf 1.22 version
eventHandled = ecore_imf_context_filter_event(mIMFContext,
* @param[in] keyEvent The event key to be handled.
* @return Whether the event key is handled.
*/
- bool ProcessEventKeyDown( const KeyEvent& keyEvent );
+ bool ProcessEventKeyDown( const Dali::KeyEvent& keyEvent );
/**
* @brief Process event key up, whether filter a key to isf.
* @param[in] keyEvent The event key to be handled.
* @return Whether the event key is handled.
*/
- bool ProcessEventKeyUp( const KeyEvent& keyEvent );
+ bool ProcessEventKeyUp( const Dali::KeyEvent& keyEvent );
/**
* Ecore_Event_Modifier enums in Ecore_Input.h do not match Ecore_IMF_Keyboard_Modifiers in Ecore_IMF.h.
bool eventHandled( false );
// If a device key then skip ecore_imf_context_filter_event.
- if ( ! KeyLookup::IsDeviceButton( keyEvent.keyPressedName.c_str() ))
+ if ( ! KeyLookup::IsDeviceButton( keyEvent.GetKeyName().c_str() ))
{
//check whether it's key down or key up event
- if ( keyEvent.state == KeyEvent::Down )
+ if ( keyEvent.GetState() == Dali::KeyEvent::Down )
{
eventHandled = ProcessEventKeyDown( keyEvent );
}
- else if ( keyEvent.state == KeyEvent::Up )
+ else if ( keyEvent.GetState() == Dali::KeyEvent::Up )
{
eventHandled = ProcessEventKeyUp( keyEvent );
}
attrs = mPreeditAttrs;
}
-bool InputMethodContextX::ProcessEventKeyDown( const KeyEvent& keyEvent )
+bool InputMethodContextX::ProcessEventKeyDown( const Dali::KeyEvent& keyEvent )
{
bool eventHandled( false );
if ( mIMFContext )
{
- Integration::KeyEvent integKeyEvent( keyEvent );
+ Integration::KeyEvent integKeyEvent( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
std::string key = integKeyEvent.logicalKey;
- std::string compose = keyEvent.GetCompose();
+ std::string compose = integKeyEvent.compose;
// We're consuming key down event so we have to pass to InputMethodContext so that it can parse it as well.
Ecore_IMF_Event_Key_Down ecoreKeyDownEvent;
- ecoreKeyDownEvent.keyname = keyEvent.keyPressedName.c_str();
+ ecoreKeyDownEvent.keyname = integKeyEvent.keyName.c_str();
ecoreKeyDownEvent.key = key.c_str();
- ecoreKeyDownEvent.string = keyEvent.keyPressed.c_str();
+ ecoreKeyDownEvent.string = integKeyEvent.keyString.c_str();
ecoreKeyDownEvent.compose = compose.c_str();
- ecoreKeyDownEvent.timestamp = keyEvent.time;
- ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( keyEvent.keyModifier );
- ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent.keyModifier );
+ ecoreKeyDownEvent.timestamp = integKeyEvent.time;
+ ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( integKeyEvent.keyModifier );
+ ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( integKeyEvent.keyModifier );
#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR)
#if (ECORE_VERSION_MINOR >= 14)
ecoreKeyDownEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
#endif // Since ecore_imf 1.14 version
#if (ECORE_VERSION_MINOR >= 22)
- ecoreKeyDownEvent.keycode = keyEvent.keyCode;
+ ecoreKeyDownEvent.keycode = integKeyEvent.keyCode;
#endif // Since ecore_imf 1.22 version
#endif // Since ecore_imf Version 1
// If the device is IME and the focused key is the direction keys, then we should send a key event to move a key cursor.
- if ((keyEvent.GetDeviceName() == "ime") && ((!strncmp(keyEvent.keyPressedName.c_str(), "Left", 4)) ||
- (!strncmp(keyEvent.keyPressedName.c_str(), "Right", 5)) ||
- (!strncmp(keyEvent.keyPressedName.c_str(), "Up", 2)) ||
- (!strncmp(keyEvent.keyPressedName.c_str(), "Down", 4))))
+ if ((integKeyEvent.deviceName == "ime") && ((!strncmp(integKeyEvent.keyName.c_str(), "Left", 4)) ||
+ (!strncmp(integKeyEvent.keyName.c_str(), "Right", 5)) ||
+ (!strncmp(integKeyEvent.keyName.c_str(), "Up", 2)) ||
+ (!strncmp(integKeyEvent.keyName.c_str(), "Down", 4))))
{
eventHandled = 0;
}
// If the event has not been handled by InputMethodContext then check if we should reset our IMFcontext
if (!eventHandled)
{
- if (!strcmp(keyEvent.keyPressedName.c_str(), "Escape") ||
- !strcmp(keyEvent.keyPressedName.c_str(), "Return") ||
- !strcmp(keyEvent.keyPressedName.c_str(), "KP_Enter"))
+ if (!strcmp(integKeyEvent.keyName.c_str(), "Escape") ||
+ !strcmp(integKeyEvent.keyName.c_str(), "Return") ||
+ !strcmp(integKeyEvent.keyName.c_str(), "KP_Enter"))
{
ecore_imf_context_reset(mIMFContext);
}
return eventHandled;
}
-bool InputMethodContextX::ProcessEventKeyUp( const KeyEvent& keyEvent )
+bool InputMethodContextX::ProcessEventKeyUp( const Dali::KeyEvent& keyEvent )
{
bool eventHandled( false );
if( mIMFContext )
{
- Integration::KeyEvent integKeyEvent( keyEvent );
+ Integration::KeyEvent integKeyEvent( keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast< Integration::KeyEvent::State >( keyEvent.GetState() ), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass() );
+
std::string key = integKeyEvent.logicalKey;
- std::string compose = keyEvent.GetCompose();
+ std::string compose = integKeyEvent.compose;
// We're consuming key up event so we have to pass to InputMethodContext so that it can parse it as well.
Ecore_IMF_Event_Key_Up ecoreKeyUpEvent;
- ecoreKeyUpEvent.keyname = keyEvent.keyPressedName.c_str();
+ ecoreKeyUpEvent.keyname = integKeyEvent.keyName.c_str();
ecoreKeyUpEvent.key = key.c_str();
- ecoreKeyUpEvent.string = keyEvent.keyPressed.c_str();
+ ecoreKeyUpEvent.string = integKeyEvent.keyString.c_str();
ecoreKeyUpEvent.compose = compose.c_str();
- ecoreKeyUpEvent.timestamp = keyEvent.time;
- ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( keyEvent.keyModifier );
- ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent.keyModifier );
+ ecoreKeyUpEvent.timestamp = integKeyEvent.time;
+ ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( integKeyEvent.keyModifier );
+ ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( integKeyEvent.keyModifier );
#if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR)
#if (ECORE_VERSION_MINOR >= 14)
ecoreKeyUpEvent.dev_name = "";
#endif // Since ecore_imf 1.14 version
#if (ECORE_VERSION_MINOR >= 22)
- ecoreKeyUpEvent.keycode = keyEvent.keyCode;
+ ecoreKeyUpEvent.keycode = integKeyEvent.keyCode;
#endif // Since ecore_imf 1.22 version
#endif // Since ecore_imf Version 1
#define DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @param[in] keyEvent The event key to be handled.
* @return Whether the event key is handled.
*/
- bool ProcessEventKeyDown( const KeyEvent& keyEvent );
+ bool ProcessEventKeyDown( const Dali::KeyEvent& keyEvent );
/**
* @brief Process event key up, whether filter a key to isf.
* @param[in] keyEvent The event key to be handled.
* @return Whether the event key is handled.
*/
- bool ProcessEventKeyUp( const KeyEvent& keyEvent );
+ bool ProcessEventKeyUp( const Dali::KeyEvent& keyEvent );
/**
* Ecore_Event_Modifier enums in Ecore_Input.h do not match Ecore_IMF_Keyboard_Modifiers in Ecore_IMF.h.
{\r
bool eventHandled( false );\r
\r
- if ( ! KeyLookup::IsDeviceButton( keyEvent.keyPressedName.c_str() ))\r
+ if ( ! KeyLookup::IsDeviceButton( keyEvent.GetKeyName().c_str() ))\r
{\r
//check whether it's key down or key up event\r
- if ( keyEvent.state == KeyEvent::Down )\r
+ if ( keyEvent.GetState() == Dali::KeyEvent::Down )\r
{\r
eventHandled = ProcessEventKeyDown( keyEvent );\r
}\r
- else if ( keyEvent.state == KeyEvent::Up )\r
+ else if ( keyEvent.GetState() == Dali::KeyEvent::Up )\r
{\r
eventHandled = ProcessEventKeyUp( keyEvent );\r
}\r
attrs = mPreeditAttrs;\r
}\r
\r
-bool InputMethodContextWin::ProcessEventKeyDown( const KeyEvent& keyEvent )\r
+bool InputMethodContextWin::ProcessEventKeyDown( const Dali::KeyEvent& keyEvent )\r
{\r
bool eventHandled( false );\r
return eventHandled;\r
}\r
\r
-bool InputMethodContextWin::ProcessEventKeyUp( const KeyEvent& keyEvent )\r
+bool InputMethodContextWin::ProcessEventKeyUp( const Dali::KeyEvent& keyEvent )\r
{\r
bool eventHandled( false );\r
return eventHandled;\r
* @param[in] keyEvent The event key to be handled.\r
* @return Whether the event key is handled.\r
*/\r
- bool ProcessEventKeyDown( const KeyEvent& keyEvent );\r
+ bool ProcessEventKeyDown( const Dali::KeyEvent& keyEvent );\r
\r
/**\r
* @brief Process event key up, whether filter a key to isf.\r
* @param[in] keyEvent The event key to be handled.\r
* @return Whether the event key is handled.\r
*/\r
- bool ProcessEventKeyUp( const KeyEvent& keyEvent );\r
+ bool ProcessEventKeyUp( const Dali::KeyEvent& keyEvent );\r
\r
/**\r
* Called when the binded actor is added to a window.\r
{
}
- int mId;
+ intptr_t mId;
unsigned int mInterval;
};
mWindowHeight( 0 ),
mOrientationMode( Internal::Adaptor::Window::OrientationMode::PORTRAIT ),
mNativeWindowId( -1 ),
- mResizedSignal(),
mDeleteRequestSignal(),
mFocusChangeSignal(),
mResizeSignal(),
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetSize(): resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
Dali::Window handle( this );
- mResizedSignal.Emit( newSize );
mResizeSignal.Emit( handle, newSize );
mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), SetPositionSize():resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height );
Dali::Window handle( this );
- mResizedSignal.Emit( newSize );
mResizeSignal.Emit( handle, newSize );
mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
}
DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight );
// Emit signal
Dali::Window handle( this );
- mResizedSignal.Emit( Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
mResizeSignal.Emit( handle, Dali::Window::WindowSize( mWindowWidth, mWindowHeight ) );
mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( mWindowWidth, mWindowHeight ) );
class Window : public Dali::Internal::Adaptor::SceneHolder, public EventHandler::Observer, public ConnectionTracker
{
public:
- typedef Dali::Window::ResizedSignalType ResizedSignalType;
typedef Dali::Window::FocusChangeSignalType FocusChangeSignalType;
typedef Dali::Window::ResizeSignalType ResizeSignalType;
typedef Dali::DevelWindow::VisibilityChangedSignalType VisibilityChangedSignalType;
* @copydoc Dali::Window::FocusChangeSignal()
*/
FocusChangeSignalType& FocusChangeSignal() { return mFocusChangeSignal; }
- /**
- * @copydoc Dali::Window::ResizedSignal()
- */
- ResizedSignalType& ResizedSignal() { return mResizedSignal; }
/**
* @copydoc Dali::Window::ResizedSignal()
int mNativeWindowId; ///< The Native Window Id
// Signals
- ResizedSignalType mResizedSignal;
SignalType mDeleteRequestSignal;
FocusChangeSignalType mFocusChangeSignal;
ResizeSignalType mResizeSignal;
info->callback( info->data );
}
-int SetTimer(int interval, timerCallback callback, void *data)
+intptr_t SetTimer(int interval, timerCallback callback, void *data)
{
TTimerCallbackInfo *callbackInfo = new TTimerCallbackInfo;
callbackInfo->data = data;
callbackInfo->callback = callback;
callbackInfo->hWnd = ::GetActiveWindow();
- UINT_PTR timerID = (UINT_PTR)callbackInfo;
+ INT_PTR timerID = (INT_PTR)callbackInfo;
::SetTimer( callbackInfo->hWnd, timerID, interval, TimerProc );
return timerID;
}
-void KillTimer(int id)
+void KillTimer(intptr_t id)
{
TTimerCallbackInfo *info = (TTimerCallbackInfo*)id;
::KillTimer( info->hWnd, id );
#include <stdint.h>\r
#include <dali/public-api/signals/callback.h>\r
\r
-typedef uint64_t WinWindowHandle;\r
+typedef uintptr_t WinWindowHandle;\r
typedef uint64_t WinPixmap;\r
\r
namespace Dali\r
\r
using timerCallback = bool(*)(void *data);\r
\r
-int SetTimer(int interval, timerCallback callback, void *data);\r
+intptr_t SetTimer(int interval, timerCallback callback, void *data);\r
\r
-void KillTimer(int id);\r
+void KillTimer(intptr_t id);\r
\r
const char* GetKeyName( int keyCode );\r
\r
void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent )
{
// see if there is a surface in Any surface
- unsigned int surfaceId = GetSurfaceId( surface );
+ uintptr_t surfaceId = GetSurfaceId( surface );
// if the surface is empty, create a new one.
if( surfaceId == 0 )
{
}
-unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const
+uintptr_t WindowBaseWin::GetSurfaceId( Any surface ) const
{
- unsigned int surfaceId = 0;
+ uintptr_t surfaceId = 0;
if ( surface.Empty() == false )
{
DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" );
}
-void WindowBaseWin::SetWinWindow( unsigned int surfaceId )
+void WindowBaseWin::SetWinWindow( uintptr_t surfaceId )
{
HWND hWnd = (HWND)surfaceId;
mWin32Window = static_cast<WinWindowHandle>(surfaceId);
- mWindowImpl.SetHWND( reinterpret_cast<uint64_t>(hWnd));
+ mWindowImpl.SetHWND(surfaceId);
mWindowImpl.SetWinProc();
}
* @param surface Any containing a surface id, or can be empty
* @return surface id, or zero if surface is empty
*/
- unsigned int GetSurfaceId( Any surface ) const;
+ uintptr_t GetSurfaceId( Any surface ) const;
/**
* @brief Create window
/**
* @brief Sets up an already created window.
*/
- void SetWinWindow( unsigned int surfaceId );
+ void SetWinWindow( uintptr_t surfaceId );
private:
return GetImplementation(*this).GetBrightness();
}
-Window::ResizedSignalType& Window::ResizedSignal()
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ResizedSignal is deprecated and will be removed from next release.\n" );
- return GetImplementation(*this).ResizedSignal();
-}
-
Window::ResizeSignalType& Window::ResizeSignal()
{
return GetImplementation(*this).ResizeSignal();
class Layer;
class RenderTaskList;
class TouchEvent;
-struct KeyEvent;
+class KeyEvent;
/**
* @brief The window class is used internally for drawing.
using WindowSize = Uint16Pair ; ///< Window size type @SINCE_1_2.60
using WindowPosition = Uint16Pair; ///< Window position type @SINCE_1_2.60
- using ResizedSignalType = Signal< void (WindowSize) >; ///< @DEPRECATED_1_4.35 @brief Window resized signal type @SINCE_1_2.60
using FocusChangeSignalType = Signal< void (Window,bool) >; ///< Window focus signal type @SINCE_1_4.35
using ResizeSignalType = Signal< void (Window,WindowSize) >; ///< Window resized signal type @SINCE_1_4.35
using KeyEventSignalType = Signal< void (const KeyEvent&) >; ///< Key event signal type
public: // Signals
/**
- * @brief This signal is emitted when the window is resized.
- *
- * A callback of the following type may be connected:
- * @code
- * void YourCallbackName( int width, int height );
- * @endcode
- * The parameters are the resized width and height.
- *
- * @SINCE_1_2.60
- * @return The signal to connect to
- */
- ResizedSignalType& ResizedSignal() DALI_DEPRECATED_API;
-
- /**
* @brief The user should connect to this signal to get a timing when window gains focus or loses focus.
*
* A callback of the following type may be connected: