RootLayout helper API added 89/181889/2
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 15 Jun 2018 16:10:30 +0000 (17:10 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 18 Jun 2018 16:01:56 +0000 (17:01 +0100)
New API to create a root AbsoluteLayout control.

Change-Id: I5dec94611e02e83a8e60265d7632a289f4f10d39

dali-csharp-binder/src/window.cpp

index ec97122..6c7f0be 100755 (executable)
@@ -1,4 +1,4 @@
-/** Copyright (c) 2017 Samsung Electronics Co., Ltd.
+/** Copyright (c) 2018 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.
@@ -23,6 +23,9 @@
 #include <dali/public-api/adaptor-framework/window.h>
 #include <dali/integration-api/adaptors/adaptor.h>
 
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/layouting/absolute-layout.h>
+
 /* Callback for returning strings to C# without leaking memory */
 typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *);
 extern SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback;
@@ -2530,6 +2533,29 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Adaptor_RenderOnce(void * /* jarg1 */) {
   }
 }
 
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_Window_New_Root_Layout() {
+  void * jresult ;
+  Dali::Toolkit::Control result;
+  {
+    try {
+      Dali::Toolkit::AbsoluteLayout absoluteLayout = Dali::Toolkit::AbsoluteLayout::New();
+      result = Dali::Toolkit::Control::New();
+      Dali::Toolkit::DevelControl::SetLayout( result, absoluteLayout );
+      result.SetName("rootAbsoluteLayout");
+      result.SetAnchorPoint( Dali::AnchorPoint::CENTER );
+      result.SetParentOrigin( Dali::ParentOrigin::CENTER );
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+
+  jresult = new Dali::Toolkit::Control((const Dali::Toolkit::Control &)result);
+
+  return jresult;
+}
+
 #ifdef __cplusplus
 }
 #endif