Binding WIndow Blur Interface to support window blur. 30/316730/2
authorWonsik Jung <sidein@samsung.com>
Tue, 27 Aug 2024 09:51:41 +0000 (18:51 +0900)
committerWonsik Jung <sidein@samsung.com>
Tue, 27 Aug 2024 21:27:29 +0000 (06:27 +0900)
Change-Id: I49f865d0e3e4538c6d33b3b5f98667ea680e8377

dali-csharp-binder/dali-adaptor/window-blur-info-wrap.cpp [new file with mode: 0644]
dali-csharp-binder/dali-adaptor/window-wrap.cpp
dali-csharp-binder/file.list

diff --git a/dali-csharp-binder/dali-adaptor/window-blur-info-wrap.cpp b/dali-csharp-binder/dali-adaptor/window-blur-info-wrap.cpp
new file mode 100644 (file)
index 0000000..6c7fca4
--- /dev/null
@@ -0,0 +1,260 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/devel-api/adaptor-framework/window-blur-info.h>
+#include <dali/public-api/adaptor-framework/window-enumerations.h>
+
+#include <dali-csharp-binder/common/common.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_WindowBlurInfo()
+{
+  void*             nuiResult;
+  Dali::WindowBlurInfo* result = 0;
+
+  {
+    try
+    {
+      result = (Dali::WindowBlurInfo*)new Dali::WindowBlurInfo();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  nuiResult = (void*)result;
+  return nuiResult;
+}
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_WindowBlurInfo_SWIG_0(int nuiBlurType, int nuiBlurRadius, int nuiCornerRadius)
+{
+  void * jresult ;
+  Dali::WindowBlurInfo *result = 0;
+
+  Dali::WindowBlurType blurType = (Dali::WindowBlurType)nuiBlurType;
+  int blurRadius = nuiBlurRadius;
+  int cornerRadius = nuiCornerRadius;
+
+  {
+    try {
+      result = (Dali::WindowBlurInfo *)new Dali::WindowBlurInfo(blurType, blurRadius, cornerRadius);
+    } CALL_CATCH_EXCEPTION(0);
+  }
+
+  jresult = (void *)result;
+  return jresult;
+}
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_WindowBlurInfo_SWIG_1(int nuiBlurType, int nuiBlurRadius)
+{
+  void * jresult ;
+  Dali::WindowBlurInfo *result = 0;
+
+  Dali::WindowBlurType blurType = (Dali::WindowBlurType)nuiBlurType;
+  int blurRadius = nuiBlurRadius;
+  int cornerRadius = 0;
+
+  {
+    try {
+      result = (Dali::WindowBlurInfo *)new Dali::WindowBlurInfo(blurType, blurRadius, cornerRadius);
+    } CALL_CATCH_EXCEPTION(0);
+  }
+
+  jresult = (void *)result;
+  return jresult;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_WindowBlurInfo(void* nuiWindowBlurInfo)
+{
+  Dali::WindowBlurInfo* blurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  {
+    try
+    {
+      delete blurInfo;
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_WindowBlurInfo_EqualTo(void * nuiWindowBlurInfo1, void * nuiWindowBlurInfo2)
+{
+  bool jresult;
+  bool result;
+  Dali::WindowBlurInfo *windowBlurInfo1 = (Dali::WindowBlurInfo *)nuiWindowBlurInfo1;
+  Dali::WindowBlurInfo *windowBlurInfo2 = (Dali::WindowBlurInfo *)nuiWindowBlurInfo2;
+
+  if (!windowBlurInfo1) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::WindowBlurInfo const & type is null in nuiWindowBlurInfo1", 0);
+    return 0;
+  }
+
+  if (!windowBlurInfo2) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::WindowBlurInfo const & type is null in nuiWindowBlurInfo2", 0);
+    return 0;
+  }
+
+  {
+    try {
+      result = (bool)((Dali::WindowBlurInfo const *)windowBlurInfo1)->operator ==((Dali::WindowBlurInfo const &)*windowBlurInfo2);
+    } CALL_CATCH_EXCEPTION(0);
+  }
+
+  jresult = result;
+  return jresult;
+}
+
+// --
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowBlurInfo_SetBlurType(void* nuiWindowBlurInfo, int nuiWindowBlurType)
+{
+  Dali::WindowBlurType  windowBlurType = (Dali::WindowBlurType)nuiWindowBlurType;
+  Dali::WindowBlurInfo* windowBlurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  if(!windowBlurInfo)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return;
+  }
+
+  {
+    try
+    {
+      windowBlurInfo->SetBlurType(windowBlurType);
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_WindowBlurInfo_GetBlurType(void* nuiWindowBlurInfo)
+{
+  int               nuiResult;
+  Dali::WindowBlurType  windowBlurType = Dali::WindowBlurType::NONE;
+  Dali::WindowBlurInfo* windowBlurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  if(!windowBlurInfo)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return 0;
+  }
+
+  {
+    try
+    {
+      windowBlurType = windowBlurInfo->GetBlurType();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  nuiResult = (int)windowBlurType;
+  return nuiResult;
+}
+
+// --
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowBlurInfo_SetBlurRadius(void* nuiWindowBlurInfo, int nuiWindowBlurRadius)
+{
+  int blurRadius = nuiWindowBlurRadius;
+  Dali::WindowBlurInfo* windowBlurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  if(!windowBlurInfo)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return;
+  }
+
+  {
+    try
+    {
+      windowBlurInfo->SetBlurRadius(blurRadius);
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_WindowBlurInfo_GetBlurRadius(void* nuiWindowBlurInfo)
+{
+  int               nuiResult;
+  int blurRadius = 0;
+  Dali::WindowBlurInfo* windowBlurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  if(!windowBlurInfo)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return 0;
+  }
+
+  {
+    try
+    {
+      blurRadius = windowBlurInfo->GetBlurRadius();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  nuiResult = (int)blurRadius;
+  return nuiResult;
+}
+
+// --
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WindowBlurInfo_SetBackgroundCornerRadius(void* nuiWindowBlurInfo, int nuiCornerRadius)
+{
+  int cornerRadius = nuiCornerRadius;
+  Dali::WindowBlurInfo* windowBlurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  if(!windowBlurInfo)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return;
+  }
+
+  {
+    try
+    {
+      windowBlurInfo->SetCornerRadiusForBackground(cornerRadius);
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Dali_WindowBlurInfo_GetBackgroundCornerRadius(void* nuiWindowBlurInfo)
+{
+  int               nuiResult;
+  int cornerRadius = 0;
+  Dali::WindowBlurInfo* windowBlurInfo = (Dali::WindowBlurInfo*)nuiWindowBlurInfo;
+
+  if(!windowBlurInfo)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return 0;
+  }
+
+  {
+    try
+    {
+      cornerRadius = windowBlurInfo->GetCornerRadiusForBackground();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  nuiResult = (int)cornerRadius;
+  return nuiResult;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
index c92cb78..df87c4c 100644 (file)
@@ -3843,6 +3843,44 @@ SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Window_RelativeMotionUnGrab(void * winHa
   return result;
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Window_SetBlur(void * winHandle, void * nuiBlurInfo) {
+  Dali::WindowBlurInfo blurInfo ;
+  Dali::WindowBlurInfo *pBlurInfo = (Dali::WindowBlurInfo *)nuiBlurInfo;
+  Dali::Window* window = (Dali::Window*)winHandle;
+  if(!CheckingWindowHandle(window)) {
+   return ;
+  }
+
+  if (!pBlurInfo) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::WindowBlurInfo", 0);
+    return ;
+  }
+  blurInfo = *pBlurInfo;
+  {
+    try {
+      Dali::DevelWindow::SetBlur(*window, blurInfo);
+    } CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_GetBlur(void * winHandle) {
+  void * jresult ;
+  Dali::WindowBlurInfo result;
+  Dali::Window* window = (Dali::Window*)winHandle;
+  if(!CheckingWindowHandle(window)) {
+   return 0;
+  }
+
+  {
+    try {
+      result = Dali::DevelWindow::GetBlur(*window);
+    } CALL_CATCH_EXCEPTION(0);
+  }
+
+  jresult = new Dali::WindowBlurInfo((const Dali::WindowBlurInfo &)result);
+  return jresult;
+}
+
 /* pointer constraints event */
 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WindowPointerConstraintsEventSignal(void* winHandle)
 {
index df08525..c495298 100755 (executable)
@@ -52,6 +52,7 @@ SET( dali_csharp_binder_common_src_files
   ${dali_csharp_binder_dir}/dali-adaptor/native-image-queue-wrap.cpp
   ${dali_csharp_binder_dir}/dali-adaptor/tts-player-wrap.cpp
   ${dali_csharp_binder_dir}/dali-adaptor/window-data-wrap.cpp
+  ${dali_csharp_binder_dir}/dali-adaptor/window-blur-info-wrap.cpp
   ${dali_csharp_binder_dir}/dali-adaptor/window-wrap.cpp
 
   ${dali_csharp_binder_dir}/dali-toolkit/dali-toolkit-wrap.cpp