2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "layout-controller.h"
19 #include <dali/integration-api/adaptors/adaptor.h>
27 static int gLayoutControllerId = 1;
28 } // unnamed namespace
30 LayoutController::LayoutController() : handler(NULL), mId( gLayoutControllerId++ )
32 Dali::Adaptor::Get().RegisterProcessor(*this);
36 LayoutController::~LayoutController()
38 Dali::Adaptor::Get().UnregisterProcessor(*this);
42 int LayoutController::GetId() const
47 void LayoutController::Process()
55 void LayoutController::SetCallback( LayoutControllerProcessCallback callback )
60 // LayoutController Bindings
62 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_LayoutController() {
64 LayoutController *result = 0 ;
68 result = (LayoutController *)new LayoutController();
69 } catch (std::out_of_range& e) {
71 SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return 0;
73 } catch (std::exception& e) {
75 SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return 0;
77 } catch (Dali::DaliException e) {
79 SWIG_CSharpException(SWIG_UnknownError, e.condition); return 0;
83 SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
88 return (void *)result;
91 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_LayoutController(void * jarg1) {
93 LayoutController * arg1 = (LayoutController *)jarg1;
97 } catch (std::out_of_range& e) {
99 SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return ;
101 } catch (std::exception& e) {
103 SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return ;
107 SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
113 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutController_SetCallback( void* jarg1, LayoutController::LayoutControllerProcessCallback callback )
115 LayoutController* layoutController = (LayoutController *) jarg1;
117 if( layoutController )
119 layoutController->SetCallback( callback );
123 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_LayoutController_GetId( void* jarg1 )
125 LayoutController * layoutController = (LayoutController *)jarg1;
127 if( layoutController )
129 ret = layoutController->GetId();