From 3475b530867960d63de94e545d021ac6f384d32f Mon Sep 17 00:00:00 2001 From: "xb.teng" Date: Tue, 20 Jun 2017 16:15:42 +0800 Subject: [PATCH] manual binding for FocusManager and Window There are some changes: 1. Add MoveFocusBackward api for FocusManager; 2. Add Resized event for Window. Change-Id: I6284b75d3b3e9e8cc9d6f331d1b6e024493492c3 Signed-off-by: xb.teng --- dali-csharp-binder/file.list | 1 + .../src/keyboard_focus_manager_wrap.cpp | 22 ++ dali-csharp-binder/src/window.cpp | 260 +++++++++++++++++++++ 3 files changed, 283 insertions(+) create mode 100755 dali-csharp-binder/src/window.cpp diff --git a/dali-csharp-binder/file.list b/dali-csharp-binder/file.list index b668ecf..630a6ec 100755 --- a/dali-csharp-binder/file.list +++ b/dali-csharp-binder/file.list @@ -13,6 +13,7 @@ dali_csharp_binder_src_files = \ src/manual-bindings-all.cpp \ src/tts-player.cpp \ src/text-editor.cpp \ + src/window.cpp \ src/key-grab.cpp dali_csharp_binder_header_files = \ diff --git a/dali-csharp-binder/src/keyboard_focus_manager_wrap.cpp b/dali-csharp-binder/src/keyboard_focus_manager_wrap.cpp index 4845947..e82321a 100755 --- a/dali-csharp-binder/src/keyboard_focus_manager_wrap.cpp +++ b/dali-csharp-binder/src/keyboard_focus_manager_wrap.cpp @@ -454,6 +454,28 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_KeyboardFocusManager_GetFocusIndicatorActor return jresult; } +SWIGEXPORT void SWIGSTDCALL CSharp_KeyboardFocusManager_MoveFocusBackward(void * jarg1) { + Dali::Toolkit::KeyboardFocusManager *arg1 = (Dali::Toolkit::KeyboardFocusManager *) 0 ; + + arg1 = (Dali::Toolkit::KeyboardFocusManager *)jarg1; + { + try { + (arg1)->MoveFocusBackward(); + } 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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return; + }; + } + } +} SWIGEXPORT void * SWIGSTDCALL CSharp_KeyboardFocusManager_PreFocusChangeSignal(void * jarg1) { void * jresult ; diff --git a/dali-csharp-binder/src/window.cpp b/dali-csharp-binder/src/window.cpp new file mode 100755 index 0000000..f0381e6 --- /dev/null +++ b/dali-csharp-binder/src/window.cpp @@ -0,0 +1,260 @@ +/** Copyright (c) 2017 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_WINDOW +#define CSHARP_WINDOW +#endif + +#include "common.h" +#include + +SWIGINTERN bool Dali_Signal_void_int_int___Empty(Dali::Signal< void (int,int) > const *self){ + return self->Empty(); +} +SWIGINTERN std::size_t Dali_Signal_void_int_int__GetConnectionCount(Dali::Signal< void (int,int) > const *self){ + return self->GetConnectionCount(); +} +SWIGINTERN void Dali_Signal_void_int_int__Connect(Dali::Signal< void (int,int) > *self,void (*func)(int,int)){ + self->Connect( func ); +} +SWIGINTERN void Dali_Signal_void_int_int__Disconnect(Dali::Signal< void (int,int) > *self,void (*func)(int,int)){ + self->Disconnect( func ); +} +SWIGINTERN void Dali_Signal_void_int_int__Emit(Dali::Signal< void (int,int) > *self,int arg1,int arg2){ + self->Emit( arg1, arg2 ); +} + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_ResizedSignal(void * jarg1) { + void * jresult ; + Dali::Window arg1 ; + Dali::Window *argp1 ; + Dali::DevelWindow::ResizedSignalType *result = 0 ; + + argp1 = (Dali::Window *)jarg1; + if (!argp1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Window", 0); + return 0; + } + arg1 = *argp1; + { + try { + result = (Dali::DevelWindow::ResizedSignalType *) &Dali::DevelWindow::ResizedSignal(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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0; + }; + } + } + jresult = (void *)result; + return jresult; +} + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_ResizedSignal_Empty(void * jarg1) { + unsigned int jresult ; + Dali::Signal< void (int,int) > *arg1 = (Dali::Signal< void (int,int) > *) 0 ; + bool result; + + arg1 = (Dali::Signal< void (int,int) > *)jarg1; + { + try { + result = (bool)Dali_Signal_void_int_int___Empty((Dali::Signal< void (int,int) > const *)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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0; + }; + } + } + jresult = result; + return jresult; +} + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_Dali_ResizedSignal_GetConnectionCount(void * jarg1) { + unsigned long jresult ; + Dali::Signal< void (int,int) > *arg1 = (Dali::Signal< void (int,int) > *) 0 ; + std::size_t result; + + arg1 = (Dali::Signal< void (int,int) > *)jarg1; + { + try { + result = Dali_Signal_void_int_int__GetConnectionCount((Dali::Signal< void (int,int) > const *)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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0; + }; + } + } + jresult = (unsigned long)result; + return jresult; +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ResizedSignal_Connect(void * jarg1, void * jarg2) { + Dali::Signal< void (int,int) > *arg1 = (Dali::Signal< void (int,int) > *) 0 ; + void (*arg2)(int,int) = (void (*)(int,int)) 0 ; + + arg1 = (Dali::Signal< void (int,int) > *)jarg1; + arg2 = (void (*)(int,int))jarg2; + { + try { + Dali_Signal_void_int_int__Connect(arg1,arg2); + } 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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ; + }; + } + } +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ResizedSignal_Disconnect(void * jarg1, void * jarg2) { + Dali::Signal< void (int,int) > *arg1 = (Dali::Signal< void (int,int) > *) 0 ; + void (*arg2)(int,int) = (void (*)(int,int)) 0 ; + + arg1 = (Dali::Signal< void (int,int) > *)jarg1; + arg2 = (void (*)(int,int))jarg2; + { + try { + Dali_Signal_void_int_int__Disconnect(arg1,arg2); + } 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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ; + }; + } + } +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ResizedSignal_Emit(void * jarg1, int jarg2, int jarg3) { + Dali::Signal< void (int,int) > *arg1 = (Dali::Signal< void (int,int) > *) 0 ; + int arg2 ; + int arg3 ; + + arg1 = (Dali::Signal< void (int,int) > *)jarg1; + arg2 = (int)jarg2; + arg3 = (int)jarg3; + { + try { + Dali_Signal_void_int_int__Emit(arg1,arg2,arg3); + } 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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ; + }; + } + } +} + +SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_ResizedSignal() { + void * jresult ; + Dali::Signal< void (int,int) > *result = 0 ; + + { + try { + result = (Dali::Signal< void (int,int) > *)new Dali::Signal< void (int,int) >(); + } 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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0; + }; + } + } + jresult = (void *)result; + return jresult; +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_ResizedSignal(void * jarg1) { + Dali::Signal< void (int,int) > *arg1 = (Dali::Signal< void (int,int) > *) 0 ; + + arg1 = (Dali::Signal< void (int,int) > *)jarg1; + { + try { + delete arg1; + } 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 (...) { + { + SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ; + }; + } + } +} + + +#ifdef __cplusplus +} +#endif + -- 2.7.4