[Tizen]Add WatchView
authorJoogab Yun <joogab.yun@samsung.com>
Mon, 7 Sep 2020 06:13:47 +0000 (15:13 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Mon, 7 Sep 2020 06:13:50 +0000 (15:13 +0900)
This reverts commit ba7fce86e16ba04cc6eed90140844808e5880110.

Change-Id: Ic871cbcc9d8e3f2f14f7058e77094903ea581086

build/tizen/Makefile.am
build/tizen/configure.ac
dali-csharp-binder/file.list
dali-csharp-binder/src/watch_view.cpp [new file with mode: 0755]
packaging/dali-csharp-binder.spec

index ed65e93..7e8276c 100644 (file)
@@ -112,6 +112,16 @@ endif
 
 endif
 
+if WEARABLE_PROFILE
+LIBDALI_CSHARP_BINDER_LA_CXXFLAGS += -DTIZEN_BUILD \
+                            $(DALIWATCHVIEW_CFLAGS)
+LIBDALI_CSHARP_BINDER_LA_LIBADD += $(DALIWATCHVIEW_LIBS)
+
+LIBDALI_CSHARP_BINDER_LA_CXXFLAGS += -DTIZEN_BUILD \
+                            $(DALIWATCHHOLDERBASE_CFLAGS)
+LIBDALI_CSHARP_BINDER_LA_LIBADD += $(DALIWATCHHOLDERBASE_LIBS)
+endif
+
 lib_LTLIBRARIES = libdali2-csharp-binder.la
 
 libdali2_csharp_binder_la_SOURCES = $(LIBDALI_CSHARP_BINDER_LA_SOURCES)
index 5ca9b0d..98c74c9 100644 (file)
@@ -81,6 +81,11 @@ if test "x$enable_profile" = "xMOBILE" -o "x$enable_profile" = "xWEARABLE" -o "x
   fi
 fi
 
+if test "x$enable_profile" = "xWEARABLE"; then
+  PKG_CHECK_MODULES(DALIWATCHVIEW, watch_viewer_dali)
+  PKG_CHECK_MODULES(DALIWATCHHOLDERBASE, watch-holder-base)
+fi
+
 if test x$DALI_DATA_RW_DIR != x; then
   dataReadWriteDir=$DALI_DATA_RW_DIR
 else
index 34bd014..4aafc76 100755 (executable)
@@ -46,7 +46,8 @@ dali_csharp_binder_tizen_src_files = \
 
 # module: csharp-binder, backend: tizen-wearable
 dali_csharp_binder_tizen_wearable_src_files = \
-  ${dali_csharp_binder_dir}/src/watch.cpp
+  ${dali_csharp_binder_dir}/src/watch.cpp \
+  ${dali_csharp_binder_dir}/src/watch_view.cpp
 
 dali_csharp_binder_header_files = \
   ${dali_csharp_binder_dir}/src/common.h
diff --git a/dali-csharp-binder/src/watch_view.cpp b/dali-csharp-binder/src/watch_view.cpp
new file mode 100755 (executable)
index 0000000..870e0f1
--- /dev/null
@@ -0,0 +1,335 @@
+/** 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.
+* 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.
+*
+*/
+
+#ifndef CSHARP_WATCH_VIEW
+#define CSHARP_WATCH_VIEW
+#endif
+
+#include "common.h"
+
+#include <watch_viewer_dali/public_api/watch_view/watch_view.h>
+#include <dali/public-api/adaptor-framework/window.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT Dali::Toolkit::Control * SWIGSTDCALL CSharp_Dali_WatchView_SWIGUpcast(Dali::WatchView::WatchView *jarg1) {
+    return (Dali::Toolkit::Control *)jarg1;
+}
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WatchView_New(void * nuiWindow, char * nuiWatchId, char * nuiContentInfo, int nuiWidth, int nuiHeight) {
+  void * jresult ;
+  Dali::Window* window = (Dali::Window*)nuiWindow ;
+  std::string *watchId = 0 ;
+  std::string *contentInfo = 0 ;
+  int width ;
+  int height ;
+  Dali::WatchView::WatchView result;
+
+  if (!nuiWatchId) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
+    return 0;
+  }
+  std::string watchid_str(nuiWatchId);
+  watchId = &watchid_str;
+
+  if (!nuiContentInfo) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
+    return 0;
+  }
+  std::string contenInfo_str(nuiContentInfo);
+  contentInfo = &contenInfo_str;
+  width = (int)nuiWidth;
+  height = (int)nuiHeight;
+
+  {
+    try {
+      result = Dali::WatchView::WatchView::New( *window,(std::string const &)*watchId,(std::string const &)*contentInfo,width,height);
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = new Dali::WatchView::WatchView((const Dali::WatchView::WatchView &)result);
+
+  //argout typemap for const std::string&
+
+
+  //argout typemap for const std::string&
+
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WatchView_DownCast(void * nuiHandle) {
+  void * jresult ;
+  Dali::BaseHandle arg1 ;
+  Dali::BaseHandle *argp1 ;
+  Dali::WatchView::WatchView result;
+
+  argp1 = (Dali::BaseHandle *)nuiHandle;
+  if (!argp1) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::BaseHandle", 0);
+    return 0;
+  }
+  arg1 = *argp1;
+  {
+    try {
+      result = Dali::WatchView::WatchView::DownCast(arg1);
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = new Dali::WatchView::WatchView((const Dali::WatchView::WatchView &)result);
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_WatchView__SWIG_0() {
+  void * jresult ;
+  Dali::WatchView::WatchView *result = 0 ;
+
+  {
+    try {
+      result = (Dali::WatchView::WatchView *)new Dali::WatchView::WatchView();
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = (void *)result;
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_WatchView__SWIG_1(void * nuiHandle) {
+  void * jresult ;
+  Dali::WatchView::WatchView *handle = 0 ;
+  Dali::WatchView::WatchView *result = 0 ;
+
+  handle = (Dali::WatchView::WatchView *)nuiHandle;
+  if (!handle) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::WatchView::WatchView const & type is null", 0);
+    return 0;
+  }
+  {
+    try {
+      result = (Dali::WatchView::WatchView *)new Dali::WatchView::WatchView((Dali::WatchView::WatchView const &)*handle);
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = (void *)result;
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_WatchView_Assign(void * nuiWatchview1, void * nuiWatchview2) {
+  void * jresult ;
+  Dali::WatchView::WatchView *watchView1 = (Dali::WatchView::WatchView *) 0 ;
+  Dali::WatchView::WatchView *watchView2 = 0 ;
+  Dali::WatchView::WatchView *result = 0 ;
+
+  watchView1 = (Dali::WatchView::WatchView *)nuiWatchview1;
+  watchView2 = (Dali::WatchView::WatchView *)nuiWatchview2;
+  if (!watchView2) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::WidgetView::WidgetView const & type is null", 0);
+    return 0;
+  }
+  {
+    try {
+      result = (Dali::WatchView::WatchView *) &(watchView1)->operator =((Dali::WatchView::WatchView const &)*watchView2);
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = (void *)result;
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_WatchView(void * nuiWatchview) {
+  Dali::WatchView::WatchView *watchView = (Dali::WatchView::WatchView *) 0 ;
+
+  watchView = (Dali::WatchView::WatchView *)nuiWatchview;
+  {
+    try {
+      delete watchView;
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return ;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
+      };
+    }
+  }
+
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_WatchView_PauseWatch(void * nuiWatchview) {
+  unsigned int jresult ;
+  Dali::WatchView::WatchView *watchView = (Dali::WatchView::WatchView *) 0 ;
+  bool result;
+
+  watchView = (Dali::WatchView::WatchView *)nuiWatchview;
+  {
+    try {
+      result = (bool)(watchView)->PauseWatch();
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = result;
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_WatchView_ResumeWatch(void * nuiWatchview) {
+  unsigned int jresult ;
+  Dali::WatchView::WatchView *watchView = (Dali::WatchView::WatchView *) 0 ;
+  bool result;
+
+  watchView = (Dali::WatchView::WatchView *)nuiWatchview;
+  {
+    try {
+      result = (bool)(watchView)->ResumeWatch();
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
+      };
+    } catch (Dali::DaliException e) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = result;
+  return jresult;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
index 476c91e..cb0e933 100644 (file)
@@ -39,6 +39,8 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-appfw-watch-application)
 BuildRequires:  pkgconfig(appcore-watch)
 BuildRequires:  pkgconfig(screen_connector_provider)
+BuildRequires:  pkgconfig(watch_viewer_dali)
+BuildRequires:  pkgconfig(watch-holder-base)
 %endif
 
 BuildRequires: pkgconfig
@@ -47,7 +49,6 @@ BuildRequires: pkgconfig(dali2-adaptor)
 BuildRequires: pkgconfig(dali2-toolkit)
 BuildRequires: pkgconfig(widget_viewer_dali)
 
-
 %if 0%{?tizen_version_major} >= 5
 BuildRequires: pkgconfig(ecore-wl2)
 %else