/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return GetImplementation(window).IsWindowRotating();
}
+const KeyEvent& GetLastKeyEvent(Window window)
+{
+ return GetImplementation(window).GetLastKeyEvent();
+}
+
+const TouchEvent& GetLastTouchEvent(Window window)
+{
+ return GetImplementation(window).GetLastTouchEvent();
+}
+
} // namespace DevelWindow
} // namespace Dali
#define DALI_WINDOW_DEVEL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace DevelWindow
{
-
typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
typedef Signal<void(const KeyEvent&)> KeyEventSignalType; ///< Key event signal type
*/
DALI_ADAPTOR_API bool IsWindowRotating(Window window);
+/**
+ * @brief Gets the last key event the window gets.
+ *
+ * @param[in] window The window instance.
+ * @return The last key event the window gets.
+ */
+DALI_ADAPTOR_API const KeyEvent& GetLastKeyEvent(Window window);
+
+/**
+ * @brief Gets the last touch event the window gets.
+ *
+ * @param[in] window The window instance.
+ * @return The last touch event the window gets.
+ */
+DALI_ADAPTOR_API const TouchEvent& GetLastTouchEvent(Window window);
+
} // namespace DevelWindow
} // namespace Dali
// EXTERNAL HEADERS
#include <dali/devel-api/adaptor-framework/orientation.h>
+#include <dali/devel-api/events/key-event-devel.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/touch-integ.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/actors/layer.h>
Window::Window()
: mWindowSurface(nullptr),
mWindowBase(),
- mIsTransparent(false),
- mIsFocusAcceptable(true),
- mIconified(false),
- mOpaqueState(false),
- mWindowRotationAcknowledgement(false),
- mFocused(false),
mParentWindow(NULL),
mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
mRotationAngle(0),
mWindowWidth(0),
mWindowHeight(0),
- mOrientationMode(Internal::Adaptor::Window::OrientationMode::PORTRAIT),
mNativeWindowId(-1),
+ mOrientationMode(Internal::Adaptor::Window::OrientationMode::PORTRAIT),
mDeleteRequestSignal(),
mFocusChangeSignal(),
mResizeSignal(),
mVisibilityChangedSignal(),
mTransitionEffectEventSignal(),
mKeyboardRepeatSettingsChangedSignal(),
- mAuxiliaryMessageSignal()
+ mAuxiliaryMessageSignal(),
+ mLastKeyEevent(),
+ mLastTouchEevent(),
+ mIsTransparent(false),
+ mIsFocusAcceptable(true),
+ mIconified(false),
+ mOpaqueState(false),
+ mWindowRotationAcknowledgement(false),
+ mFocused(false)
{
}
void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
{
+ mLastTouchEevent = Dali::Integration::NewTouchEvent(timeStamp, point);
FeedTouchPoint(point, timeStamp);
}
void Window::OnKeyEvent(Dali::Integration::KeyEvent& keyEvent)
{
+ mLastKeyEevent = Dali::DevelKeyEvent::New(keyEvent.keyName, keyEvent.logicalKey, keyEvent.keyString, keyEvent.keyCode, keyEvent.keyModifier, keyEvent.time, static_cast<Dali::KeyEvent::State>(keyEvent.state), keyEvent.compose, keyEvent.deviceName, keyEvent.deviceClass, keyEvent.deviceSubclass);
FeedKeyEvent(keyEvent);
}
return mWindowSurface->IsWindowRotating();
}
+const Dali::KeyEvent& Window::GetLastKeyEvent() const
+{
+ return mLastKeyEevent;
+}
+
+const Dali::TouchEvent& Window::GetLastTouchEvent() const
+{
+ return mLastTouchEevent;
+}
+
} // namespace Adaptor
} // namespace Internal
// EXTERNAL INCLUDES
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/adaptor-framework/window-enumerations.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/object/property-array.h>
#include <dali/public-api/object/ref-object.h>
* @param[in] isTransparent Whether window is transparent
* @return A newly allocated Window
*/
- static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent = false);
+ static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent = false);
/**
* @copydoc Dali::Window::SetClass()
*/
bool IsWindowRotating() const;
+ /**
+ * @copydoc Dali::DevelWindow::GetLastKeyEvent()
+ */
+ const Dali::KeyEvent& GetLastKeyEvent() const;
+
+ /**
+ * @copydoc Dali::DevelWindow::GetLastTouchEvent()
+ */
+ const Dali::TouchEvent& GetLastTouchEvent() const;
+
private:
/**
* @brief Enumeration for orietation mode.
WindowBase* mWindowBase;
std::string mName;
std::string mClassName;
- bool mIsTransparent : 1;
- bool mIsFocusAcceptable : 1;
- bool mIconified : 1;
- bool mOpaqueState : 1;
- bool mWindowRotationAcknowledgement : 1;
- bool mFocused : 1;
Dali::Window mParentWindow;
OrientationPtr mOrientation;
std::vector<int> mAvailableAngles;
int mPreferredAngle;
- int mRotationAngle; ///< The angle of the rotation
- int mWindowWidth; ///< The width of the window
- int mWindowHeight; ///< The height of the window
-
- EventHandlerPtr mEventHandler; ///< The window events handler
-
- OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
+ int mRotationAngle; ///< The angle of the rotation
+ int mWindowWidth; ///< The width of the window
+ int mWindowHeight; ///< The height of the window
+ int mNativeWindowId; ///< The Native Window Id
- int mNativeWindowId; ///< The Native Window Id
+ EventHandlerPtr mEventHandler; ///< The window events handler
+ OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
// Signals
SignalType mDeleteRequestSignal;
KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
AuxiliaryMessageSignalType mAuxiliaryMessageSignal;
AccessibilityHighlightSignalType mAccessibilityHighlightSignal;
+
+ Dali::KeyEvent mLastKeyEevent;
+ Dali::TouchEvent mLastTouchEevent;
+
+ bool mIsTransparent : 1;
+ bool mIsFocusAcceptable : 1;
+ bool mIconified : 1;
+ bool mOpaqueState : 1;
+ bool mWindowRotationAcknowledgement : 1;
+ bool mFocused : 1;
};
} // namespace Adaptor