Reuse internally created Key/Touch and reuse it 27/292027/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 26 Apr 2023 09:15:03 +0000 (18:15 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 26 Apr 2023 09:15:03 +0000 (18:15 +0900)
Change-Id: I7bc136947e936b413d6f188bd1c3a8d5b28e4163
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-csharp-binder/src/window-wrap.cpp

index 8cafe94..3a38831 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -2734,6 +2734,46 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_GetLastTouchEvent(void* winHand
   return jresult;
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_InternalRetrievingLastKeyEvent(void* winHandle, void* keyHandle)
+{
+  Dali::Window* window = (Dali::Window*)winHandle;
+  Dali::KeyEvent* keyEvent = (Dali::KeyEvent*)keyHandle;
+
+  if (!window) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Window", 0);
+    return;
+  }
+  if (!keyEvent) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::KeyEvent", 0);
+    return;
+  }
+  {
+    try {
+      (*keyEvent) = *((Dali::KeyEvent *)&Dali::DevelWindow::GetLastKeyEvent(*window));
+    } CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_InternalRetrievingLastTouchEvent(void* winHandle, void* touchHandle)
+{
+  Dali::Window* window = (Dali::Window*)winHandle;
+  Dali::TouchEvent* touchEvent = (Dali::TouchEvent*)touchHandle;
+
+  if (!window) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Window", 0);
+    return;
+  }
+  if (!touchEvent) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::TouchEvent", 0);
+    return;
+  }
+  {
+    try {
+      (*touchEvent) = *((Dali::TouchEvent *)&Dali::DevelWindow::GetLastTouchEvent(*window));
+    } CALL_CATCH_EXCEPTION();
+  }
+}
+
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_SetNeedsRotationCompletedAcknowledgement(void* winHandle, bool needAcknowledgement)
 {
   Dali::Window* window = (Dali::Window*)winHandle;