DALI_TEST_EQUALS(Device::Class::NONE, event.GetDeviceClass(), TEST_LOCATION); // check device class
DALI_TEST_EQUALS(Device::Subclass::NONE, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
DALI_TEST_EQUALS(false, event.IsRepeat(), TEST_LOCATION); // check repeat
+ DALI_TEST_EQUALS(0, event.GetWindowId(), TEST_LOCATION); // check window id
END_TEST;
}
DALI_TEST_EQUALS(true, event.IsRepeat(), TEST_LOCATION);
END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliKeyEventSetWindowId(void)
+{
+ TestApplication application;
+
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
+
+ DALI_TEST_EQUALS(0, event.GetWindowId(), TEST_LOCATION);
+
+ DevelKeyEvent::SetWindowId(event, 1);
+ DALI_TEST_EQUALS(1, event.GetWindowId(), TEST_LOCATION);
+
+ END_TEST;
+}
END_TEST;
}
+
+int UtcDaliSceneGetNativeId(void)
+{
+ TestApplication application; // Initializes
+
+ Dali::Integration::Scene scene = application.GetScene();
+ int32_t nativeId = scene.GetNativeId();
+ DALI_TEST_EQUALS(nativeId, 0, TEST_LOCATION);
+
+ // Test that setting native id
+ scene.SetNativeId(1);
+ nativeId = scene.GetNativeId();
+ DALI_TEST_EQUALS(nativeId, 1, TEST_LOCATION);
+ END_TEST;
+}
GetImplementation(keyEvent).SetRepeat(repeat);\r
}\r
\r
+void SetWindowId(KeyEvent keyEvent, uint32_t windowId)\r
+{\r
+ GetImplementation(keyEvent).SetWindowId(windowId);\r
+}\r
+\r
} // namespace DevelKeyEvent\r
\r
} // namespace Dali\r
*/\r
DALI_CORE_API void SetRepeat(KeyEvent keyEvent, const bool repeat);\r
\r
+/**\r
+ * @brief Sets window id where key event occurred.\r
+ *\r
+ * @SINCE_2_3.5\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] windowId The window id where key event occurred.\r
+ */\r
+DALI_CORE_API void SetWindowId(KeyEvent keyEvent, uint32_t windowId);\r
+\r
} // namespace DevelKeyEvent\r
\r
} // namespace Dali\r
deviceName(""),
deviceClass(Device::Class::NONE),
deviceSubclass(Device::Subclass::NONE),
- isRepeat(false)
+ isRepeat(false),
+ windowId(0)
{
}
deviceName(deviceName),
deviceClass(deviceClass),
deviceSubclass(deviceSubclass),
- isRepeat(false)
+ isRepeat(false),
+ windowId(0)
{
}
* Whether the key referenced by the event is a repeating key.
*/
bool isRepeat;
+
+ /**
+ * Window id where key event occurred.
+ */
+ uint32_t windowId;
};
} // namespace Integration
return GetImplementation(*this).IsGeometryHittestEnabled();
}
+void Scene::SetNativeId(int32_t nativeId)
+{
+ return GetImplementation(*this).SetNativeId(nativeId);
+}
+
+int32_t Scene::GetNativeId() const
+{
+ return GetImplementation(*this).GetNativeId();
+}
+
Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
{
return GetImplementation(*this).EventProcessingFinishedSignal();
bool IsGeometryHittestEnabled();
/**
+ * @brief Sets the native window id
+ *
+ * @param nativeId The native window id
+ */
+ void SetNativeId(int32_t nativeId);
+
+ /**
+ * @brief Gets the native window id
+ *
+ * @return The native window id
+ */
+ int32_t GetNativeId() const;
+
+ /**
* @brief This signal is emitted just after the event processing is finished.
*
* @return The signal to connect to
mGeometryHittest(false),
mEventProcessor(*this, ThreadLocalStorage::GetInternal()->GetGestureEventProcessor()),
mSurfaceOrientation(0),
- mScreenOrientation(0)
+ mScreenOrientation(0),
+ mNativeId(0)
{
}
return mGeometryHittest;
}
+void Scene::SetNativeId(int32_t nativeId)
+{
+ mNativeId = nativeId;
+}
+
+int32_t Scene::GetNativeId() const
+{
+ return mNativeId;
+}
+
Integration::Scene::KeyEventSignalType& Scene::KeyEventSignal()
{
return mKeyEventSignal;
bool IsGeometryHittestEnabled() const;
/**
+ * @copydoc Dali::Integration::Scene::SetNativeId
+ */
+ void SetNativeId(int32_t nativeId);
+
+ /**
+ * @copydoc Dali::Integration::Scene::GetNativeId
+ */
+ int32_t GetNativeId() const;
+
+ /**
* Used by the EventProcessor to emit key event signals.
* @param[in] event The key event.
*/
// The Screen's orientation
int32_t mScreenOrientation;
+ // The native window id
+ int32_t mNativeId;
+
// The key event signal
Integration::Scene::KeyEventSignalType mKeyEventSignal;
Integration::Scene::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
mDeviceName(""),
mDeviceClass(Device::Class::NONE),
mDeviceSubclass(Device::Subclass::NONE),
- mIsRepeat(false)
+ mIsRepeat(false),
+ mWindowId(0)
{
}
mDeviceName(deviceName),
mDeviceClass(deviceClass),
mDeviceSubclass(deviceSubclass),
- mIsRepeat(false)
+ mIsRepeat(false),
+ mWindowId(0)
{
}
return mIsRepeat;
}
+uint32_t KeyEvent::GetWindowId() const
+{
+ return mWindowId;
+}
+
void KeyEvent::SetKeyName(const std::string& keyName)
{
mKeyName = keyName;
mIsRepeat = repeat;
}
+void KeyEvent::SetWindowId(uint32_t windowId)
+{
+ mWindowId = windowId;
+}
+
} // namespace Internal
} // namespace Dali
bool IsRepeat() const;
/**
+ * @copydoc Dali::KeyEvent::GetWindowId()
+ */
+ uint32_t GetWindowId() const;
+
+ /**
* @brief Set the name given to the key pressed
*
* @param[in] keyName The name given to the key pressed.
*/
void SetRepeat(const bool repeat);
+ /**
+ * @brief Sets window id where key event occurred.
+ *
+ * @param[in] windowId The window id where key event occurred
+ */
+ void SetWindowId(uint32_t windowId);
+
+
private:
/**
* @brief Destructor.
Device::Class::Type mDeviceClass; ///< The class of device the key event originated from
Device::Subclass::Type mDeviceSubclass; ///< The subclass of device the key event originated from
bool mIsRepeat; ///< Whether the key referenced by the event is a repeating key.
+ uint32_t mWindowId; ///< The window id where key event occurred.
};
} // namespace Internal
{
KeyEventPtr keyEvent(new KeyEvent(event.keyName, event.logicalKey, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>(event.state), event.compose, event.deviceName, event.deviceClass, event.deviceSubclass));
keyEvent->SetRepeat(event.isRepeat);
+ keyEvent->SetWindowId(event.windowId);
Dali::KeyEvent keyEventHandle(keyEvent.Get());
#ifdef TRACE_ENABLED
return GetImplementation(*this).IsRepeat();
}
+uint32_t KeyEvent::GetWindowId() const
+{
+ return GetImplementation(*this).GetWindowId();
+}
+
KeyEvent::KeyEvent(Internal::KeyEvent* internal)
: BaseHandle(internal)
{
*/
bool IsRepeat() const;
+ /**
+ * @brief Gets the Window Id where key event occurred.
+ *
+ * @SINCE_2_3.5
+ * @return The window id
+ */
+ uint32_t GetWindowId() const;
+
public: // Not intended for application developers
/// @cond internal
/**