From: Joogab Yun Date: Mon, 7 Sep 2020 06:13:47 +0000 (+0900) Subject: [Tizen]Add WatchView X-Git-Tag: submit/tizen/20200908.102446~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49607b53889e92c92c2594c90d1347e685ca99d6;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git [Tizen]Add WatchView This reverts commit ba7fce86e16ba04cc6eed90140844808e5880110. Change-Id: Ic871cbcc9d8e3f2f14f7058e77094903ea581086 --- diff --git a/build/tizen/Makefile.am b/build/tizen/Makefile.am index ed65e93..7e8276c 100644 --- a/build/tizen/Makefile.am +++ b/build/tizen/Makefile.am @@ -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) diff --git a/build/tizen/configure.ac b/build/tizen/configure.ac index 5ca9b0d..98c74c9 100644 --- a/build/tizen/configure.ac +++ b/build/tizen/configure.ac @@ -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 diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index 34bd014..4aafc76 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -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 index 0000000..870e0f1 --- /dev/null +++ b/dali-csharp-binder/src/watch_view.cpp @@ -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 +#include + +#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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return ; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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(e.what())); return 0; + }; + } catch (std::exception& e) { + { + SWIG_CSharpException(SWIG_RuntimeError, const_cast(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 + diff --git a/packaging/dali-csharp-binder.spec b/packaging/dali-csharp-binder.spec index 476c91e..cb0e933 100644 --- a/packaging/dali-csharp-binder.spec +++ b/packaging/dali-csharp-binder.spec @@ -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