[dali_1.2.33] Merge branch 'devel/master' 41/122441/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 3 Apr 2017 11:00:52 +0000 (12:00 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 3 Apr 2017 11:00:52 +0000 (12:00 +0100)
Change-Id: Iac9e1f1c774441a6ab054477d3e8d326bcaa1174

47 files changed:
automated-tests/CMakeLists.txt.in
automated-tests/README.md
automated-tests/src/dali-toolkit-styling/default-theme.json
automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopupMirroringLTR.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopupMirroringRTL.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
build/tizen/plugins/csharp/Makefile.am
dali-toolkit/devel-api/controls/text-controls/hidden-input-properties.h [new file with mode: 0644]
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h [new file with mode: 0644]
dali-toolkit/devel-api/file.list [changed mode: 0755->0644]
dali-toolkit/devel-api/focus-manager/keyboard-focus-manager-devel.h
dali-toolkit/devel-api/visuals/image-visual-properties-devel.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/file.list [changed mode: 0755->0644]
dali-toolkit/internal/text/hidden-text.cpp [new file with mode: 0644]
dali-toolkit/internal/text/hidden-text.h [new file with mode: 0644]
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec
plugins/dali-swig/Makefile.am
plugins/dali-swig/SWIG/events/application-event.i
plugins/dali-swig/SWIG/events/rectangle.i
plugins/dali-swig/examples/control-dashboard.cs
plugins/dali-swig/examples/dali-test.cs [changed mode: 0644->0755]
plugins/dali-swig/examples/hello-world.cs
plugins/dali-swig/examples/image-view.cs
plugins/dali-swig/examples/scroll-view.cs
plugins/dali-swig/examples/user-alphafunction.cs
plugins/dali-swig/manual/cpp/callbackbase_wrap.cpp [deleted file]
plugins/dali-swig/manual/cpp/event-thread-callback-wrap.cpp [new file with mode: 0644]
plugins/dali-swig/manual/csharp/DisposeQueue.cs
plugins/dali-swig/manual/csharp/EventThreadCallback.cs [new file with mode: 0644]
plugins/dali-swig/manual/csharp/ManualPINVOKE.cs
plugins/dali-swig/manual/csharp/View.cs [changed mode: 0644->0755]
plugins/dali-swig/manual/csharp/ViewWrapper.cs [changed mode: 0644->0755]
plugins/dali-swig/property-wrapper.rb
plugins/dali-swig/views/spin.cs [changed mode: 0644->0755]

index 377ec92..8851c15 100644 (file)
@@ -18,9 +18,8 @@ MESSAGE("po dir: ${PO_DIR}")
 FILE(GLOB PO_FILES RELATIVE "${PO_DIR}" "${PO_DIR}/*.po")
 
 SET(MSGFMT "/usr/bin/msgfmt")
-SET(MO_FILES_DIR /tmp/locale/en/LC_MESSAGES)
+SET(MO_FILES_DIR /tmp/locale)
 FILE(MAKE_DIRECTORY ${MO_FILES_DIR})
-MESSAGE("mo dir: ${MO_FILES_DIR}")
 
 FOREACH(PO_FILE ${PO_FILES})
         SET(PO_FILE ${PO_DIR}/${PO_FILE})
@@ -29,7 +28,8 @@ FOREACH(PO_FILE ${PO_FILES})
         MESSAGE("ABS_PO_FILE : ${ABS_PO_FILE}")
         GET_FILENAME_COMPONENT(lang ${ABS_PO_FILE} NAME_WE)
         MESSAGE("lang : ${lang}")
-        SET(MO_FILE ${MO_FILES_DIR}/dali-toolkit.mo.${lang})
+        FILE(MAKE_DIRECTORY ${MO_FILES_DIR}/${lang}/LC_MESSAGES)
+        SET(MO_FILE ${MO_FILES_DIR}/${lang}/LC_MESSAGES/dali-toolkit.mo)
         MESSAGE("MO_FILE : ${MO_FILE}")
         ADD_CUSTOM_COMMAND(OUTPUT ${MO_FILE}
                            COMMAND ${MSGFMT} -o ${MO_FILE} ${ABS_PO_FILE}
index 6761a3b..72d7473 100644 (file)
@@ -14,6 +14,16 @@ These are device specific instructions, however, installing the test suite will
 
 If you are planning on running tests on device, then flash your handset with latest image, or turn off ssh: `set_usb_debug.sh --mtp-sdb` and plug it in, then follow the quickstart instructions repeated below.
 
+Multi-language locale environment
+---------------------------------
+
+Locales for English and Arabic must be installed to pass some test cases:
+
+$ sudo locale-gen en
+$ sudo locale-gen ar
+$ sudo update-locale
+
+
 Quickstart
 ----------
 
index 4f9fb77..c9e87f8 100644 (file)
                 "testVisual":
                 {
                   "visualType":"IMAGE",
-                  "url":"0001.png"
+                  "url":"0001.png",
+                  "atlasing":true
                 },
                 "testVisual2":
                 {
                 "foregroundVisual":
                 {
                   "visualType":"IMAGE",
-                  "url":"theSameImage.png"
+                  "url":"theSameImage.png",
+                  "atlasing":true
                 },
                 "labelVisual":
                 {
                 "testVisual":
                 {
                   "visualType":"IMAGE",
-                  "url":"0002.png"
+                  "url":"0002.png",
+                  "atlasing":true
                 },
                 "testVisual2":
                 {
                 "foregroundVisual":
                 {
                   "visualType":"IMAGE",
-                  "url":"theSameImage.png"
+                  "url":"theSameImage.png",
+                  "atlasing":true
                 },
                 "labelVisual":
                 {
                 "testVisual":
                 {
                   "visualType":"IMAGE",
-                  "url":"0001.png"
+                  "url":"0001.png",
+                  "atlasing":true
                 },
                 "testVisual2":
                 {
             "focusVisual":
             {
               "visualType":"IMAGE",
-              "url": "focus.png"
+              "url": "focus.png",
+              "atlasing":true
             }
           },
           "entryTransition":
index 17b4432..f6164fb 100644 (file)
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-event-thread-callback.h>
 #include <dali-toolkit/devel-api/image-loader/image-atlas.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/dali-toolkit.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -390,8 +393,25 @@ int UtcDaliImageAtlasImageView(void)
   callStack.Reset();
   callStack.Enable(true);
 
-  ImageView imageView1 = ImageView::New( gImage_34_RGBA, ImageDimensions(34, 34) );
-  ImageView imageView2 = ImageView::New( gImage_50_RGBA, ImageDimensions(50, 50) );
+  Property::Map imageMap1;
+
+  imageMap1[ ImageVisual::Property::URL ] = gImage_34_RGBA;
+  imageMap1[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
+  imageMap1[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
+  imageMap1[ DevelImageVisual::Property::ATLASING] = true;
+
+  Property::Map imageMap2;
+
+  imageMap2[ ImageVisual::Property::URL ] = gImage_50_RGBA;
+  imageMap2[ ImageVisual::Property::DESIRED_HEIGHT ] = 50;
+  imageMap2[ ImageVisual::Property::DESIRED_WIDTH ] = 50;
+  imageMap2[ DevelImageVisual::Property::ATLASING ] = true;
+
+  ImageView imageView1 = ImageView::New();
+  imageView1.SetProperty( ImageView::Property::IMAGE, imageMap1 );
+
+  ImageView imageView2 = ImageView::New();
+  imageView2.SetProperty( ImageView::Property::IMAGE, imageMap2 );
 
   // ImageView doesn't do size negotiation properly: it only listens to OnSizeSet:
   imageView1.SetSize( 100, 100 );
@@ -434,7 +454,16 @@ int UtcDaliImageAtlasImageView(void)
   Stage::GetCurrent().Remove( imageView2 );
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  ImageView imageView3 = ImageView::New( gImage_128_RGB, ImageDimensions(100, 100) );
+
+  Property::Map imageMap3;
+  imageMap3[ ImageVisual::Property::URL ] = gImage_128_RGB;
+  imageMap3[ ImageVisual::Property::DESIRED_HEIGHT ] = 100;
+  imageMap3[ ImageVisual::Property::DESIRED_WIDTH ] = 100;
+  imageMap3[ DevelImageVisual::Property::ATLASING ] = true;
+
+  ImageView imageView3 = ImageView::New();
+  imageView3.SetProperty( ImageView::Property::IMAGE, imageMap3 );
+
   application.GetPlatform().SetClosestImageSize(  Vector2(100, 100) );
   Stage::GetCurrent().Add( imageView3 );
 
index 721bfec..596d09a 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/devel-api/scripting/scripting.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 #include <dali/public-api/rendering/renderer.h>
 
 #include <test-native-image.h>
@@ -452,7 +453,15 @@ int UtcDaliImageViewAsyncLoadingWithAtlasing(void)
   callStack.Reset();
   callStack.Enable(true);
 
-  ImageView imageView = ImageView::New( gImage_34_RGBA, ImageDimensions( 34, 34 ) );
+  Property::Map imageMap;
+
+  imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
+  imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
+  imageMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
+  imageMap[ DevelImageVisual::Property::ATLASING] = true;
+
+  ImageView imageView = ImageView::New();
+  imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
 
   // By default, Aysnc loading is used
   // loading is not started if the actor is offStage
@@ -493,6 +502,7 @@ int UtcDaliImageViewAsyncLoadingWithAtlasing02(void)
   asyncLoadingMap[ "desiredHeight" ] = 34;
   asyncLoadingMap[ "desiredWidth" ] = 34;
   asyncLoadingMap[ "synchronousLoading" ] = false;
+  asyncLoadingMap[ "atlasing" ] = true;
 
   ImageView imageView = ImageView::New();
   imageView.SetProperty( ImageView::Property::IMAGE, asyncLoadingMap );
@@ -527,6 +537,7 @@ int UtcDaliImageViewSyncLoading(void)
 
   Property::Map syncLoadingMap;
   syncLoadingMap[ ImageVisual::Property::SYNCHRONOUS_LOADING ] = true;
+  syncLoadingMap[ DevelImageVisual::Property::ATLASING ] = true;
 
   // Sync loading, no atlasing for big size image
   {
@@ -536,6 +547,7 @@ int UtcDaliImageViewSyncLoading(void)
     syncLoadingMap[ ImageVisual::Property::URL ] = gImage_600_RGB;
     imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
 
+
     // BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
     BitmapLoader loader = BitmapLoader::GetLatestCreated();
     DALI_TEST_CHECK( loader );
@@ -598,6 +610,7 @@ int UtcDaliImageViewSyncLoading02(void)
     syncLoadingMap[ "desiredHeight" ] = 34;
     syncLoadingMap[ "desiredWidth" ] = 34;
     syncLoadingMap[ "synchronousLoading" ] = true;
+    syncLoadingMap[ "atlasing" ] = true;
     imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
 
     // loading is started even if the actor is offStage
index 5f53c6f..54185ff 100644 (file)
@@ -27,6 +27,8 @@
 #include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/text-controls/hidden-input-properties.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
 #include "toolkit-clipboard.h"
 
 using namespace Dali;
@@ -94,6 +96,8 @@ const char* const PROPERTY_NAME_INPUT_EMBOSS                         = "inputEmb
 const char* const PROPERTY_NAME_OUTLINE                              = "outline";
 const char* const PROPERTY_NAME_INPUT_OUTLINE                        = "inputOutline";
 
+const char* const PROPERTY_NAME_HIDDEN_INPUT_SETTINGS                = "hiddenInputSettings";
+
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
 const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
@@ -315,19 +319,39 @@ bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Ma
     {
       const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
 
-      Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
-      if( NULL != valueSet )
+      if( valueGet.first.type == Property::Key::STRING )
       {
-        if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+        Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
+        if( NULL != valueSet )
+        {
+          if( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() )
+          {
+            tet_printf( "  Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+            return false;
+          }
+        }
+        else
         {
-          tet_printf( "  Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
+          tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
           return false;
         }
       }
       else
       {
-        tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
-        return false;
+        Property::Value* valueSet = fontStyleMapSet.Find( valueGet.first.indexKey );
+        if( NULL != valueSet )
+        {
+          if( valueGet.second.Get<int>() != valueSet->Get<int>() )
+          {
+            tet_printf( "  Integer Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
+            return false;
+          }
+        }
+        else
+        {
+          tet_printf( "  The Int key %d doesn't exist.", valueGet.first.indexKey );
+          return false;
+        }
       }
     }
   }
@@ -474,6 +498,7 @@ int UtcDaliTextFieldGetPropertyP(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_EMBOSS ) == TextField::Property::INPUT_EMBOSS );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextField::Property::OUTLINE );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_OUTLINE ) == TextField::Property::INPUT_OUTLINE );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_HIDDEN_INPUT_SETTINGS ) == DevelTextField::Property::HIDDEN_INPUT_SETTINGS );
 
   END_TEST;
 }
@@ -795,6 +820,19 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( TextField::Property::INPUT_OUTLINE, "Outline input properties" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_OUTLINE ), std::string("Outline input properties"), TEST_LOCATION );
 
+  // Check the hidden input settings property
+  Property::Map hiddenMapSet;
+  Property::Map hiddenMapGet;
+  hiddenMapSet[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_ALL;
+  hiddenMapSet[ HiddenInput::Property::SHOW_DURATION ] = 2;
+  hiddenMapSet[ HiddenInput::Property::SUBSTITUTE_COUNT ] = 4;
+  hiddenMapSet[ HiddenInput::Property::SUBSTITUTE_CHARACTER ] = 0x23;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, hiddenMapSet );
+
+  hiddenMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::HIDDEN_INPUT_SETTINGS );
+  DALI_TEST_EQUALS( hiddenMapSet.Count(), hiddenMapGet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( hiddenMapSet, hiddenMapGet ), true, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1964,6 +2002,92 @@ int utcDaliTextFieldEvent08(void)
   END_TEST;
 }
 
+int utcDaliTextFieldEvent09(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldEvent09");
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  Stage::GetCurrent().Add( field );
+  LoadMarkerImages(application, field);
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  field.SetProperty( TextField::Property::TEXT, "Hello" );
+  field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+  // Create a tap event to touch the text field.
+  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  application.SendNotification();
+  application.Render();
+
+  Property::Map map;
+  map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_NONE;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down ) );
+  application.SendNotification();
+  application.Render();
+
+  map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_ALL;
+  map[ HiddenInput::Property::SUBSTITUTE_CHARACTER ] = 0x23;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down ) );
+  application.SendNotification();
+  application.Render();
+
+  map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_COUNT;
+  map[ HiddenInput::Property::SUBSTITUTE_COUNT ] = 2;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
+  for( unsigned int index = 0u; index < 5u; ++index )
+  {
+    application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down ) );
+    application.SendNotification();
+    application.Render();
+  }
+
+  map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::SHOW_COUNT;
+  map[ HiddenInput::Property::SUBSTITUTE_COUNT ] = 2;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
+  for( unsigned int index = 0u; index < 5u; ++index )
+  {
+    application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down ) );
+    application.SendNotification();
+    application.Render();
+  }
+
+  map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::SHOW_LAST_CHARACTER;
+  map[ HiddenInput::Property::SHOW_DURATION ] = 0;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
+  application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+  application.SendNotification();
+  application.Render();
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down ) );
+  application.SendNotification();
+  application.Render();
+
+  map[ HiddenInput::Property::SHOW_DURATION ] = 100;
+  field.SetProperty( DevelTextField::Property::HIDDEN_INPUT_SETTINGS, map );
+  application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down ) );
+  application.SendNotification();
+  application.Render();
+
+  Property::Map mapGet;
+  mapGet = field.GetProperty<Property::Map>( DevelTextField::Property::HIDDEN_INPUT_SETTINGS );
+  DALI_TEST_EQUALS( map.Count(), mapGet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( map, mapGet ), true, TEST_LOCATION );
+  END_TEST;
+}
+
+
 int utcDaliTextFieldStyleWhilstSelected(void)
 {
   ToolkitTestApplication application;
index 5234210..6a4bfa8 100644 (file)
@@ -31,22 +31,33 @@ namespace
 {
 
 const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
-const std::string DEFAULT_EN_LOCALE_DIR = "/tmp/locale/en/LC_MESSAGES/";
+static std::string gLocaleLang;
+static std::string gLocaleLanguage;
 
 }
 
 void dali_textselectionpopupmirroringltr_startup(void)
 {
-  // Cheat! Copy the .mo file
-  std::ifstream  src( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo.en" ).c_str(), std::ifstream::binary );
-  std::ofstream  dst( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo" ).c_str(), std::ofstream::binary );
-  dst << src.rdbuf();
+  // Keep the current locale environment.
+  char* langPtr = getenv( "LANG" );
+  gLocaleLang = std::string( langPtr );
+
+  char* languagePtr = getenv( "LANGUAGE" );
+  gLocaleLanguage = std::string( languagePtr );
+
+  // Set the locale environment to Arabic.
+  setenv( "LANG", "en_GB.UTF-8", 1 );
+  setenv( "LANGUAGE", "en_GB:en", 1 );
 
   test_return_value = TET_UNDEF;
 }
 
 void dali_textselectionpopupmirroringltr_cleanup(void)
 {
+  // Restore the locale environment.
+  setenv( "LANG", gLocaleLang.c_str(), 1 );
+  setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+
   test_return_value = TET_PASS;
 }
 
index 9d3e750..930e85e 100644 (file)
@@ -31,22 +31,33 @@ namespace
 {
 
 const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
-const std::string DEFAULT_EN_LOCALE_DIR = "/tmp/locale/en/LC_MESSAGES/";
+static std::string gLocaleLang;
+static std::string gLocaleLanguage;
 
 }
 
 void dali_textselectionpopupmirroringrtl_startup(void)
 {
-  // Cheat! Copy the .mo file
-  std::ifstream  src( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo.ar" ).c_str(), std::ifstream::binary );
-  std::ofstream  dst( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo" ).c_str(), std::ofstream::binary );
-  dst << src.rdbuf();
+  // Keep the current locale environment.
+  char* langPtr = getenv( "LANG" );
+  gLocaleLang = std::string( langPtr );
+
+  char* languagePtr = getenv( "LANGUAGE" );
+  gLocaleLanguage = std::string( languagePtr );
+
+  // Set the locale environment to Arabic.
+  setenv( "LANG", "ar_AE.UTF-8", 1 );
+  setenv( "LANGUAGE", "ar_AE:ar", 1 );
 
   test_return_value = TET_UNDEF;
 }
 
 void dali_textselectionpopupmirroringrtl_cleanup(void)
 {
+  // Restore the locale environment.
+  setenv( "LANG", gLocaleLang.c_str(), 1 );
+  setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+
   test_return_value = TET_PASS;
 }
 
@@ -59,7 +70,7 @@ int UtcDaliToolkitTextSelectionPopupMirroringRTL(void)
 
   ToolkitTestApplication application;
 
-  setlocale( LC_ALL, "en_GB.UTF-8" );
+  setlocale( LC_ALL, "ar_AE.UTF-8" );
   textdomain("dali-toolkit");
   bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR );
 
index 29c4cc7..4966804 100644 (file)
@@ -687,6 +687,7 @@ int UtcDaliVisualFactoryGetImageVisual3(void)
   propertyMap.Insert( ImageVisual::Property::PIXEL_AREA, pixelArea );
   propertyMap.Insert( ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT );
   propertyMap.Insert( ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT );
+  propertyMap.Insert( DevelImageVisual::Property::ATLASING, true );
 
   Visual::Base visual = factory.CreateVisual( propertyMap );
   DALI_TEST_CHECK( visual );
index 0e32717..3e4e246 100755 (executable)
@@ -19,13 +19,13 @@ BUILT_SOURCES = \
           $(dali_swig_dir)/automatic/cpp/dali_wrap.h \
           $(dali_swig_dir)/manual/cpp/keyboard_focus_manager_wrap.cpp \
           $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.cpp \
-          $(dali_swig_dir)/manual/cpp/callbackbase_wrap.cpp
+          $(dali_swig_dir)/manual/cpp/event-thread-callback-wrap.cpp
 
 all-local:
 gbs-local: libNDalic.so NDali.dll
 
-libNDalic.so: $(dali_swig_dir)/automatic/cpp/dali_wrap.o $(dali_swig_dir)/manual/cpp/keyboard_focus_manager_wrap.o $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.o $(dali_swig_dir)/manual/cpp/callbackbase_wrap.o
-       $(CXX) -shared $(dali_swig_dir)/automatic/cpp/dali_wrap.o $(dali_swig_dir)/manual/cpp/keyboard_focus_manager_wrap.o $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.o $(dali_swig_dir)/manual/cpp/callbackbase_wrap.o -o $(dali_swig_dir)/libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
+libNDalic.so: $(dali_swig_dir)/automatic/cpp/dali_wrap.o $(dali_swig_dir)/manual/cpp/keyboard_focus_manager_wrap.o $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.o $(dali_swig_dir)/manual/cpp/event-thread-callback-wrap.o
+       $(CXX) -shared $(dali_swig_dir)/automatic/cpp/dali_wrap.o $(dali_swig_dir)/manual/cpp/keyboard_focus_manager_wrap.o $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.o $(dali_swig_dir)/manual/cpp/event-thread-callback-wrap.o -o $(dali_swig_dir)/libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
 
 $(dali_swig_dir)/automatic/cpp/dali_wrap.o: $(BUILT_SOURCES)
        $(CXX) -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) $(dali_swig_dir)/automatic/cpp/dali_wrap.cpp -o $(dali_swig_dir)/automatic/cpp/dali_wrap.o
@@ -36,8 +36,8 @@ $(dali_swig_dir)/manual/cpp/keyboard_focus_manager_wrap.o: $(BUILT_SOURCES)
 $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.o: $(BUILT_SOURCES)
        $(CXX) -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.cpp -o $(dali_swig_dir)/manual/cpp/view-wrapper-impl-wrap.o
 
-$(dali_swig_dir)/manual/cpp/callbackbase_wrap.cpp.o: $(BUILT_SOURCES)
-       $(CXX) -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) $(dali_swig_dir)/manual/cpp/callbackbase_wrap.cpp -o $(dali_swig_dir)/manual/cpp/callbackbase_wrap.o
+$(dali_swig_dir)/manual/cpp/event-thread-callback-wrap.o: $(BUILT_SOURCES)
+       $(CXX) -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) $(dali_swig_dir)/manual/cpp/event-thread-callback-wrap.cpp -o $(dali_swig_dir)/manual/cpp/event-thread-callback-wrap.o
 
 NDali.dll: $(BUILT_SOURCES)
 #      mcs -nologo -target:library -out:$(dali_swig_dir)/NDali.dll $(dali_swig_dir)/automatic/csharp/*.cs $(dali_swig_dir)/manual/csharp/*.cs
diff --git a/dali-toolkit/devel-api/controls/text-controls/hidden-input-properties.h b/dali-toolkit/devel-api/controls/text-controls/hidden-input-properties.h
new file mode 100644 (file)
index 0000000..4cbafaa
--- /dev/null
@@ -0,0 +1,111 @@
+#ifndef __DALI_HIDDEN_TEXT_PROPERTIES_H__
+#define __DALI_HIDDEN_TEXT_PROPERTIES_H__
+
+/*
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace HiddenInput
+{
+
+/**
+ * @brief HiddenInput Property
+ * @SINCE_1_2.33
+ */
+namespace Property
+{
+
+/**
+ * @brief HiddenInput Property
+ * @SINCE_1_2.33
+ */
+enum
+{
+  /**
+   * @brief The mode for input text display.
+   * @details Name "mode", type HiddenInput::Mode or INTEGER.
+   * @SINCE_1_2.33
+   * @note Optional.
+   * @see HiddenInput::Mode
+   */
+  MODE,
+
+  /**
+   * @brief All input characters are substituted by this character.
+   * @details Name "substituteCharacter", type INTEGER.
+   * @SINCE_1_2.33
+   * @note Optional.
+   */
+  SUBSTITUTE_CHARACTER,
+
+  /**
+   * @brief Length of text to show or hide, available when HIDE_COUNT/SHOW_COUNT mode is used.
+   * @details Name "substituteCount", type INTEGER.
+   * @SINCE_1_2.33
+   * @note Optional.
+   */
+  SUBSTITUTE_COUNT,
+
+  /**
+   * @brief Hide last character after this duration, available when SHOW_LAST_CHARACTER mode.
+   * @details Name "showDuration", type INTEGER.
+   * @SINCE_1_2.33
+   * @note Optional.
+   */
+  SHOW_DURATION
+};
+
+} // namespace Property
+
+/**
+ * @brief The type for HiddenInput::Property::MODE.
+ * @SINCE_1_2.33
+ */
+namespace Mode
+{
+
+/**
+ * @brief The type for HiddenInput::Property::MODE.
+ * @SINCE_1_2.33
+ */
+enum Type
+{
+  HIDE_NONE,  ///< Don't hide text
+  HIDE_ALL,   ///< Hide all the input text
+  HIDE_COUNT,  ///< Hide n characters from start
+  SHOW_COUNT,  ///< Show n characters from start
+  SHOW_LAST_CHARACTER  ///< Show last character for the duration(use SHOW_DURATION property to modify duration)
+};
+
+} // namespace Mode
+
+} // namespace HiddenInput
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_HIDDEN_TEXT_PROPERTIES_H__
diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
new file mode 100644 (file)
index 0000000..eacd5aa
--- /dev/null
@@ -0,0 +1,102 @@
+#ifndef DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
+#define DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
+
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/text-controls/text-field.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelTextField
+{
+
+namespace Property
+{
+  enum Type
+  {
+      RENDERING_BACKEND = Dali::Toolkit::TextField::Property::RENDERING_BACKEND,
+      TEXT = Dali::Toolkit::TextField::Property::TEXT,
+      PLACEHOLDER_TEXT = Dali::Toolkit::TextField::Property::PLACEHOLDER_TEXT,
+      PLACEHOLDER_TEXT_FOCUSED = Dali::Toolkit::TextField::Property::PLACEHOLDER_TEXT_FOCUSED,
+      FONT_FAMILY = Dali::Toolkit::TextField::Property::FONT_FAMILY,
+      FONT_STYLE = Dali::Toolkit::TextField::Property::FONT_STYLE,
+      POINT_SIZE = Dali::Toolkit::TextField::Property::POINT_SIZE,
+      MAX_LENGTH = Dali::Toolkit::TextField::Property::MAX_LENGTH,
+      EXCEED_POLICY = Dali::Toolkit::TextField::Property::EXCEED_POLICY,
+      HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT,
+      VERTICAL_ALIGNMENT = Dali::Toolkit::TextField::Property::VERTICAL_ALIGNMENT,
+      TEXT_COLOR = Dali::Toolkit::TextField::Property::TEXT_COLOR,
+      PLACEHOLDER_TEXT_COLOR = Dali::Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR,
+      SHADOW_OFFSET = Dali::Toolkit::TextField::Property::SHADOW_OFFSET,
+      SHADOW_COLOR = Dali::Toolkit::TextField::Property::SHADOW_COLOR,
+      PRIMARY_CURSOR_COLOR = Dali::Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR,
+      SECONDARY_CURSOR_COLOR = Dali::Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR,
+      ENABLE_CURSOR_BLINK = Dali::Toolkit::TextField::Property::ENABLE_CURSOR_BLINK,
+      CURSOR_BLINK_INTERVAL = Dali::Toolkit::TextField::Property::CURSOR_BLINK_INTERVAL,
+      CURSOR_BLINK_DURATION = Dali::Toolkit::TextField::Property::CURSOR_BLINK_DURATION,
+      CURSOR_WIDTH = Dali::Toolkit::TextField::Property::CURSOR_WIDTH,
+      GRAB_HANDLE_IMAGE = Dali::Toolkit::TextField::Property::GRAB_HANDLE_IMAGE,
+      GRAB_HANDLE_PRESSED_IMAGE = Dali::Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE,
+      SCROLL_THRESHOLD = Dali::Toolkit::TextField::Property::SCROLL_THRESHOLD,
+      SCROLL_SPEED = Dali::Toolkit::TextField::Property::SCROLL_SPEED,
+      SELECTION_HANDLE_IMAGE_LEFT = Dali::Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT,
+      SELECTION_HANDLE_IMAGE_RIGHT = Dali::Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT,
+      SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Dali::Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT,
+      SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Dali::Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT,
+      SELECTION_HANDLE_MARKER_IMAGE_LEFT = Dali::Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT,
+      SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Dali::Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT,
+      SELECTION_HIGHLIGHT_COLOR = Dali::Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR,
+      DECORATION_BOUNDING_BOX = Dali::Toolkit::TextField::Property::DECORATION_BOUNDING_BOX,
+      INPUT_METHOD_SETTINGS = Dali::Toolkit::TextField::Property::INPUT_METHOD_SETTINGS,
+      INPUT_COLOR = Dali::Toolkit::TextField::Property::INPUT_COLOR,
+      ENABLE_MARKUP = Dali::Toolkit::TextField::Property::ENABLE_MARKUP,
+      INPUT_FONT_FAMILY = Dali::Toolkit::TextField::Property::INPUT_FONT_FAMILY,
+      INPUT_FONT_STYLE = Dali::Toolkit::TextField::Property::INPUT_FONT_STYLE,
+      INPUT_POINT_SIZE = Dali::Toolkit::TextField::Property::INPUT_POINT_SIZE,
+      UNDERLINE = Dali::Toolkit::TextField::Property::UNDERLINE,
+      INPUT_UNDERLINE = Dali::Toolkit::TextField::Property::INPUT_UNDERLINE,
+      SHADOW = Dali::Toolkit::TextField::Property::SHADOW,
+      INPUT_SHADOW = Dali::Toolkit::TextField::Property::INPUT_SHADOW,
+      EMBOSS = Dali::Toolkit::TextField::Property::EMBOSS,
+      INPUT_EMBOSS = Dali::Toolkit::TextField::Property::INPUT_EMBOSS,
+      OUTLINE = Dali::Toolkit::TextField::Property::OUTLINE,
+      INPUT_OUTLINE = Dali::Toolkit::TextField::Property::INPUT_OUTLINE,
+
+      /**
+       * @brief Hides the input characters and instead shows a default character for password or pin entry.
+       * @details name "hiddenInputSettings", type map.
+       * @SINCE_1_2.33
+       * @note Optional.
+       * @see HiddenInput
+       */
+      HIDDEN_INPUT_SETTINGS = INPUT_OUTLINE + 1,
+  };
+} // namespace Property
+
+} // namespace DevelText
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
old mode 100755 (executable)
new mode 100644 (file)
index 7e66e66..d7c45f5
@@ -129,7 +129,9 @@ devel_api_super_blur_view_header_files = \
   $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.h
 
 devel_api_text_controls_header_files = \
+  $(devel_api_src_dir)/controls/text-controls/hidden-input-properties.h \
   $(devel_api_src_dir)/controls/text-controls/text-editor-devel.h \
+  $(devel_api_src_dir)/controls/text-controls/text-field-devel.h \
   $(devel_api_src_dir)/controls/text-controls/text-selection-popup.h \
   $(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.h
 
index 18885a8..36a78d7 100644 (file)
@@ -69,7 +69,7 @@ public:
  * @param[in] interface The user's implementation of CustomAlgorithmInterface
  * @see DevelKeyboardFocusManager::CustomAlgorithmInterface
  */
-void SetCustomAlgorithm(KeyboardFocusManager keyboardFocusManager, CustomAlgorithmInterface& interface);
+DALI_IMPORT_API void SetCustomAlgorithm(KeyboardFocusManager keyboardFocusManager, CustomAlgorithmInterface& interface);
 
 } // namespace DevelKeyboardFocusManager
 
index eb2ac49..d2622da 100644 (file)
@@ -55,6 +55,15 @@ enum Type
    * @note For N-Patch images only.
    */
   BORDER = WRAP_MODE_V + 1,
+
+  /**
+   * @brief Whether to use the texture atlas
+   * @details Name "atlasing", type Property::BOOLEAN, true to enable texture atlas
+   *
+   * @note Optional. By default atlasing is off.
+   */
+
+  ATLASING = WRAP_MODE_V + 2,
 };
 
 } //namespace Property
index 2e300b1..a7bfc38 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
+#include <dali/devel-api/object/property-helper-devel.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/adaptors/adaptor.h>
 #include <dali/integration-api/debug.h>
@@ -32,6 +33,7 @@
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
@@ -135,6 +137,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "emboss",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputEmboss",                          MAP,       INPUT_EMBOSS                         )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "outline",                              MAP,       OUTLINE                              )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "inputOutline",                         MAP,       INPUT_OUTLINE                        )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "hiddenInputSettings",            MAP,       HIDDEN_INPUT_SETTINGS                )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached",   SIGNAL_MAX_LENGTH_REACHED )
@@ -723,6 +726,15 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::DevelTextField::Property::HIDDEN_INPUT_SETTINGS:
+      {
+        const Property::Map* map = value.GetMap();
+        if (map)
+        {
+          impl.mController->SetHiddenInputOption(*map);
+        }
+        break;
+      }
     } // switch
   } // textfield
 }
@@ -1086,6 +1098,13 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         GetOutlineProperties( impl.mController, value, Text::EffectStyle::INPUT );
         break;
       }
+      case Toolkit::DevelTextField::Property::HIDDEN_INPUT_SETTINGS:
+      {
+        Property::Map map;
+        impl.mController->GetHiddenInputOption(map);
+        value = map;
+        break;
+      }
     } //switch
   }
 
old mode 100755 (executable)
new mode 100644 (file)
index 12c2274..0799c9e
@@ -111,6 +111,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/text/markup-processor-font.cpp \
    $(toolkit_src_dir)/text/markup-processor-helper-functions.cpp \
    $(toolkit_src_dir)/text/multi-language-support.cpp \
+   $(toolkit_src_dir)/text/hidden-text.cpp \
    $(toolkit_src_dir)/text/property-string-parser.cpp \
    $(toolkit_src_dir)/text/segmentation.cpp \
    $(toolkit_src_dir)/text/shaper.cpp \
diff --git a/dali-toolkit/internal/text/hidden-text.cpp b/dali-toolkit/internal/text/hidden-text.cpp
new file mode 100644 (file)
index 0000000..f938430
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/hidden-text.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
+
+using namespace Dali::Toolkit;
+
+const uint32_t STAR = 0x2A;   // Set default substitute character as '*'
+const int DEFAULT_SHOW_DURATION = 1000;
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+const char * const PROPERTY_MODE                      = "mode";
+const char * const PROPERTY_SUBSTITUTE_CHARACTER      = "substituteCharacter";
+const char * const PROPERTY_SUBSTITUTE_COUNT          = "substituteCount";
+const char * const PROPERTY_SHOW_DURATION             = "showDuration";
+
+HiddenText::HiddenText( Observer* observer )
+: mObserver( observer ),
+  mHideMode( static_cast< int >( Toolkit::HiddenInput::Mode::HIDE_NONE ) ),
+  mSubstituteText( STAR ),
+  mDisplayDuration( DEFAULT_SHOW_DURATION ),
+  mSubstituteCount( 0 ),
+  mPreviousTextCount( 0 )
+{
+  mTimer = Timer::New( mDisplayDuration );
+  mTimer.TickSignal().Connect( this, &HiddenText::OnTick );
+}
+
+void HiddenText::SetProperties( const Property::Map& map )
+{
+    const Property::Map::SizeType count = map.Count();
+
+    for ( Property::Map::SizeType position = 0; position < count; ++position )
+    {
+      KeyValuePair keyValue = map.GetKeyValue( position );
+      Property::Key& key = keyValue.first;
+      Property::Value& value = keyValue.second;
+
+      if( key == Toolkit::HiddenInput::Property::MODE || key == PROPERTY_MODE )
+      {
+        value.Get( mHideMode );
+      }
+      else if( key == Toolkit::HiddenInput::Property::SUBSTITUTE_CHARACTER || key == PROPERTY_SUBSTITUTE_CHARACTER )
+      {
+        value.Get( mSubstituteText );
+      }
+      else if( key == Toolkit::HiddenInput::Property::SUBSTITUTE_COUNT || key == PROPERTY_SUBSTITUTE_COUNT )
+      {
+        value.Get( mSubstituteCount );
+      }
+      else if( key == Toolkit::HiddenInput::Property::SHOW_DURATION || key == PROPERTY_SHOW_DURATION )
+      {
+        value.Get( mDisplayDuration );
+      }
+    }
+}
+
+void HiddenText::GetProperties( Property::Map& map )
+{
+  map[Toolkit::HiddenInput::Property::MODE] = mHideMode;
+  map[Toolkit::HiddenInput::Property::SUBSTITUTE_CHARACTER] = mSubstituteText;
+  map[Toolkit::HiddenInput::Property::SUBSTITUTE_COUNT] = mSubstituteCount;
+  map[Toolkit::HiddenInput::Property::SHOW_DURATION] = mDisplayDuration;
+}
+
+void HiddenText::Substitute( const Vector<Character>& source, Vector<Character>& destination )
+{
+  const Length characterCount = source.Count();
+
+  destination.Resize( characterCount );
+
+  uint32_t* begin = destination.Begin();
+  uint32_t* end = begin + characterCount;
+  uint32_t* hideStart = NULL;
+  uint32_t* hideEnd = NULL;
+  uint32_t* sourcePos = source.Begin();
+
+  switch ( mHideMode )
+  {
+    case Toolkit::HiddenInput::Mode::HIDE_NONE:
+    {
+      hideStart = NULL;
+      hideEnd = NULL;
+      break;
+    }
+    case Toolkit::HiddenInput::Mode::HIDE_ALL:
+    {
+      hideStart = begin;
+      hideEnd = end;
+      break;
+    }
+    case Toolkit::HiddenInput::Mode::HIDE_COUNT:
+    {
+      hideStart = begin;
+      hideEnd = begin + mSubstituteCount;
+      break;
+    }
+    case Toolkit::HiddenInput::Mode::SHOW_COUNT:
+    {
+      hideStart = begin + mSubstituteCount;
+      hideEnd = end;
+      break;
+    }
+    case Toolkit::HiddenInput::Mode::SHOW_LAST_CHARACTER:
+    {
+      if (mPreviousTextCount < characterCount)
+      {
+        hideStart = begin;
+        hideEnd = end-1;
+        if ( mDisplayDuration > 0 )
+        {
+          mTimer.SetInterval( mDisplayDuration );
+          mTimer.Start();
+        }
+        else
+        {
+          OnTick();
+        }
+      }
+      else
+      {
+        hideStart = begin;
+        hideEnd = end;
+      }
+      break;
+    }
+  }
+  for (; begin < end; ++begin )
+  {
+    if (begin >= hideStart && begin < hideEnd)
+    {
+      *begin = static_cast<uint32_t>(mSubstituteText);
+      sourcePos++;
+    }
+    else
+    {
+      *begin = *sourcePos++;
+    }
+  }
+  mPreviousTextCount = characterCount;
+}
+
+bool HiddenText::OnTick()
+{
+  if( mObserver != NULL )
+  {
+    mObserver->DisplayTimeExpired();
+  }
+
+  return false;
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/text/hidden-text.h b/dali-toolkit/internal/text/hidden-text.h
new file mode 100644 (file)
index 0000000..10d1f54
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef __DALI_HIDDEN_TEXT_H__
+#define __DALI_HIDDEN_TEXT_H__
+
+/*
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/public-api/object/property-map.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/text-controls/hidden-input-properties.h>
+#include <dali-toolkit/internal/text/text-definitions.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * Class to handle the hidden text
+ */
+class HiddenText : public ConnectionTracker
+{
+public:
+  class Observer
+  {
+  public:
+
+    /**
+     * @brief Invoked when the time to show last character is expired
+     */
+    virtual void DisplayTimeExpired() = 0;
+  };
+
+  /**
+   * @brief Constructor
+   * @param[in] observer The Observer pointer.
+   */
+  HiddenText( Observer* observer );
+
+public: // Intended for internal use
+
+  /**
+   * @brief Used to set options of hidden text
+   * @param[in] map The property map describing the option
+   */
+  void SetProperties( const Property::Map& map );
+
+  /**
+   * @brief Retrieve property map of hidden text options
+   * @param[out] map The hidden text option
+   */
+  void GetProperties( Property::Map& map );
+
+  /**
+   * @brief Convert source text to destination text according to current option
+   * @param[in] source The original text
+   * @param[out] destination The applied text
+   */
+  void Substitute( const Vector<Character>& source, Vector<Character>& destination );
+
+  /**
+   * @brief Invoked when the timer is expired
+   */
+  bool OnTick();
+
+private:
+
+  Timer mTimer;
+  Observer* mObserver;
+  int mHideMode;
+  int mSubstituteText;
+  int mDisplayDuration;
+  int mSubstituteCount;
+  Length mPreviousTextCount;
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_HIDDEN_TEXT_H__
index 05f3536..d09e1ed 100644 (file)
@@ -55,7 +55,6 @@ struct SelectionBoxInfo
 const float MAX_FLOAT = std::numeric_limits<float>::max();
 const float MIN_FLOAT = std::numeric_limits<float>::min();
 const Dali::Toolkit::Text::CharacterDirection LTR = false; ///< Left To Right direction
-const uint32_t STAR = 0x2A;
 
 } // namespace
 
@@ -789,24 +788,16 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired )
     return false;
   }
 
-  Vector<Character> utf32CharactersStar;
-  const Length characterCount = mModel->mLogicalModel->mText.Count();
-  const bool isPasswordInput = ( mEventData != NULL && mEventData->mPasswordInput &&
-        !mEventData->mIsShowingPlaceholderText && characterCount > 0 );
-
-  if (isPasswordInput)
+  Vector<Character>& srcCharacters = mModel->mLogicalModel->mText;
+  Vector<Character> displayCharacters;
+  bool useHiddenText = false;
+  if ( mHiddenInput && mEventData != NULL && !mEventData->mIsShowingPlaceholderText)
   {
-    utf32CharactersStar.Resize( characterCount );
-
-    uint32_t* begin = utf32CharactersStar.Begin();
-    uint32_t* end = begin + characterCount;
-    while ( begin < end )
-    {
-      *begin++ = STAR;
-    }
+    mHiddenInput->Substitute( srcCharacters,displayCharacters );
+    useHiddenText = true;
   }
 
-  Vector<Character>& utf32Characters = isPasswordInput ? utf32CharactersStar : mModel->mLogicalModel->mText;
+  Vector<Character>& utf32Characters = useHiddenText ? displayCharacters : srcCharacters;
   const Length numberOfCharacters = utf32Characters.Count();
 
   // Index to the first character of the first paragraph to be updated.
index 37e5e5f..f317fb3 100644 (file)
@@ -309,6 +309,7 @@ struct Controller::Impl
     mTextUpdateInfo(),
     mOperationsPending( NO_OPERATION ),
     mMaximumNumberOfCharacters( 50u ),
+    mHiddenInput( NULL ),
     mRecalculateNaturalSize( true ),
     mMarkupProcessorEnabled( false ),
     mClipboardHideEnabled( true ),
@@ -333,6 +334,8 @@ struct Controller::Impl
 
   ~Impl()
   {
+    delete mHiddenInput;
+
     delete mFontDefaults;
     delete mUnderlineDefaults;
     delete mShadowDefaults;
@@ -710,6 +713,7 @@ public:
   TextUpdateInfo mTextUpdateInfo;          ///< Info of the characters updated.
   OperationsMask mOperationsPending;       ///< Operations pending to be done to layout the text.
   Length mMaximumNumberOfCharacters;       ///< Maximum number of characters that can be inserted.
+  HiddenText* mHiddenInput;                ///< Avoid allocating this when the user does not specify hidden input mode.
 
   bool mRecalculateNaturalSize:1;          ///< Whether the natural size needs to be recalculated.
   bool mMarkupProcessorEnabled:1;          ///< Whether the mark-up procesor is enabled.
index b79430a..d18f556 100644 (file)
@@ -1550,6 +1550,23 @@ bool Controller::GetTextScrollInfo( float& scrollPosition, float& controlHeight,
   return isScrolled;
 }
 
+void Controller::SetHiddenInputOption(const Property::Map& options )
+{
+  if( NULL == mImpl->mHiddenInput )
+  {
+    mImpl->mHiddenInput = new HiddenText( this );
+  }
+  mImpl->mHiddenInput->SetProperties(options);
+}
+
+void Controller::GetHiddenInputOption(Property::Map& options )
+{
+  if( NULL != mImpl->mHiddenInput )
+  {
+    mImpl->mHiddenInput->GetProperties(options);
+  }
+}
+
 // public : Relayout.
 
 Controller::UpdateTextType Controller::Relayout( const Size& size )
@@ -2301,6 +2318,15 @@ void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Butt
   }
 }
 
+void Controller::DisplayTimeExpired()
+{
+  mImpl->mEventData->mUpdateCursorPosition = true;
+  // Apply modifications to the model
+  mImpl->mOperationsPending = ALL_OPERATIONS;
+
+  mImpl->RequestRelayout();
+}
+
 // private : Update.
 
 void Controller::InsertText( const std::string& text, Controller::InsertType type )
index 5005d8e..96856ef 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
+#include <dali-toolkit/internal/text/hidden-text.h>
 #include <dali-toolkit/internal/text/text-model-interface.h>
 
 namespace Dali
@@ -56,7 +57,7 @@ typedef IntrusivePtr<Controller> ControllerPtr;
  *
  * The text selection popup button callbacks are as well handled via the TextSelectionPopupCallbackInterface interface.
  */
-class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface
+class Controller : public RefObject, public Decorator::ControllerInterface, public TextSelectionPopupCallbackInterface, public HiddenText::Observer
 {
 public: // Enumerated types.
 
@@ -347,7 +348,7 @@ public: // Configure the text controller.
   /**
    * @brief Sets input type to password
    *
-   * @note The string is displayed continuous "*"
+   * @note The string is displayed hidden character
    *
    * @param[in] passwordInput True if password input is enabled.
    */
@@ -887,6 +888,16 @@ public: // Queries & retrieves.
    */
   bool GetTextScrollInfo( float& scrollPosition, float& controlHeight, float& layoutHeight );
 
+  /**
+   * @brief Used to set the hidden input option
+   */
+  void SetHiddenInputOption( const Property::Map& options );
+
+  /**
+   * @brief Used to get the hidden input option
+   */
+  void GetHiddenInputOption( Property::Map& options );
+
 public: // Relayout.
 
   /**
@@ -1002,6 +1013,13 @@ protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface.
    */
   virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button );
 
+protected: // Inherit from HiddenText.
+
+  /**
+   * @brief Invoked from HiddenText when showing time of the last character was expired
+   */
+  virtual void DisplayTimeExpired();
+
 private: // Update.
 
   /**
index 49e2c00..3c82d75 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL HEADERS
 #include <cstring> // for strlen()
+#include <dali/public-api/actors/layer.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/images/native-image.h>
 #include <dali/devel-api/images/texture-set-image.h>
@@ -31,6 +32,7 @@
 
 // INTERNAL HEADERS
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
@@ -58,6 +60,7 @@ const char * const IMAGE_SAMPLING_MODE( "samplingMode" );
 const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
 const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
 const char * const SYNCHRONOUS_LOADING( "synchronousLoading" );
+const char * const IMAGE_ATLASING("atlasing");
 
 // fitting modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN( FITTING_MODE )
@@ -91,31 +94,39 @@ const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
 
 const char* DEFAULT_SAMPLER_TYPENAME = "sampler2D";
 
+const float PIXEL_ALIGN_ON = 1.0f;
+const float PIXEL_ALIGN_OFF = 0.0f;
+
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
-  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump mat4 uModelMatrix;\n
+  uniform mediump mat4 uViewMatrix;\n
+  uniform mediump mat4 uProjection;\n
   uniform mediump vec3 uSize;\n
   uniform mediump vec4 pixelArea;
   varying mediump vec2 vTexCoord;\n
+  uniform lowp float uPixelAligned;\n
   \n
-
   //Visual size and offset
   uniform mediump vec2 offset;\n
   uniform mediump vec2 size;\n
   uniform mediump vec4 offsetSizeMode;\n
   uniform mediump vec2 origin;\n
   uniform mediump vec2 anchorPoint;\n
-
+\n
   vec4 ComputeVertexPosition()\n
   {\n
     vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n
     vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n
     return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );\n
   }\n
-
+\n
   void main()\n
   {\n
-    mediump vec4 vertexPosition = uMvpMatrix * ComputeVertexPosition();\n
+    mediump vec4 vertexPosition = uViewMatrix * uModelMatrix * ComputeVertexPosition();\n
+    vec4 alignedVertexPosition = vertexPosition;\n
+    alignedVertexPosition.xy = floor ( vertexPosition.xy );\n // Pixel alignment
+    vertexPosition = uProjection * mix( vertexPosition, alignedVertexPosition, uPixelAligned );\n
     vTexCoord = pixelArea.xy+pixelArea.zw*(aPosition + vec2(0.5) );\n
     gl_Position = vertexPosition;\n
   }\n
@@ -253,7 +264,8 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
   mFittingMode( fittingMode ),
   mSamplingMode( samplingMode ),
   mWrapModeU( WrapMode::DEFAULT ),
-  mWrapModeV( WrapMode::DEFAULT )
+  mWrapModeV( WrapMode::DEFAULT ),
+  mAttemptAtlasing( false )
 {
 }
 
@@ -268,7 +280,8 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, const Image& image )
   mFittingMode( FittingMode::DEFAULT ),
   mSamplingMode( SamplingMode::DEFAULT ),
   mWrapModeU( WrapMode::DEFAULT ),
-  mWrapModeV( WrapMode::DEFAULT )
+  mWrapModeV( WrapMode::DEFAULT ),
+  mAttemptAtlasing( false )
 {
 }
 
@@ -320,10 +333,14 @@ void ImageVisual::DoSetProperties( const Property::Map& propertyMap )
       {
         DoSetProperty( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, keyValue.second );
       }
+      else if ( keyValue.first == IMAGE_ATLASING )
+      {
+        DoSetProperty( Toolkit::DevelImageVisual::Property::ATLASING, keyValue.second );
+      }
     }
   }
 
-  if( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING && mImageUrl.IsValid() )
+  if( ( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING ) && mImageUrl.IsValid() )
   {
     // if sync loading is required, the loading should start
     // immediately when new image url is set or the actor is off stage
@@ -423,6 +440,12 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v
       mWrapModeV = Dali::WrapMode::Type( wrapMode );
       break;
     }
+
+    case Toolkit::DevelImageVisual::Property::ATLASING:
+    {
+      bool atlasing = false;
+      mAttemptAtlasing = value.Get( atlasing );
+    }
   }
 }
 
@@ -483,6 +506,8 @@ void ImageVisual::CreateRenderer( TextureSet& textures )
     }
   }
 
+  shader.RegisterProperty( PIXEL_ALIGNED_UNIFORM_NAME, PIXEL_ALIGN_ON ); // Set default to align
+
   mImpl->mRenderer = Renderer::New( geometry, shader );
   DALI_ASSERT_DEBUG( textures );
   mImpl->mRenderer.SetTextures( textures );
@@ -628,7 +653,7 @@ void ImageVisual::InitializeRenderer()
     Vector4 atlasRect;
     // texture set has to be created first as we need to know if atlasing succeeded or not
     // when selecting the shader
-    TextureSet textures = CreateTextureSet( atlasRect, IsSynchronousResourceLoading(), true );
+    TextureSet textures = CreateTextureSet( atlasRect, IsSynchronousResourceLoading(), mAttemptAtlasing );
     CreateRenderer( textures );
 
     if( mImpl->mFlags & Impl::IS_ATLASING_APPLIED ) // the texture is packed inside atlas
@@ -702,6 +727,14 @@ void ImageVisual::DoSetOnStage( Actor& actor )
 
   mPlacementActor = actor;
 
+  // Search the Actor tree to find if Layer UI behaviour set.
+  Layer layer = actor.GetLayer();
+  if ( layer && layer.GetBehavior() == Layer::LAYER_3D )
+  {
+     // Layer 3D set, do not align pixels
+     mImpl->mRenderer.RegisterProperty( PIXEL_ALIGNED_UNIFORM_NAME, PIXEL_ALIGN_OFF );
+  }
+
   if( mPixelArea != FULL_TEXTURE_RECT )
   {
     mImpl->mRenderer.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, mPixelArea );
@@ -761,6 +794,8 @@ void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( Toolkit::ImageVisual::Property::PIXEL_AREA, mPixelArea );
   map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_U, mWrapModeU );
   map.Insert( Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV );
+
+  map.Insert( Toolkit::DevelImageVisual::Property::ATLASING, mAttemptAtlasing );
 }
 
 void ImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
index 83fd71c..f771f6d 100644 (file)
@@ -90,6 +90,9 @@ typedef IntrusivePtr< ImageVisual > ImageVisualPtr;
  *   "DONT_CARE"
  *   "DEFAULT"
  *
+ *
+ * If the Visual is in a LayerUI it will pixel align the image, using a Layer3D will disable pixel alignment.
+ * Changing layer behaviour between LayerUI to Layer3D whilst the visual is already staged will not have an effect.
  */
 class ImageVisual: public Visual::Base, public ConnectionTracker, public AtlasUploadObserver
 {
@@ -320,6 +323,8 @@ private:
   Dali::WrapMode::Type mWrapModeU:3;
   Dali::WrapMode::Type mWrapModeV:3;
 
+  bool mAttemptAtlasing:1; // If true will attempt atlasing, otherwise create unique texture
+
 };
 
 } // namespace Internal
index a7a3e2c..1fc3272 100644 (file)
@@ -79,6 +79,7 @@ const char * const WRAP_MODE_UNIFORM_NAME( "wrapMode" );
 const char * const IMAGE_WRAP_MODE_U("wrapModeU");
 const char * const IMAGE_WRAP_MODE_V("wrapModeV");
 const char * const IMAGE_BORDER( "border" );
+const char * const PIXEL_ALIGNED_UNIFORM_NAME( "uPixelAligned" );
 
 // Text visual
 const char * const TEXT_PROPERTY( "text" );
index 9817b7a..d57733c 100644 (file)
@@ -66,6 +66,8 @@ extern const char * const WRAP_MODE_UNIFORM_NAME;
 extern const char * const IMAGE_WRAP_MODE_U;
 extern const char * const IMAGE_WRAP_MODE_V;
 extern const char * const IMAGE_BORDER;
+extern const char * const PIXEL_ALIGNED_UNIFORM_NAME;
+
 
 // Text visual
 extern const char * const TEXT_PROPERTY;
index 0b257b2..33f5008 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 32;
+const unsigned int TOOLKIT_MICRO_VERSION = 33;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index bde72c9..a9e934e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.32
+Version:    1.2.33
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT
@@ -131,9 +131,6 @@ rm -rf %{buildroot}
 cd build/tizen
 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
 
-# LICENSE
-mkdir -p %{buildroot}/usr/share/license
-cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
 
 # PO
 {
@@ -174,7 +171,7 @@ exit 0
 %{dali_toolkit_image_files}/*
 %{dali_toolkit_sound_files}/*
 %{dali_toolkit_style_files}/*
-%{_datadir}/license/%{name}
+%license LICENSE
 %{_datadir}/locale/*/LC_MESSAGES/*
 
 %files devel
index 2ed3252..526fc62 100755 (executable)
@@ -23,8 +23,8 @@ if BUILD_MCS
 
 all-local: libNDalic.so NDali.dll
 
-libNDalic.so: automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/callbackbase_wrap.o manual/cpp/devel-property-wrap.o
-       g++ -shared automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/callbackbase_wrap.o manual/cpp/devel-property-wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
+libNDalic.so: automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/event-thread-callback-wrap.o manual/cpp/devel-property-wrap.o
+       g++ -shared automatic/cpp/dali_wrap.o manual/cpp/keyboard_focus_manager_wrap.o manual/cpp/view-wrapper-impl-wrap.o manual/cpp/event-thread-callback-wrap.o manual/cpp/devel-property-wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
 
 automatic/cpp/dali_wrap.o: $(BUILT_SOURCES)
        g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) automatic/cpp/dali_wrap.cpp -o automatic/cpp/dali_wrap.o
@@ -35,8 +35,8 @@ manual/cpp/keyboard_focus_manager_wrap.o: $(BUILT_SOURCES)
 manual/cpp/view-wrapper-impl-wrap.o: $(BUILT_SOURCES)
        g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) manual/cpp/view-wrapper-impl-wrap.cpp -o manual/cpp/view-wrapper-impl-wrap.o
 
-manual/cpp/callbackbase_wrap.o: $(BUILT_SOURCES)
-       g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) manual/cpp/callbackbase_wrap.cpp -o manual/cpp/callbackbase_wrap.o
+manual/cpp/event-thread-callback-wrap.o: $(BUILT_SOURCES)
+       g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) manual/cpp/event-thread-callback-wrap.cpp -o manual/cpp/event-thread-callback-wrap.o
 
 manual/cpp/devel-property-wrap.o: $(BUILT_SOURCES)
        g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) manual/cpp/devel-property-wrap.cpp -o manual/cpp/devel-property-wrap.o
index 3db23f4..3050ae7 100644 (file)
     // Callback for Application InitSignal
     private void OnApplicationInit(IntPtr data)
     {
+      // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
+      DisposeQueue.Instance.Initialize();
+
       NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
 
       // Populate all members of "e" (NUIApplicationInitEventArgs) with real data
       return ret;
     }
 
-    public bool AddIdle(System.Delegate func) {
-      System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
-      System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
-
-      bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));
-
-      if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    }
-
     %}
     %enddef
 
index b9e9c95..0d7f7b7 100644 (file)
 
 %define DALI_RECTANGLE_PROPERTY_PARAM(NameSpace,ClassName)
   %typemap(cscode) NameSpace::ClassName %{
+    public Rectangle(float x, float y, float width, float height) : this( (int)x, (int)y, (int)width, (int)height )
+    {
+    }
+
     public static bool operator ==(Rectangle a, Rectangle b)
     {
         // If both are null, or both are same instance, return true.
         return !(a == b);
     }
 
-    ///< X position of the rectangle
-    public int X
+    ///< X position of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float X
     {
         set
         {
-            x = value;
+            x = (int)( value );
         }
         get
         {
         }
     }
 
-    ///< Y position of the rectangle
-    public int Y
+    ///< Y position of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float Y
     {
         set
         {
-            y = value;
+            y = (int)( value );
         }
         get
         {
         }
     }
 
-    ///< Width of the rectangle
-    public int Width
+    ///< Width of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float Width
     {
         set
         {
-            width = value;
+            width = (int)( value );
         }
         get
         {
         }
     }
 
-    ///< Height of the rectangle
-    public int Height
+    ///< Height of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float Height
     {
         set
         {
-            height = value;
+            height = (int)( value );
         }
         get
         {
index 3ec656e..39b7641 100755 (executable)
@@ -1,19 +1,18 @@
-/*
- * 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.
- *
- */
+/** 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.
+*
+*/
 
 using System;
 using System.Runtime.InteropServices;
@@ -21,32 +20,32 @@ using Dali;
 
 namespace MyCSharpExample
 {
-  class Example
-  {
-    // This is simple structure to contain Control name and implement state at once
-    // name : control name
-    // isImplemented : the state which the control is implemented in public or not
-    private struct Item
+    class Example
     {
-      public String name;
-      public bool isImplemented;
-
-      public Item(String name, bool isImplemented)
-      {
-        this.name = name;
-        this.isImplemented = isImplemented;
-      }
-    }
+        // This is simple structure to contain Control name and implement state at once
+        // name : control name
+        // isImplemented : the state which the control is implemented in public or not
+        private struct Item
+        {
+            public String name;
+            public bool isImplemented;
 
-    private Dali.Application _application;
-    private TableView _contentContainer;
-    private Timer _timer;
-    private Stage _stage;
-    private Popup _popup;
-    private ProgressBar _progressBar;
+            public Item(String name, bool isImplemented)
+            {
+                this.name = name;
+                this.isImplemented = isImplemented;
+            }
+        }
 
-    // List of items
-    private Item[] mViewList = {
+        private Dali.Application _application;
+        private TableView _contentContainer;
+        private Timer _timer;
+        private Stage _stage;
+        private Popup _popup;
+        private ProgressBar _progressBar;
+
+        // List of items
+        private Item[] mViewList = {
       new Item("PushButton", true),  new Item("DropDown", false),    new Item("Toggle", true),
       new Item("InputField", false),  new Item("AnimateGif", false),  new Item("Loading", false),
       new Item("ProgressBar", true), new Item("CheckBox", false),    new Item("RadioButton", true),
@@ -54,419 +53,427 @@ namespace MyCSharpExample
       new Item("ItemView", false),    new Item("CheckBox", true)
     };
 
-    public Example(Dali.Application application)
-    {
-      _application = application;
-      _application.Initialized += OnInitialize;
-    }
-
-    public void OnInitialize(object source, NUIApplicationInitEventArgs e)
-    {
-      Console.WriteLine("Customized Application Initialize event handler");
-      _stage = Stage.GetCurrent();
-      _stage.BackgroundColor = Color.White;
-
-      // Top label
-      TextLabel topLabel = new TextLabel();
-      topLabel.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-      topLabel.SetResizePolicy(ResizePolicyType.SIZE_RELATIVE_TO_PARENT, DimensionType.HEIGHT);
-      topLabel.AnchorPoint = NDalic.AnchorPointTopCenter;
-      topLabel.ParentOrigin = NDalic.ParentOriginTopCenter;
-      topLabel.SetSizeModeFactor(new Vector3( 0.0f, 0.1f, 0.0f ) );
-      topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
-      topLabel.TextColor = NDalic.WHITE;
-      topLabel.Text = " DALi Views";
-      topLabel.HorizontalAlignment = "BEGIN";
-      topLabel.VerticalAlignment = "CENTER";
-      topLabel.PointSize = 42.0f;
-      _stage.Add(topLabel);
-
-      // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right )
-      _contentContainer = new TableView(6, 5);
-      _contentContainer.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-      _contentContainer.SetResizePolicy(ResizePolicyType.SIZE_RELATIVE_TO_PARENT, DimensionType.HEIGHT);
-      _contentContainer.SetSizeModeFactor(new Vector3( 0.0f, 0.9f, 0.0f ) );
-      _contentContainer.AnchorPoint = NDalic.AnchorPointBottomCenter;
-      _contentContainer.ParentOrigin = NDalic.ParentOriginBottomCenter;
-      _contentContainer.SetRelativeHeight(0, 0.07f);
-      _contentContainer.SetRelativeHeight(1, 0.26f);
-      _contentContainer.SetRelativeHeight(2, 0.07f);
-      _contentContainer.SetRelativeHeight(3, 0.26f);
-      _contentContainer.SetRelativeHeight(4, 0.07f);
-      _contentContainer.SetRelativeHeight(5, 0.26f);
-      _contentContainer.SetKeyboardFocusable(true);
-      _stage.Add(_contentContainer);
-
-      CreateContent();
-
-      FocusManager.Instance.PreFocusChange += OnPreFocusChange;
-    }
-
-    // Callback for KeyboardFocusManager
-    private Actor OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)
-    {
-      if (!e.Proposed && !e.Current)
-      {
-        e.Proposed = _contentContainer.GetChildAt(1);
-      }
-      return e.Proposed;
-    }
-
-    private void CreateContent()
-    {
-      for (int i = 0; i < mViewList.Length; i++)
-      {
-        CreateItem(mViewList[i], i);
-      }
-    }
-
-    private void CreateItem(Item item, int idx)
-    {
-      // Make label for item
-      TextLabel itemLabel = new TextLabel("    " + item.name);
-      itemLabel.Size = new Vector3(_stage.GetSize().Width * 0.2f, _stage.GetSize().Height * 0.05f, 0.0f);
-      itemLabel.HorizontalAlignment = "BEGIN";
-      itemLabel.VerticalAlignment = "BOTTOM";
-      itemLabel.PointSize = 18.0f;
-      _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5));
-
-      // If item is implemented in public, attach it on stage
-      if (item.isImplemented)
-      {
-        if (item.name.CompareTo("PushButton") == 0)
+        public Example(Dali.Application application)
         {
-          PushButton pushButton = new PushButton();
-          pushButton.LabelText = "Push Button";
-          pushButton.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-          pushButton.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
-          pushButton.UnselectedColor = new Vector4(1.0f,0.0f,0.0f,1.0f);
-          pushButton.SelectedColor = new Vector4(0.0f,1.0f,0.0f,1.0f);
-          pushButton.Clicked += (obj, e) =>
-          {
-            e.Button.LabelText = "Click Me";
-            e.Button.UnselectedColor = new Vector4(0.0f,0.0f,1.0f,1.0f);
-            return true;
-          };
-
-          _contentContainer.AddChild(pushButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+            _application = application;
+            _application.Initialized += OnInitialize;
         }
-        if (item.name.CompareTo("DropDown") == 0)
-        {
 
-        }
-        if (item.name.CompareTo("Toggle") == 0)
+        public void OnInitialize(object source, NUIApplicationInitEventArgs e)
         {
-          ToggleButton toggleButton = new ToggleButton();
-          Dali.Property.Array array = new Dali.Property.Array();
-          array.Add( new Dali.Property.Value("./images/star-highlight.png") );
-          array.Add( new Dali.Property.Value("./images/star-mod.png") );
-          array.Add( new Dali.Property.Value("./images/star-dim.png") );
-          toggleButton.StateVisuals = array;
-
-          Dali.Property.Array tooltips = new Dali.Property.Array();
-          tooltips.Add( new Dali.Property.Value("State A") );
-          tooltips.Add( new Dali.Property.Value("State B") );
-          tooltips.Add( new Dali.Property.Value("State C") );
-          toggleButton.Tooltips = tooltips;
-
-          toggleButton.WidthResizePolicy  = "FILL_TO_PARENT";
-          toggleButton.HeightResizePolicy = "FILL_TO_PARENT";
-          toggleButton.Clicked += (obj, e) =>
-          {
-            Console.WriteLine("Toggle button state changed.");
-            return true;
-          };
-
-          _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+            Console.WriteLine("Customized Application Initialize event handler");
+            _stage = Stage.GetCurrent();
+            _stage.BackgroundColor = Color.White;
+
+            // Top label
+            TextLabel topLabel = new TextLabel();
+            topLabel.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+            topLabel.SetResizePolicy(ResizePolicyType.SIZE_RELATIVE_TO_PARENT, DimensionType.HEIGHT);
+            topLabel.AnchorPoint = NDalic.AnchorPointTopCenter;
+            topLabel.Position = new Position(0, 0, 0);
+            topLabel.SetSizeModeFactor(new Vector3(0.0f, 0.1f, 0.0f));
+            topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
+            topLabel.TextColor = NDalic.WHITE;
+            topLabel.Text = " DALi Views";
+            topLabel.HorizontalAlignment = "BEGIN";
+            topLabel.VerticalAlignment = "CENTER";
+            topLabel.PointSize = 42.0f;
+            _stage.Add(topLabel);
+
+            // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right )
+            _contentContainer = new TableView(6, 5);
+            _contentContainer.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+            _contentContainer.SetResizePolicy(ResizePolicyType.SIZE_RELATIVE_TO_PARENT, DimensionType.HEIGHT);
+            _contentContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f));
+            _contentContainer.AnchorPoint = NDalic.AnchorPointBottomCenter;
+            _contentContainer.Position = new Position(0, _stage.Size.Height * 0.1f, 0);
+            _contentContainer.SetRelativeHeight(0, 0.07f);
+            _contentContainer.SetRelativeHeight(1, 0.26f);
+            _contentContainer.SetRelativeHeight(2, 0.07f);
+            _contentContainer.SetRelativeHeight(3, 0.26f);
+            _contentContainer.SetRelativeHeight(4, 0.07f);
+            _contentContainer.SetRelativeHeight(5, 0.26f);
+            _contentContainer.SetKeyboardFocusable(true);
+            _stage.Add(_contentContainer);
+
+            CreateContent();
+
+            FocusManager.Instance.PreFocusChange += OnPreFocusChange;
         }
-        if (item.name.CompareTo("InputField") == 0)
-        {
 
-        }
-        if (item.name.CompareTo("AnimateGif") == 0)
+        // Callback for KeyboardFocusManager
+        private Actor OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)
         {
-
+            if (!e.Proposed && !e.Current)
+            {
+                e.Proposed = _contentContainer.GetChildAt(1);
+            }
+            return e.Proposed;
         }
-        if (item.name.CompareTo("Loading") == 0)
-        {
 
-        }
-        if (item.name.CompareTo("ProgressBar") == 0)
+        private void CreateContent()
         {
-          _progressBar = new ProgressBar();
-          _progressBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-          _progressBar.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
-          _progressBar.SetSize( 0, 50 );
-
-          _progressBar.ValueChanged += OnProgressBarValueChanged;
-
-          _timer = new Timer( 100 );
-          _timer.Tick += ( obj, e ) =>
-          {
-            float progress = (float)Math.Round( _progressBar.ProgressValue , 2 );
+            for (int i = 0; i < mViewList.Length; i++)
+            {
+                CreateItem(mViewList[i], i);
+            }
+        }
 
-            if( progress == 1.0f )
+        private void CreateItem(Item item, int idx)
+        {
+            // Make label for item
+            TextLabel itemLabel = new TextLabel("    " + item.name);
+            itemLabel.Size = new Vector3(_stage.GetSize().Width * 0.2f, _stage.GetSize().Height * 0.05f, 0.0f);
+            itemLabel.HorizontalAlignment = "BEGIN";
+            itemLabel.VerticalAlignment = "BOTTOM";
+            itemLabel.PointSize = 18.0f;
+            _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5));
+
+            // If item is implemented in public, attach it on stage
+            if (item.isImplemented)
             {
-              _progressBar.ProgressValue = 0.0f;
-              _progressBar.SecondaryProgressValue = 0.01f;
+                if (item.name.CompareTo("PushButton") == 0)
+                {
+                    PushButton pushButton = new PushButton();
+                    pushButton.LabelText = "Push Button";
+                    pushButton.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+                    pushButton.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+                    pushButton.UnselectedColor = new Vector4(1.0f, 0.0f, 0.0f, 1.0f);
+                    pushButton.SelectedColor = new Vector4(0.0f, 1.0f, 0.0f, 1.0f);
+                    pushButton.Clicked += (obj, e) =>
+                    {
+                        e.Button.LabelText = "Click Me";
+                        e.Button.UnselectedColor = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
+                        return true;
+                    };
+
+                    _contentContainer.AddChild(pushButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("DropDown") == 0)
+                {
+
+                }
+                if (item.name.CompareTo("Toggle") == 0)
+                {
+                    ToggleButton toggleButton = new ToggleButton();
+                    Dali.Property.Array array = new Dali.Property.Array();
+                    array.Add(new Dali.Property.Value("./images/star-highlight.png"));
+                    array.Add(new Dali.Property.Value("./images/star-mod.png"));
+                    array.Add(new Dali.Property.Value("./images/star-dim.png"));
+                    toggleButton.StateVisuals = array;
+
+                    Dali.Property.Array tooltips = new Dali.Property.Array();
+                    tooltips.Add(new Dali.Property.Value("State A"));
+                    tooltips.Add(new Dali.Property.Value("State B"));
+                    tooltips.Add(new Dali.Property.Value("State C"));
+                    toggleButton.Tooltips = tooltips;
+
+                    toggleButton.WidthResizePolicy = "FILL_TO_PARENT";
+                    toggleButton.HeightResizePolicy = "FILL_TO_PARENT";
+                    toggleButton.Clicked += (obj, e) =>
+                    {
+                        Console.WriteLine("Toggle button state changed.");
+                        return true;
+                    };
+
+                    _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("InputField") == 0)
+                {
+
+                }
+                if (item.name.CompareTo("AnimateGif") == 0)
+                {
+
+                }
+                if (item.name.CompareTo("Loading") == 0)
+                {
+
+                }
+                if (item.name.CompareTo("ProgressBar") == 0)
+                {
+                    _progressBar = new ProgressBar();
+                    _progressBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+                    _progressBar.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
+                    _progressBar.SetSize(0, 50);
+
+                    _progressBar.ValueChanged += OnProgressBarValueChanged;
+
+                    _timer = new Timer(100);
+                    _timer.Tick += (obj, e) =>
+                    {
+                        float progress = (float)Math.Round(_progressBar.ProgressValue, 2);
+
+                        if (progress == 1.0f)
+                        {
+                            _progressBar.ProgressValue = 0.0f;
+                            _progressBar.SecondaryProgressValue = 0.01f;
+                        }
+                        else
+                        {
+                            _progressBar.ProgressValue = progress + 0.01f;
+                            _progressBar.SecondaryProgressValue = progress + 0.21f;
+                        }
+                        return true;
+                    };
+                    _timer.Start();
+
+                    _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("ScrollBar") == 0)
+                {
+
+                }
+                if (item.name.CompareTo("CheckBox") == 0)
+                {
+                    CheckBoxButton checkBoxButton = new CheckBoxButton();
+                    checkBoxButton.LabelText = "Yes";
+
+                    _contentContainer.AddChild(checkBoxButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("RadioButton") == 0)
+                {
+                    TableView tableView = new TableView(2, 1);
+                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+
+                    RadioButton rButton = new RadioButton();
+                    rButton.LabelText = "Yes";
+                    rButton.Selected = true;
+
+                    tableView.AddChild(rButton, new TableView.CellPosition(0, 0));
+
+                    rButton = new RadioButton();
+                    rButton.LabelText = "No";
+
+                    tableView.AddChild(rButton, new TableView.CellPosition(1, 0));
+
+                    _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("Tooltip") == 0)
+                {
+                    TableView tableView = new TableView(2, 1);
+                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+
+                    // Create two push buttons and add them to a table view
+                    PushButton buttonWithSimpleTooltip = new PushButton();
+                    buttonWithSimpleTooltip.LabelText = "Tooltip with text only";
+                    buttonWithSimpleTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f);
+                    buttonWithSimpleTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f);
+                    buttonWithSimpleTooltip.WidthResizePolicy = "FILL_TO_PARENT";
+                    tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0));
+
+                    PushButton buttonWithIconTooltip = new PushButton();
+                    buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon";
+                    buttonWithIconTooltip.WidthResizePolicy = "FILL_TO_PARENT";
+                    buttonWithIconTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f);
+                    buttonWithIconTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f);
+
+                    tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0));
+
+                    // Add a simple text only tooltip to the first push button
+                    buttonWithSimpleTooltip.TooltipText = "Simple Tooltip";
+
+                    // Create a property map for a tooltip with one icon and one text
+                    Property.Array iconTooltipContent = new Property.Array();
+
+                    Property.Map iconVisual = new Property.Map();
+                    iconVisual.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Image))
+                      .Add(Dali.Constants.ImageVisualProperty.URL, new Property.Value("./images/star-highlight.png"));
+                    iconTooltipContent.Add(new Property.Value(iconVisual));
+
+                    Property.Map textVisual = new Property.Map();
+                    textVisual.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text))
+                      .Add(Dali.Constants.TextVisualProperty.Text, new Property.Value("Tooltip with Icon"));
+                    iconTooltipContent.Add(new Property.Value(textVisual));
+
+                    Property.Map iconTooltip = new Property.Map();
+                    iconTooltip.Add(Dali.Constants.Tooltip.Property.Content, new Property.Value(iconTooltipContent))
+                      .Add(Dali.Constants.Tooltip.Property.Tail, new Property.Value(true));
+
+                    // Add the tooltip with icon and text to the second push button
+                    buttonWithIconTooltip.Tooltip = iconTooltip;
+
+                    _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("Popup") == 0)
+                {
+                    PushButton button = new PushButton();
+                    button.LabelText = "Popup";
+                    button.ParentOrigin = NDalic.ParentOriginCenter;
+                    button.AnchorPoint = NDalic.AnchorPointCenter;
+                    button.MaximumSize = new Vector2(90.0f, 50.0f);
+                    _popup = CreatePopup();
+                    _popup.SetTitle(CreateTitle("Popup"));
+
+                    TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?");
+                    text.BackgroundColor = Color.White;
+                    text.MultiLine = true;
+                    text.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+                    text.SetResizePolicy(ResizePolicyType.DIMENSION_DEPENDENCY, DimensionType.HEIGHT);
+                    text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f));
+                    _popup.SetContent(text);
+                    _popup.SetKeyboardFocusable(true);
+                    _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+
+                    button.Clicked += (obj, ee) =>
+                    {
+                        _stage.Add(_popup);
+                        _popup.SetDisplayState(Popup.DisplayStateType.SHOWN);
+                        FocusManager.Instance.SetCurrentFocusActor((_popup.FindChildByName("Footer")).FindChildByName("OKButton"));
+                        return true;
+                    };
+                    _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("Toast") == 0)
+                {
+                    PushButton button = new PushButton();
+                    button.LabelText = "Toast";
+                    button.ParentOrigin = NDalic.ParentOriginCenter;
+                    button.AnchorPoint = NDalic.AnchorPointCenter;
+                    button.Clicked += (obj, ee) =>
+                    {
+                        TypeInfo typeInfo = new TypeInfo(TypeRegistry.Get().GetTypeInfo("PopupToast"));
+                        if (typeInfo)
+                        {
+                            BaseHandle baseHandle = typeInfo.CreateInstance();
+                            if (baseHandle)
+                            {
+                                Popup toast = Popup.DownCast(baseHandle);
+                                TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself");
+                                text.TextColor = Color.White;
+                                text.MultiLine = true;
+                                text.HorizontalAlignment = "center";
+                                toast.SetTitle(text);
+                                _stage.Add(toast);
+                                toast.SetDisplayState(Popup.DisplayStateType.SHOWN);
+                            }
+                        }
+                        return true;
+                    };
+                    _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                }
+                if (item.name.CompareTo("ItemView") == 0)
+                {
+
+                }
             }
             else
             {
-              _progressBar.ProgressValue = progress + 0.01f;
-              _progressBar.SecondaryProgressValue = progress + 0.21f;
-            }
-            return true;
-          };
-          _timer.Start();
+                ImageView notSupportView = new ImageView("images/not_yet_sign.png");
+                notSupportView.Size = new Vector3(_stage.GetSize().Width * 0.2f, _stage.GetSize().Height * 0.25f, 0.0f);
+                notSupportView.SetKeyboardFocusable(true);
 
-          _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+            }
         }
-        if (item.name.CompareTo("ScrollBar") == 0)
+        Popup CreatePopup()
         {
-
+            Popup confirmationPopup = new Popup();
+
+            Actor footer = new Actor();
+            footer.SetName("Footer");
+            footer.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
+            footer.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
+            footer.SetSize(0.0f, 80.0f);
+            footer.ParentOrigin = NDalic.ParentOriginCenter;
+            footer.AnchorPoint = NDalic.AnchorPointCenter;
+
+            PushButton okButton = CreateOKButton();
+            okButton.ParentOrigin = NDalic.ParentOriginCenter;
+            okButton.AnchorPoint = NDalic.AnchorPointCenter;
+            okButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
+            okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
+
+
+            PushButton cancelButton = CreateCancelButton();
+            cancelButton.ParentOrigin = NDalic.ParentOriginCenter;
+            cancelButton.AnchorPoint = NDalic.AnchorPointCenter;
+            cancelButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
+            cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
+
+
+            TableView controlLayout = new TableView(1, 2);
+            controlLayout.ParentOrigin = NDalic.ParentOriginCenter;
+            controlLayout.AnchorPoint = NDalic.AnchorPointCenter;
+            controlLayout.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.ALL_DIMENSIONS);
+            controlLayout.SetCellPadding(new Size(10.0f, 10.0f));
+            controlLayout.SetRelativeWidth(0, 0.5f);
+            controlLayout.SetRelativeWidth(1, 0.5f);
+            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.CENTER, VerticalAlignmentType.CENTER);
+            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.CENTER, VerticalAlignmentType.CENTER);
+            controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0));
+            controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));
+
+
+            footer.Add(controlLayout);
+
+            confirmationPopup.SetFooter(footer);
+            return confirmationPopup;
         }
-        if (item.name.CompareTo("CheckBox") == 0)
+        Actor CreateTitle(string title)
         {
-          CheckBoxButton checkBoxButton = new CheckBoxButton();
-          checkBoxButton.LabelText = "Yes";
+            TextLabel titleActor = new TextLabel(title);
+            titleActor.TextColor = Color.White;
+            titleActor.MultiLine = true;
+            titleActor.HorizontalAlignment = "center";
 
-          _contentContainer.AddChild(checkBoxButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+            return titleActor;
         }
-        if (item.name.CompareTo("RadioButton") == 0)
-        {
-          TableView tableView = new TableView(2, 1);
-          tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-          tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
-
-          RadioButton rButton = new RadioButton();
-          rButton.LabelText = "Yes";
-          rButton.Selected = true;
-          tableView.AddChild(rButton, new TableView.CellPosition(0, 0));
 
-          rButton = new RadioButton();
-          rButton.LabelText = "No";
-
-          tableView.AddChild(rButton, new TableView.CellPosition(1, 0));
-
-          _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
-        }
-        if (item.name.CompareTo("Tooltip") == 0)
+        PushButton CreateOKButton()
         {
-          TableView tableView = new TableView(2, 1);
-          tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-          tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
-
-          // Create two push buttons and add them to a table view
-          PushButton buttonWithSimpleTooltip = new PushButton();
-          buttonWithSimpleTooltip.LabelText = "Tooltip with text only";
-          buttonWithSimpleTooltip.UnselectedColor = new Vector4(0.5f,0.5f,0.7f,1.0f);
-          buttonWithSimpleTooltip.SelectedColor = new Vector4(0.7f,0.5f,0.7f,1.0f);
-          buttonWithSimpleTooltip.WidthResizePolicy = "FILL_TO_PARENT";
-          tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0));
-
-          PushButton buttonWithIconTooltip = new PushButton();
-          buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon";
-          buttonWithIconTooltip.WidthResizePolicy = "FILL_TO_PARENT";
-          buttonWithIconTooltip.UnselectedColor = new Vector4(0.5f,0.5f,0.7f,1.0f);
-          buttonWithIconTooltip.SelectedColor = new Vector4(0.7f,0.5f,0.7f,1.0f);
-          tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0));
-
-          // Add a simple text only tooltip to the first push button
-          buttonWithSimpleTooltip.TooltipText = "Simple Tooltip";
-
-          // Create a property map for a tooltip with one icon and one text
-          Property.Array iconTooltipContent = new Property.Array();
-
-          Property.Map iconVisual = new Property.Map();
-          iconVisual.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Image) )
-            .Add( Dali.Constants.ImageVisualProperty.URL, new Property.Value("./images/star-highlight.png") );
-          iconTooltipContent.Add(new Property.Value(iconVisual));
-
-          Property.Map textVisual = new Property.Map();
-          textVisual.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text) )
-            .Add( Dali.Constants.TextVisualProperty.Text, new Property.Value("Tooltip with Icon") );
-          iconTooltipContent.Add(new Property.Value(textVisual));
-
-          Property.Map iconTooltip = new Property.Map();
-          iconTooltip.Add( Dali.Constants.Tooltip.Property.Content, new Property.Value(iconTooltipContent) )
-            .Add( Dali.Constants.Tooltip.Property.Tail, new Property.Value(true) );
-
-          // Add the tooltip with icon and text to the second push button
-          buttonWithIconTooltip.Tooltip = iconTooltip;
-
-          _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
-        }
-        if (item.name.CompareTo("Popup") == 0)
-        {
-          PushButton button = new PushButton();
-          button.LabelText = "Popup";
-          button.ParentOrigin = NDalic.ParentOriginCenter;
-          button.AnchorPoint = NDalic.AnchorPointCenter;
-          button.MaximumSize = new Vector2(90.0f,50.0f);
-          _popup = CreatePopup();
-          _popup.SetTitle(CreateTitle("Popup"));
-
-          TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?");
-          text.BackgroundColor = Color.White;
-          text.MultiLine = true;
-          text.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-          text.SetResizePolicy(ResizePolicyType.DIMENSION_DEPENDENCY, DimensionType.HEIGHT);
-          text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f));
-          _popup.SetContent(text);
-          _popup.SetKeyboardFocusable(true);
-          _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
-
-          button.Clicked += (obj, ee) =>
-          {
-            _stage.Add(_popup);
-            _popup.SetDisplayState(Popup.DisplayStateType.SHOWN);
-            FocusManager.Instance.SetCurrentFocusActor((_popup.FindChildByName( "Footer" )).FindChildByName("OKButton"));
-            return true;
-          };
-          _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+            PushButton okayButton = new PushButton();
+            okayButton.SetName("OKButton");
+            okayButton.LabelText = "OK";
+            okayButton.SetKeyboardFocusable(true);
+            okayButton.Clicked += (obj, ee) =>
+            {
+                _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+                return true;
+            };
+            return okayButton;
         }
-        if (item.name.CompareTo("Toast") == 0)
+        PushButton CreateCancelButton()
         {
-          PushButton button = new PushButton();
-          button.LabelText = "Toast";
-          button.ParentOrigin = NDalic.ParentOriginCenter;
-          button.AnchorPoint = NDalic.AnchorPointCenter;
-          button.Clicked += (obj, ee) =>
-          {
-            TypeInfo typeInfo = new TypeInfo(TypeRegistry.Get().GetTypeInfo( "PopupToast" ));
-            if( typeInfo )
+            PushButton cancelButton = new PushButton();
+            cancelButton.LabelText = "Cancel";
+            cancelButton.SetKeyboardFocusable(true);
+            cancelButton.Clicked += (obj, ee) =>
             {
-              BaseHandle baseHandle = typeInfo.CreateInstance();
-              if( baseHandle )
-              {
-                Popup toast = Popup.DownCast( baseHandle );
-                TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself");
-                text.TextColor = Color.White;
-                text.MultiLine = true;
-                text.HorizontalAlignment = "center";
-                toast.SetTitle( text);
-                _stage.Add(toast);
-                toast.SetDisplayState( Popup.DisplayStateType.SHOWN);
-              }
-            }
-            return true;
-          };
-          _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
+                _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+                return true;
+            };
+            return cancelButton;
         }
-        if (item.name.CompareTo("ItemView") == 0)
+
+        void OnProgressBarValueChanged(object source, ProgressBar.ValueChangedEventArgs e)
         {
+            Property.Map labelVisual = new Property.Map();
+            labelVisual.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text))
+              .Add(Dali.Constants.TextVisualProperty.Text, new Property.Value(Math.Round(e.ProgressBar.ProgressValue, 2) + " / " + Math.Round(e.ProgressBar.SecondaryProgressValue, 2)));
+            e.ProgressBar.LabelVisual = labelVisual;
+            return;
+        }
 
+        public void MainLoop()
+        {
+            _application.MainLoop();
         }
-      }
-      else
-      {
-        ImageView notSupportView = new ImageView("images/not_yet_sign.png");
-        notSupportView.Size = new Vector3(_stage.GetSize().Width * 0.2f, _stage.GetSize().Height * 0.25f, 0.0f);
-        notSupportView.SetKeyboardFocusable(true);
-        _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
-      }
-    }
-    Popup CreatePopup()
-    {
-      Popup confirmationPopup = new Popup();
-
-      Actor footer = new Actor();
-      footer.SetName("Footer");
-      footer.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-      footer.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
-      footer.SetSize(0.0f, 80.0f);
-      footer.ParentOrigin = NDalic.ParentOriginCenter;
-      footer.AnchorPoint = NDalic.AnchorPointCenter;
-
-      PushButton okButton = CreateOKButton();
-      okButton.ParentOrigin = NDalic.ParentOriginCenter;
-      okButton.AnchorPoint = NDalic.AnchorPointCenter;
-      okButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
-      okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
-
-      PushButton cancelButton = CreateCancelButton();
-      cancelButton.ParentOrigin = NDalic.ParentOriginCenter;
-      cancelButton.AnchorPoint = NDalic.AnchorPointCenter;
-      cancelButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
-      cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
-
-      TableView controlLayout = new TableView(1, 2);
-      controlLayout.ParentOrigin = NDalic.ParentOriginCenter;
-      controlLayout.AnchorPoint = NDalic.AnchorPointCenter;
-      controlLayout.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.ALL_DIMENSIONS);
-      controlLayout.SetCellPadding(new Size(10.0f, 10.0f));
-      controlLayout.SetRelativeWidth(0, 0.5f);
-      controlLayout.SetRelativeWidth(1, 0.5f);
-      controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.CENTER, VerticalAlignmentType.CENTER);
-      controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.CENTER, VerticalAlignmentType.CENTER);
-      controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0));
-      controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));
-
-      footer.Add(controlLayout);
-
-      confirmationPopup.SetFooter(footer);
-      return confirmationPopup;
-    }
-    Actor CreateTitle(string title)
-    {
-      TextLabel titleActor = new TextLabel(title);
-      titleActor.TextColor = Color.White;
-      titleActor.MultiLine = true;
-      titleActor.HorizontalAlignment = "center";
-      return titleActor;
-    }
 
-    PushButton CreateOKButton()
-    {
-      PushButton okayButton = new PushButton();
-      okayButton.SetName("OKButton");
-      okayButton.LabelText = "OK";
-      okayButton.SetKeyboardFocusable(true);
-      okayButton.Clicked += (obj, ee) =>
-      {
-        _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
-        return true;
-      };
-      return okayButton;
-    }
-    PushButton CreateCancelButton()
-    {
-      PushButton cancelButton = new PushButton();
-      cancelButton.LabelText = "Cancel";
-      cancelButton.SetKeyboardFocusable(true);
-      cancelButton.Clicked += (obj, ee) =>
-      {
-        _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
-        return true;
-      };
-      return cancelButton;
-    }
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
 
-    void OnProgressBarValueChanged( object source, ProgressBar.ValueChangedEventArgs e )
-    {
-      Property.Map labelVisual = new Property.Map();
-      labelVisual.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text) )
-        .Add( Dali.Constants.TextVisualProperty.Text, new Property.Value( Math.Round( e.ProgressBar.ProgressValue, 2 ) +" / "+Math.Round( e.ProgressBar.SecondaryProgressValue, 2 )) );
-      e.ProgressBar.LabelVisual = labelVisual;
-      return;
-    }
+        [STAThread]
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Hello Mono World");
 
-    public void MainLoop()
-    {
-      _application.MainLoop();
+            Example example = new Example(Application.NewApplication("json/control-dashboard.json"));
+            example.MainLoop();
+        }
     }
-
-    /// <summary>
-    /// The main entry point for the application.
-    /// </summary>
-
-    [STAThread]
-      static void Main(string[] args)
-      {
-        Console.WriteLine("Hello Mono World");
-
-        Example example = new Example(Application.NewApplication("json/control-dashboard.json"));
-        example.MainLoop();
-      }
-  }
 }
+
old mode 100644 (file)
new mode 100755 (executable)
index 6e106ae..f85a78a
@@ -39,7 +39,7 @@ namespace MyCSharpExample
             }
             set
             {
-              _myOwnName = value;
+                _myOwnName = value;
             }
         }
     }
@@ -62,7 +62,7 @@ namespace MyCSharpExample
             }
             set
             {
-              _myOwnName = value;
+                _myOwnName = value;
             }
         }
     }
@@ -85,190 +85,54 @@ namespace MyCSharpExample
             }
             set
             {
-              _myOwnName = value;
+                _myOwnName = value;
             }
         }
     }
 
     class Example
     {
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        delegate void CallbackDelegate(IntPtr appPtr); // void, void delgate
-
         private Dali.Application _application;
 
         public Example(Dali.Application application)
         {
             _application = application;
-            Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
+            Console.WriteLine("1) InitSignal connection count = " + _application.InitSignal().GetConnectionCount());
 
             _application.Initialized += Initialize;
-            Console.WriteLine( "InitSignal connection count = " + _application.InitSignal().GetConnectionCount() );
+            Console.WriteLine("2) InitSignal connection count = " + _application.InitSignal().GetConnectionCount());
         }
 
         public void Initialize(object source, NUIApplicationInitEventArgs e)
         {
+            //1)
             NavigationPropertiesTests();
 
+            //2)
             OperatorTests();
 
+            //3)
             CustomViewPropertyTest();
 
-            Handle handle = new Handle();
-            int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
-            float myProperty = 0.0f;
-            handle.GetProperty(myPropertyIndex).Get(ref myProperty);
-            Console.WriteLine( "myProperty value: " + myProperty );
-
-            int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f)), Property.AccessMode.READ_WRITE);
-            Size myProperty2 = new Size(0.0f, 0.0f);
-            handle.GetProperty(myPropertyIndex2).Get(myProperty2);
-            Console.WriteLine( "myProperty2 value: " + myProperty2.W + ", " + myProperty2.H );
-
-            Actor actor = new Actor();
-            actor.Size = new Position(200.0f, 200.0f, 0.0f);
-            actor.Name = "MyActor";
-            actor.Color = new Color(1.0f, 0.0f, 1.0f, 0.8f);
-            Console.WriteLine("Actor id: {0}", actor.GetId());
-            Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
-            Console.WriteLine("Actor name: " + actor.Name);
-
-            Stage stage = Stage.GetCurrent();
-            stage.BackgroundColor = Color.White;
-            Size stageSize = stage.Size;
-            Console.WriteLine("Stage size: " + stageSize.W + ", " + stageSize.H);
-            stage.Add(actor);
-
-            TextLabel text = new TextLabel("Hello Mono World");
-            text.ParentOrigin = NDalic.ParentOriginCenter;
-            text.AnchorPoint = NDalic.AnchorPointCenter;
-            text.HorizontalAlignment = "CENTER";
-            stage.Add(text);
-
-            Console.WriteLine( "Text label text:  " + text.Text );
-
-            Console.WriteLine( "Text label point size:  " + text.PointSize );
-            text.PointSize = 32.0f;
-            Console.WriteLine( "Text label new point size:  " + text.PointSize );
+            //4)
+            ActorHandleTest();
 
+            //5)
             RectanglePaddingClassTest();
 
-            Console.WriteLine( " *************************" );
-            Size Size = new Size(100, 50);
-            Console.WriteLine( "    Created " + Size );
-            Console.WriteLine( "    Size x =  " + Size.W + ", y = " + Size.H );
-            Size += new Size(20, 20);
-            Console.WriteLine( "    Size x =  " + Size.W + ", y = " + Size.H );
-            Size.W += 10;
-            Size.H += 10;
-            Console.WriteLine( "    Size width =  " + Size.W + ", height = " + Size.H );
-
-            Console.WriteLine( " *************************" );
-            Position Position = new Position(20, 100, 50);
-            Console.WriteLine( "    Created " + Position );
-            Console.WriteLine( "    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
-            Position += new Position(20, 20, 20);
-            Console.WriteLine( "    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z );
-            Position.X += 10;
-            Position.Y += 10;
-            Position.Z += 10;
-            Console.WriteLine( "    Position width =  " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z );
-            Position parentOrigin = new Dali.Position(NDalic.ParentOriginBottomRight);
-            Console.WriteLine( "    parentOrigin x =  " + parentOrigin.X + ", y = " + parentOrigin.Y + ", z = " + parentOrigin.Z );
-
-            Console.WriteLine( " *************************" );
-            Color color = new Color(20, 100, 50, 200);
-            Console.WriteLine( "    Created " + color );
-            Console.WriteLine( "    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
-            color += new Color(20, 20, 20, 20);
-            Console.WriteLine( "    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A );
-            color.R += 10;
-            color.G += 10;
-            color.B += 10;
-            color.A += 10;
-            Console.WriteLine( "    Color r =  " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A );
+            //6)
+            SizePositionTest();
 
+            //7)
             ViewDownCastTest();
         }
 
-        public void RectanglePaddingClassTest()
-        {
-            using (Rectangle r1 = new Rectangle(2, 5, 20, 30))
-            {
-                Console.WriteLine( "    Created " + r1 );
-                Console.WriteLine( "    IsEmpty() =  " + r1.IsEmpty() );
-                Console.WriteLine( "    Left =  " + r1.Left() );
-                Console.WriteLine( "    Right =  " + r1.Right() );
-                Console.WriteLine( "    Top  = " + r1.Top() );
-                Console.WriteLine( "    Bottom  = " + r1.Bottom() );
-                Console.WriteLine( "    Area  = " + r1.Area() );
-            }
-
-            Console.WriteLine( " *************************" );
-
-            using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
-            {
-                Console.WriteLine( "    Created " + r2 );
-                r2.Set(1,1,40,40);
-                Console.WriteLine( "    IsEmpty() =  " + r2.IsEmpty() );
-                Console.WriteLine( "    Left =  " + r2.Left() );
-                Console.WriteLine( "    Right =  " + r2.Right() );
-                Console.WriteLine( "    Top  = " + r2.Top() );
-                Console.WriteLine( "    Bottom  = " + r2.Bottom() );
-                Console.WriteLine( "    Area  = " + r2.Area() );
-            }
-
-            Console.WriteLine( " *************************" );
-
-            Rectangle r3 = new Rectangle(10, 10, 20, 20);
-            Rectangle r4 = new Rectangle(10, 10, 20, 20);
-
-            if (r3 == r4)
-            {
-                Console.WriteLine("r3 == r4");
-            }
-            else
-            {
-                Console.WriteLine("r3 != r4");
-            }
-
-            r4 = new Rectangle(12, 10, 20, 20);
-
-            if (r3 == r4)
-            {
-                Console.WriteLine("r3 == r4");
-            }
-            else
-            {
-                Console.WriteLine("r3 != r4");
-            }
-
-            PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
-            PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
-
-            if (p1 == p2)
-            {
-                Console.WriteLine("p1 == p2");
-            }
-            else
-            {
-                Console.WriteLine("p1 != p2");
-            }
-
-            p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f);
-
-            if (p1 == p2)
-            {
-                Console.WriteLine("p1 == p2");
-            }
-            else
-            {
-                Console.WriteLine("p1 != p2");
-            }
-        }
 
         public void NavigationPropertiesTests()
         {
+            Console.WriteLine("");
+            Console.WriteLine("### [1] NavigationPropertiesTests START");
+
             View view = new View();
             View leftView, rightView, upView, downView, tmpView;
 
@@ -342,367 +206,558 @@ namespace MyCSharpExample
             {
                 Console.WriteLine("Failed: LeftFocusedView = " + tmpView.Name);
             }
+
+            Console.WriteLine("### [1] NavigationPropertiesTests END");
         }
 
         public void OperatorTests()
         {
+            Console.WriteLine("");
+            Console.WriteLine("### [2] OperatorTests START");
             Actor actor = new Actor();
             Actor differentActor = new Actor();
             Actor actorSame = actor;
             Actor nullActor = null;
 
             // test the true operator
-            if ( actor )
+            if (actor)
             {
-                Console.WriteLine ("BaseHandle Operator true (actor) : test passed ");
+                Console.WriteLine("BaseHandle Operator true (actor) : test passed ");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator true (actor): test failed ");
+                Console.WriteLine("BaseHandle Operator true (actor): test failed ");
             }
 
-            Actor parent = actor.GetParent ();
+            Actor parent = actor.GetParent();
 
-            if ( parent )
+            if (parent)
             {
-                Console.WriteLine ("Handle with Empty body  :failed ");
+                Console.WriteLine("Handle with Empty body  :failed ");
             }
             else
             {
-                Console.WriteLine ("Valid with Empty body  :passed ");
+                Console.WriteLine("Valid with Empty body  :passed ");
             }
 
-            actor.Add( differentActor );
+            actor.Add(differentActor);
 
             // here we test two different C# objects, which on the native side have the same body/ ref-object
-            if ( actor == differentActor.GetParent() )
+            if (actor == differentActor.GetParent())
             {
-                Console.WriteLine ("actor == differentActor.GetParent() :passed ");
+                Console.WriteLine("actor == differentActor.GetParent() :passed ");
             }
             else
             {
-                Console.WriteLine ("actor == differentActor.GetParent() :failed ");
+                Console.WriteLine("actor == differentActor.GetParent() :failed ");
             }
 
-            if ( differentActor == differentActor.GetParent() )
+            if (differentActor == differentActor.GetParent())
             {
-                Console.WriteLine ("differentActor == differentActor.GetParent() :failed ");
+                Console.WriteLine("differentActor == differentActor.GetParent() :failed ");
             }
             else
             {
-                Console.WriteLine ("differentActor == differentActor.GetParent() :passed ");
+                Console.WriteLine("differentActor == differentActor.GetParent() :passed ");
             }
 
-            if ( nullActor )
+            if (nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator true (nullActor) : test failed ");
+                Console.WriteLine("BaseHandle Operator true (nullActor) : test failed ");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator true (nullActor): test passed ");
+                Console.WriteLine("BaseHandle Operator true (nullActor): test passed ");
             }
 
             // ! operator
-            if ( !actor )
+            if (!actor)
             {
-                Console.WriteLine ("BaseHandle Operator !(actor) : test failed ");
+                Console.WriteLine("BaseHandle Operator !(actor) : test failed ");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator !(actor): test passed ");
+                Console.WriteLine("BaseHandle Operator !(actor): test passed ");
             }
 
-            if ( !nullActor )
+            if (!nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator !(nullActor) : test passed ");
+                Console.WriteLine("BaseHandle Operator !(nullActor) : test passed ");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator !(nullActor): test failed ");
+                Console.WriteLine("BaseHandle Operator !(nullActor): test failed ");
             }
 
             // Note: operator false only used inside & operator
             // test equality operator ==
-            if ( actor == actorSame )
+            if (actor == actorSame)
             {
-                Console.WriteLine ("BaseHandle Operator  (actor == actorSame) : test passed");
+                Console.WriteLine("BaseHandle Operator  (actor == actorSame) : test passed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator  (actor == actorSame) : test failed");
+                Console.WriteLine("BaseHandle Operator  (actor == actorSame) : test failed");
             }
 
-            if ( actor == differentActor )
+            if (actor == differentActor)
             {
-                Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (actor == differentActor) : test failed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (actor == differentActor) : test passed");
             }
 
-            if ( actor == nullActor )
+            if (actor == nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (actor == nullActor) : test failed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (actor == nullActor) : test passed");
             }
 
-            if ( nullActor == nullActor )
+            if (nullActor == nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (nullActor == nullActor) : test passed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (nullActor == nullActor) : test failed");
             }
 
             // test || operator
-            if ( actor || actorSame )
+            if (actor || actorSame)
             {
-                Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test passed");
+                Console.WriteLine("BaseHandle Operator (actor || actorSame) : test passed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test failed");
+                Console.WriteLine("BaseHandle Operator (actor || actorSame) : test failed");
             }
 
-            if ( actor || nullActor )
+            if (actor || nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (actor || nullActor) : test passed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (actor || nullActor) : test failed");
             }
 
-            if ( nullActor || nullActor )
+            if (nullActor || nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (nullActor || nullActor) : test failed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (nullActor || nullActor) : test passed");
             }
 
             // test && operator
-            if ( actor && actorSame )
+            if (actor && actorSame)
             {
-                Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test passed");
+                Console.WriteLine("BaseHandle Operator (actor && actorSame) : test passed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test failed");
+                Console.WriteLine("BaseHandle Operator (actor && actorSame) : test failed");
             }
 
-            if ( actor && nullActor )
+            if (actor && nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (actor && nullActor) : test failed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (actor && nullActor) : test passed");
             }
 
-            if ( nullActor && nullActor )
+            if (nullActor && nullActor)
             {
-                Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test failed");
+                Console.WriteLine("BaseHandle Operator (nullActor && nullActor) : test failed");
             }
             else
             {
-                Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test passed");
+                Console.WriteLine("BaseHandle Operator (nullActor && nullActor) : test passed");
             }
+
+            Console.WriteLine("### [2] OperatorTests END");
+
         }
 
         public void CustomViewPropertyTest()
         {
+            Console.WriteLine("");
+            Console.WriteLine("### [3] CustomViewPropertyTest START");
+
             // Create a Spin control
             Spin spin = new Spin();
 
             // Background property
             Property.Map background = new Property.Map();
-            background.Add( Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color) )
-                      .Add( Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red) );
+            background.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Color))
+                      .Add(Dali.Constants.ColorVisualProperty.MixColor, new Property.Value(Color.Red));
             spin.Background = background;
 
             background = spin.Background;
             Vector4 backgroundColor = new Vector4();
             background.Find(Dali.Constants.ColorVisualProperty.MixColor).Get(backgroundColor);
-            if( backgroundColor == Color.Red )
+            if (backgroundColor == Color.Red)
             {
-                Console.WriteLine ("Custom View Background property : test passed");
+                Console.WriteLine("Custom View Background property : test passed");
             }
             else
             {
-                Console.WriteLine ("Custom View Background property : test failed");
+                Console.WriteLine("Custom View Background property : test failed");
             }
 
             // BackgroundColor property
             spin.BackgroundColor = Color.Yellow;
-            if(spin.BackgroundColor == Color.Yellow)
+            if (spin.BackgroundColor == Color.Yellow)
             {
-                Console.WriteLine ("Custom View BackgroundColor property : test passed");
+                Console.WriteLine("Custom View BackgroundColor property : test passed");
             }
             else
             {
-                Console.WriteLine ("Custom View BackgroundColor property : test failed");
+                Console.WriteLine("Custom View BackgroundColor property : test failed");
             }
 
             // BackgroundImage property
             spin.BackgroundImage = "background-image.jpg";
-            if(spin.BackgroundImage == "background-image.jpg")
+            if (spin.BackgroundImage == "background-image.jpg")
             {
-                Console.WriteLine ("Custom View BackgroundImage property : test passed");
+                Console.WriteLine("Custom View BackgroundImage property : test passed");
             }
             else
             {
-                Console.WriteLine ("Custom View BackgroundImage property : test failed");
+                Console.WriteLine("Custom View BackgroundImage property : test failed");
             }
 
             // StyleName property
             spin.StyleName = "MyCustomStyle";
-            if(spin.StyleName == "MyCustomStyle")
+            if (spin.StyleName == "MyCustomStyle")
             {
-                Console.WriteLine ("Custom View StyleName property : test passed");
+                Console.WriteLine("Custom View StyleName property : test passed");
             }
             else
             {
-                Console.WriteLine ("Custom View StyleName property : test failed");
+                Console.WriteLine("Custom View StyleName property : test failed");
             }
+
+            Console.WriteLine("### [3] CustomViewPropertyTest END");
         }
 
-        public void ViewDownCastTest()
+
+
+        public void ActorHandleTest()
         {
-          View container = new View();
-          container.Position = new Position(-800.0f, -800.0f, 0.0f);
-          Stage.GetCurrent().Add(container);
+            Console.WriteLine("");
+            Console.WriteLine("### [4] ActorHandleTest START");
 
-          // Test downcast for native control
-          TextLabel myLabel = new TextLabel();
-          myLabel.Name = "MyLabelName";
-          myLabel.Text = "MyText";
+            Handle handle = new Handle();
+            int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
+            float myProperty = 0.0f;
+            handle.GetProperty(myPropertyIndex).Get(ref myProperty);
+            Console.WriteLine("myProperty value: " + myProperty);
+
+            int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new Property.Value(new Size(5.0f, 5.0f)), Property.AccessMode.READ_WRITE);
+            Size myProperty2 = new Size(0.0f, 0.0f);
+            handle.GetProperty(myPropertyIndex2).Get(myProperty2);
+            Console.WriteLine("myProperty2 value: " + myProperty2.W + ", " + myProperty2.H);
+
+            Actor actor = new Actor();
+            actor.Size = new Position(200.0f, 200.0f, 0.0f);
+            actor.Name = "MyActor";
+            Console.WriteLine("Actor id: {0}", actor.GetId());
+            Console.WriteLine("Actor size: " + actor.Size.X + ", " + actor.Size.Y);
+            Console.WriteLine("Actor name: " + actor.Name);
+
+            Stage stage = Stage.GetCurrent();
+            stage.BackgroundColor = Color.White;
+            Size stageSize = stage.Size;
+            Console.WriteLine("Stage size: " + stageSize.W + ", " + stageSize.H);
+            stage.Add(actor);
 
-          Console.WriteLine("myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text);
+            TextLabel text = new TextLabel("Hello World");
+            text.ParentOrigin = NDalic.ParentOriginCenter;
+            text.AnchorPoint = NDalic.AnchorPointCenter;
+            text.HorizontalAlignment = "CENTER";
+            stage.Add(text);
 
-          container.Add(myLabel);
+            Console.WriteLine("Text label text:  " + text.Text);
 
-          Actor myLabelActor  = container.FindChildByName("MyLabelName");
-          if(myLabelActor)
-          {
-            TextLabel newLabel = View.DownCast<TextLabel>(myLabelActor);
-            if(newLabel)
+            Console.WriteLine("Text label point size:  " + text.PointSize);
+            text.PointSize = 32.0f;
+            Console.WriteLine("Text label new point size:  " + text.PointSize);
+
+            Console.WriteLine("### [4] ActorHandleTest END");
+
+        }
+
+
+
+        public void RectanglePaddingClassTest()
+        {
+            Console.WriteLine("");
+            Console.WriteLine("### [5] RectanglePaddingClassTest START");
+
+            using (Rectangle r1 = new Rectangle(2, 5, 20, 30))
             {
-              Console.WriteLine("Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text);
+                Console.WriteLine("    Created " + r1);
+                Console.WriteLine("    IsEmpty() =  " + r1.IsEmpty());
+                Console.WriteLine("    Left =  " + r1.Left());
+                Console.WriteLine("    Right =  " + r1.Right());
+                Console.WriteLine("    Top  = " + r1.Top());
+                Console.WriteLine("    Bottom  = " + r1.Bottom());
+                Console.WriteLine("    Area  = " + r1.Area());
             }
-            else
+
+            Console.WriteLine(" *************************");
+
+            using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
             {
-              Console.WriteLine("Downcast to TextLabel failed!");
+                Console.WriteLine("    Created " + r2);
+                r2.Set(1, 1, 40, 40);
+                Console.WriteLine("    IsEmpty() =  " + r2.IsEmpty());
+                Console.WriteLine("    Left =  " + r2.Left());
+                Console.WriteLine("    Right =  " + r2.Right());
+                Console.WriteLine("    Top  = " + r2.Top());
+                Console.WriteLine("    Bottom  = " + r2.Bottom());
+                Console.WriteLine("    Area  = " + r2.Area());
             }
-          }
 
-          // Test downcast for class directly inherited from View
-          MyView myView = new MyView();
-          myView.Name = "MyViewName";
-          myView.MyOwnName = "MyOwnViewName";
-          myView._myCurrentValue = 5;
+            Console.WriteLine(" *************************");
 
-          Console.WriteLine("myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue);
+            Rectangle r3 = new Rectangle(10, 10, 20, 20);
+            Rectangle r4 = new Rectangle(10, 10, 20, 20);
 
-          container.Add(myView);
+            if (r3 == r4)
+            {
+                Console.WriteLine("r3 == r4");
+            }
+            else
+            {
+                Console.WriteLine("r3 != r4");
+            }
+
+            r4 = new Rectangle(12, 10, 20, 20);
 
-          Actor myViewActor  = container.FindChildByName("MyViewName");
-          if(myViewActor)
-          {
-            MyView newView = View.DownCast<MyView>(myViewActor);
-            if(newView)
+            if (r3 == r4)
             {
-              Console.WriteLine("Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue);
+                Console.WriteLine("r3 == r4");
             }
             else
             {
-              Console.WriteLine("Downcast to MyView failed!");
+                Console.WriteLine("r3 != r4");
             }
-          }
 
-          // Test downcast for class directly inherited from native control
-          MyButton myButton = new MyButton();
-          myButton.Name = "MyButtonName";
-          myButton.MyOwnName = "MyOwnViewName";
-          myButton.LabelText = "MyLabelText";
-          myButton._myCurrentValue = 5;
+            PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
+            PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f);
 
-          Console.WriteLine("myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue);
+            if (p1 == p2)
+            {
+                Console.WriteLine("p1 == p2");
+            }
+            else
+            {
+                Console.WriteLine("p1 != p2");
+            }
 
-          container.Add(myButton);
+            p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f);
 
-          Actor myButtonActor  = container.FindChildByName("MyButtonName");
-          if(myButtonActor)
-          {
-            MyButton newButton = View.DownCast<MyButton>(myButtonActor);
-            if(newButton)
+            if (p1 == p2)
             {
-              Console.WriteLine("Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue);
+                Console.WriteLine("p1 == p2");
             }
             else
             {
-              Console.WriteLine("Downcast to MyButton failed!");
+                Console.WriteLine("p1 != p2");
+            }
+            Console.WriteLine("### [5] RectanglePaddingClassTest END");
+
+        }
+
+
+        public void SizePositionTest()
+        {
+            Console.WriteLine("");
+            Console.WriteLine("### [6] SizePositionTest START");
+
+            Size Size = new Size(100, 50);
+            Console.WriteLine("    Created " + Size);
+            Console.WriteLine("    Size x =  " + Size.W + ", y = " + Size.H);
+            Size += new Size(20, 20);
+            Console.WriteLine("    Size x =  " + Size.W + ", y = " + Size.H);
+            Size.W += 10;
+            Size.H += 10;
+            Console.WriteLine("    Size width =  " + Size.W + ", height = " + Size.H);
+
+            Console.WriteLine(" *************************");
+            Position Position = new Position(20, 100, 50);
+            Console.WriteLine("    Created " + Position);
+            Console.WriteLine("    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z);
+            Position += new Position(20, 20, 20);
+            Console.WriteLine("    Position x =  " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z);
+            Position.X += 10;
+            Position.Y += 10;
+            Position.Z += 10;
+            Console.WriteLine("    Position width =  " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z);
+            Position parentOrigin = new Dali.Position(NDalic.ParentOriginBottomRight);
+            Console.WriteLine("    parentOrigin x =  " + parentOrigin.X + ", y = " + parentOrigin.Y + ", z = " + parentOrigin.Z);
+
+            Console.WriteLine(" *************************");
+            Color color = new Color(20, 100, 50, 200);
+            Console.WriteLine("    Created " + color);
+            Console.WriteLine("    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A);
+            color += new Color(20, 20, 20, 20);
+            Console.WriteLine("    Color R =  " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A);
+            color.R += 10;
+            color.G += 10;
+            color.B += 10;
+            color.A += 10;
+            Console.WriteLine("    Color r =  " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A);
+
+            Console.WriteLine("### [6] SizePositionTest END");
+        }
+
+
+        public void ViewDownCastTest()
+        {
+            Console.WriteLine("");
+            Console.WriteLine("### [7] ViewDownCastTest START");
+
+            View container = new View();
+            container.Position = new Position(-800.0f, -800.0f, 0.0f);
+            Stage.GetCurrent().Add(container);
+
+            // Test downcast for native control
+            TextLabel myLabel = new TextLabel();
+            myLabel.Name = "MyLabelName";
+            myLabel.Text = "MyText";
+
+            Console.WriteLine("myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text);
+
+            container.Add(myLabel);
+
+            Actor myLabelActor = container.FindChildByName("MyLabelName");
+            if (myLabelActor)
+            {
+                TextLabel newLabel = View.DownCast<TextLabel>(myLabelActor);
+                if (newLabel)
+                {
+                    Console.WriteLine("Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text);
+                }
+                else
+                {
+                    Console.WriteLine("Downcast to TextLabel failed!");
+                }
             }
-          }
 
-          // Test downcast for a CustomView
-          Spin spin = new Spin();
-          spin.Name = "SpinName";
-          spin.MaxValue = 8888;
+            // Test downcast for class directly inherited from View
+            MyView myView = new MyView();
+            myView.Name = "MyViewName";
+            myView.MyOwnName = "MyOwnViewName";
+            myView._myCurrentValue = 5;
 
-          Console.WriteLine("spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue);
+            Console.WriteLine("myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue);
 
-          container.Add(spin);
+            container.Add(myView);
 
-          Actor spinActor  = container.FindChildByName("SpinName");
-          if(spinActor)
-          {
-            Spin newSpin = View.DownCast<Spin>(spinActor);
-            if(newSpin)
+            Actor myViewActor = container.FindChildByName("MyViewName");
+            if (myViewActor)
             {
-              Console.WriteLine("Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue);
+                MyView newView = View.DownCast<MyView>(myViewActor);
+                if (newView)
+                {
+                    Console.WriteLine("Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue);
+                }
+                else
+                {
+                    Console.WriteLine("Downcast to MyView failed!");
+                }
             }
-            else
+
+            // Test downcast for class directly inherited from native control
+            MyButton myButton = new MyButton();
+            myButton.Name = "MyButtonName";
+            myButton.MyOwnName = "MyOwnViewName";
+            myButton.LabelText = "MyLabelText";
+            myButton._myCurrentValue = 5;
+
+            Console.WriteLine("myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue);
+
+            container.Add(myButton);
+
+            Actor myButtonActor = container.FindChildByName("MyButtonName");
+            if (myButtonActor)
             {
-              Console.WriteLine("Downcast to Spin failed!");
+                MyButton newButton = View.DownCast<MyButton>(myButtonActor);
+                if (newButton)
+                {
+                    Console.WriteLine("Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue);
+                }
+                else
+                {
+                    Console.WriteLine("Downcast to MyButton failed!");
+                }
             }
-          }
 
-          // Test downcast for class inherited from a CustomView
-          MySpin mySpin = new MySpin();
-          mySpin.Name = "MySpinName";
-          mySpin.MyOwnName = "MyOwnSpinName";
-          mySpin.MaxValue = 8888;
-          mySpin._myCurrentValue = 5;
+            // Test downcast for a CustomView
+            Spin spin = new Spin();
+            spin.Name = "SpinName";
+            spin.MaxValue = 8888;
 
-          Console.WriteLine("mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue);
+            Console.WriteLine("spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue);
 
-          container.Add(mySpin);
+            container.Add(spin);
 
-          Actor mySpinActor  = container.FindChildByName("MySpinName");
-          if(mySpinActor)
-          {
-            MySpin newSpin = View.DownCast<MySpin>(mySpinActor);
-            if(newSpin)
+            Actor spinActor = container.FindChildByName("SpinName");
+            if (spinActor)
             {
-              Console.WriteLine("Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue);
+                Spin newSpin = View.DownCast<Spin>(spinActor);
+                if (newSpin)
+                {
+                    Console.WriteLine("Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue);
+                }
+                else
+                {
+                    Console.WriteLine("Downcast to Spin failed!");
+                }
             }
-            else
+
+            // Test downcast for class inherited from a CustomView
+            MySpin mySpin = new MySpin();
+            mySpin.Name = "MySpinName";
+            mySpin.MyOwnName = "MyOwnSpinName";
+            mySpin.MaxValue = 8888;
+            mySpin._myCurrentValue = 5;
+
+            Console.WriteLine("mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue);
+
+            container.Add(mySpin);
+
+            Actor mySpinActor = container.FindChildByName("MySpinName");
+            if (mySpinActor)
             {
-              Console.WriteLine("Downcast to MySpin failed!");
+                MySpin newSpin = View.DownCast<MySpin>(mySpinActor);
+                if (newSpin)
+                {
+                    Console.WriteLine("Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue);
+                }
+                else
+                {
+                    Console.WriteLine("Downcast to MySpin failed!");
+                }
             }
-          }
+
+            Console.WriteLine("### [7] ViewDownCastTest END");
         }
 
         public void MainLoop()
         {
-            _application.MainLoop ();
+            _application.MainLoop();
         }
 
         /// <summary>
@@ -711,10 +766,12 @@ namespace MyCSharpExample
         [STAThread]
         static void Main(string[] args)
         {
-            Console.WriteLine ("Hello Mono World");
+            Console.WriteLine("Hello World");
 
             Example example = new Example(Application.NewApplication());
-            example.MainLoop ();
+            example.MainLoop();
         }
     }
 }
+
+
index d775fbe..8687aa0 100755 (executable)
@@ -22,114 +22,113 @@ using Dali.Constants;
 
 namespace MyCSharpExample
 {
-  class Example
-  {
-    private Dali.Application _application;
-    private Animation _animation;
-    private TextLabel _text;
-
-    public Example(Dali.Application application)
-    {
-      _application = application;
-      _application.Initialized += Initialize;
-    }
-
-    public void Initialize(object source, NUIApplicationInitEventArgs e)
+    class Example
     {
-      Console.WriteLine("Customized Application Initialize event handler");
-      Stage stage = Stage.Instance;
-      stage.BackgroundColor = Color.White;
-      stage.Touch += OnStageTouched;
-
-      // Add a _text label to the stage
-      _text = new TextLabel("Hello Mono World");
-      _text.ParentOrigin = ParentOrigin.Center;
-      _text.AnchorPoint = AnchorPoint.Center;
-      _text.HorizontalAlignment = "CENTER";
-      _text.PointSize = 32.0f;
-      _text.TextColor = Color.Magenta;
-      stage.Add(_text);
+        private Dali.Application _application;
+        private Animation _animation;
+        private TextLabel _text;
+        private Stage _stage;
 
-    }
+        public Example(Dali.Application application)
+        {
+            _application = application;
+            _application.Initialized += Initialize;
+        }
 
-    // Callback for _animation finished signal handling
-    public void AnimationFinished(object sender, EventArgs e)
-    {
-      Console.WriteLine("AnimationFinished()!");
-      if(_animation)
-      {
-        Console.WriteLine("Duration= " + _animation.Duration);
-        Console.WriteLine("EndAction= " + _animation.EndAction);
-      }
-    }
+        public void Initialize(object source, NUIApplicationInitEventArgs e)
+        {
+            Console.WriteLine("Customized Application Initialize event handler");
+            _stage = Stage.Instance;
+            _stage.BackgroundColor = Color.White;
+            _stage.Touch += OnStageTouched;
+
+            // Add a _text label to the stage
+            _text = new TextLabel("Hello Mono World");
+            _text.ParentOrigin = ParentOrigin.Center;
+            _text.AnchorPoint = AnchorPoint.Center;
+            _text.HorizontalAlignment = "CENTER";
+            _text.PointSize = 32.0f;
+            _text.TextColor = Color.Magenta;
+            _stage.Add(_text);
+
+            _animation = new Animation
+            {
+                StartTime = 0,
+                EndTime = 500,
+                TargetProperty = "Orientation",
+                Destination = new Rotation(new Radian(new Degree(180.0f)), Vect3.Xaxis)
+            };
+            _animation.AnimateTo(_text);
+
+            _animation.StartTime = 500;
+            _animation.EndTime = 1000;
+            _animation.TargetProperty = "Orientation";
+            _animation.Destination = new Rotation(new Radian(new Degree(0.0f)), Vect3.Xaxis);
+            _animation.AnimateTo(_text);
+
+            _animation.StartTime = 1000;
+            _animation.EndTime = 1500;
+            _animation.TargetProperty = "ScaleX";
+            _animation.Destination = 3.0f;
+            _animation.AnimateBy(_text);
+
+            _animation.StartTime = 1500;
+            _animation.EndTime = 2000;
+            _animation.TargetProperty = "ScaleY";
+            _animation.Destination = 4.0f;
+            _animation.AnimateBy(_text);
+
+            _animation.EndAction = Animation.EndActions.Discard;
+
+            // Connect the signal callback for animaiton finished signal
+            _animation.Finished += AnimationFinished;
+        }
 
-    // Callback for stage touched signal handling
-    public void OnStageTouched(object sender, Stage.TouchEventArgs e)
-    {
-      // Only animate the _text label when touch down happens
-      if( e.Touch.GetState(0) == PointStateType.DOWN )
-      {
-        Console.WriteLine("Customized Stage Touch event handler");
-        // Create a new _animation
-        if( _animation )
+        // Callback for _animation finished signal handling
+        public void AnimationFinished(object sender, EventArgs e)
         {
-          //_animation.Stop(Dali.Constants.Animation.EndAction.Stop);
-          _animation.Reset();
+            Console.WriteLine("AnimationFinished()!");
+            if (_animation)
+            {
+                Console.WriteLine("Duration= " + _animation.Duration);
+                Console.WriteLine("EndAction= " + _animation.EndAction);
+            }
         }
 
-        _animation = new Animation {
-          Duration = 2000,
-          StartTime = 0,
-          EndTime = 500,
-          TargetProperty = "Orientation",
-          Destination = new Rotation( new Radian( new Degree( 180.0f ) ), Vect3.Xaxis)
-        };
-        _animation.AnimateTo(_text);
-
-        _animation.StartTime = 500;
-        _animation.EndTime = 1000;
-        _animation.TargetProperty = "Orientation";
-        _animation.Destination = new Rotation( new Radian( new Degree( 0.0f ) ), Vect3.Xaxis );
-        _animation.AnimateTo(_text);
-
-        _animation.StartTime = 1000;
-        _animation.EndTime = 1500;
-        _animation.TargetProperty = "ScaleX";
-        _animation.Destination = 3.0f;
-        _animation.AnimateBy(_text);
-
-        _animation.StartTime = 1500;
-        _animation.EndTime = 2000;
-        _animation.TargetProperty = "ScaleY";
-        _animation.Destination = 4.0f;
-        _animation.AnimateBy(_text);
-
-        _animation.EndAction = Animation.EndActions.Discard;
-
-        // Connect the signal callback for animaiton finished signal
-        _animation.Finished += AnimationFinished;
-
-        // Play the _animation
-        _animation.Play();
-
-      }
-    }
+        // Callback for stage touched signal handling
+        public void OnStageTouched(object sender, Stage.TouchEventArgs e)
+        {
+            // Only animate the _text label when touch down happens
+            if (e.Touch.GetState(0) == PointStateType.DOWN)
+            {
+                Console.WriteLine("Customized Stage Touch event handler");
+
+                // Create a new _animation
+                if (_animation)
+                {
+                    _animation.Stop();
+                }
+                // Play the _animation
+                _animation.Play();
+            }
+        }
 
-    public void MainLoop()
-    {
-      _application.MainLoop ();
-    }
+        public void MainLoop()
+        {
+            _application.MainLoop();
+        }
 
-    /// <summary>
-    /// The main entry point for the application.
-    /// </summary>
-    [STAThread]
-    static void Main(string[] args)
-    {
-      Console.WriteLine ("Main() called!");
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main(string[] args)
+        {
+            Console.WriteLine("Main() called!");
 
-      Example example = new Example(Application.NewApplication());
-      example.MainLoop ();
+            Example example = new Example(Application.NewApplication());
+            example.MainLoop();
+        }
     }
-  }
 }
+
index 7cd5359..b8215ef 100755 (executable)
@@ -1,5 +1,4 @@
-/*
-* Copyright (c) 2016 Samsung Electronics Co., Ltd.
+/** 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.
@@ -23,217 +22,218 @@ using Dali.Constants;
 namespace ImageViewExample
 {
 
-  class Example
-  {
-    public static void Log(string str)
+    class Example
     {
-      Console.WriteLine("[DALI C# SAMPLE] " + str);
-    }
+        public static void Log(string str)
+        {
+            Console.WriteLine("[DALI C# SAMPLE] " + str);
+        }
 
-    private Dali.Application _application;
-    private Animation _animation;
-    private ImageView _imageView;
-    private bool _isAniFinised = true;
-    private Layer layer, _layer1, _layer2;
-    private PushButton _pushButton1, _pushButton2;
-    private Stage stage;
+        private Dali.Application _application;
+        private Animation _animation;
+        private ImageView _imageView;
+        private bool _isAniFinised = true;
+        private Layer layer, _layer1, _layer2;
+        private PushButton _pushButton1, _pushButton2;
+        private Stage stage;
 
-    public Example(Dali.Application application)
-    {
-      _application = application;
-      _application.Initialized += Initialize;
-    }
-
-    public void Initialize(object source, NUIApplicationInitEventArgs e)
-    {
-      Log("Customized Application Initialize event handler");
-      stage = Stage.Instance;
-      stage.BackgroundColor = Color.Cyan;
-      stage.Touch += OnStageTouched;
-      stage.Wheel += OnStageWheelMoved;
-      stage.Key += OnStageKeyPressed;
-      //stage.EventProcessingFinished += OnStageEventProcessingFinished;
-
-      layer = stage.GetDefaultLayer();
-      _layer1 = new Layer();
-      _layer2 = new Layer();
-      stage.AddLayer(_layer1);
-      stage.AddLayer(_layer2);
-      Log("_layer1.Behavior =" + _layer1.Behavior );
-      if( _layer1.Behavior == Layer.LayerBehavior.LAYER_UI )
-      {
-        _layer1.Behavior = Layer.LayerBehavior.LAYER_2D;
-        Log("again _layer1.Behavior =" + _layer1.Behavior );
-      }
-      // Add a ImageView to the stage
-      _imageView = new ImageView();
-      _imageView.ResourceUrl = "./images/gallery-3.jpg";
-      _imageView.ParentOrigin = ParentOrigin.Center;
-      _imageView.AnchorPoint = AnchorPoint.Center;
-      _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
-      //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
-      layer.Add(_imageView);
-
-      _pushButton1 = new PushButton();
-      _pushButton1.ParentOrigin = ParentOrigin.BottomLeft;
-      _pushButton1.AnchorPoint = AnchorPoint.BottomLeft;
-      _pushButton1.LabelText = "start animation";
-      _pushButton1.Position = new Vector3(0.0f, stage.Size.Height * 0.1f, 0.0f);
-      _pushButton1.Clicked += OnPushButtonClicked1;
-      _layer1.Add(_pushButton1);
-
-      _pushButton2 = new PushButton();
-      _pushButton2.ParentOrigin = ParentOrigin.BottomLeft;
-      _pushButton2.AnchorPoint = AnchorPoint.BottomLeft;
-      _pushButton2.LabelText = "reload image with same URL";
-      _pushButton2.Position = new Vector3(0.0f, stage.Size.Height * 0.2f, 0.0f);
-      _pushButton2.Clicked += OnPushButtonClicked2;
-      _layer2.Add(_pushButton2);
+        public Example(Dali.Application application)
+        {
+            _application = application;
+            _application.Initialized += Initialize;
+        }
 
-    }
+        public void Initialize(object source, NUIApplicationInitEventArgs e)
+        {
+            Log("Customized Application Initialize event handler");
+            stage = Stage.Instance;
+            stage.BackgroundColor = Color.Cyan;
+            stage.Touch += OnStageTouched;
+            stage.Wheel += OnStageWheelMoved;
+            stage.Key += OnStageKeyPressed;
+            //stage.EventProcessingFinished += OnStageEventProcessingFinished;
+
+            layer = stage.GetDefaultLayer();
+            _layer1 = new Layer();
+            _layer2 = new Layer();
+            stage.AddLayer(_layer1);
+            stage.AddLayer(_layer2);
+            Log("_layer1.Behavior =" + _layer1.Behavior);
+            if (_layer1.Behavior == Layer.LayerBehavior.LAYER_UI)
+            {
+                _layer1.Behavior = Layer.LayerBehavior.LAYER_2D;
+                Log("again _layer1.Behavior =" + _layer1.Behavior);
+            }
+            // Add a ImageView to the stage
+            _imageView = new ImageView();
+            _imageView.ResourceUrl = "./images/gallery-3.jpg";
+            _imageView.ParentOrigin = ParentOrigin.Center;
+            _imageView.AnchorPoint = AnchorPoint.Center;
+            _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
+            //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
+            layer.Add(_imageView);
+
+            _pushButton1 = new PushButton();
+            _pushButton1.ParentOrigin = ParentOrigin.BottomLeft;
+            _pushButton1.AnchorPoint = AnchorPoint.BottomLeft;
+            _pushButton1.LabelText = "start animation";
+            _pushButton1.Position = new Vector3(0.0f, stage.Size.Height * 0.1f, 0.0f);
+            _pushButton1.Clicked += OnPushButtonClicked1;
+            _layer1.Add(_pushButton1);
+
+            _pushButton2 = new PushButton();
+            _pushButton2.ParentOrigin = ParentOrigin.BottomLeft;
+            _pushButton2.AnchorPoint = AnchorPoint.BottomLeft;
+            _pushButton2.LabelText = "reload image with same URL";
+            _pushButton2.Position = new Vector3(0.0f, stage.Size.Height * 0.2f, 0.0f);
+            _pushButton2.Clicked += OnPushButtonClicked2;
+            _layer2.Add(_pushButton2);
 
-    public bool OnPushButtonClicked2(object sender, Button.ClickedEventArgs e)
-    {
-      if( _imageView )
-      {
-        Log("OnPushButtonClicked2()!");
-        layer.Remove(_imageView);
-        _imageView = new ImageView();
-        _imageView.ResourceUrl = "./images/gallery-3.jpg";
-        _imageView.ParentOrigin = ParentOrigin.Center;
-        _imageView.AnchorPoint = AnchorPoint.Center;
-        _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
-        //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
-        layer.Add(_imageView);
-      }
-
-      return true;
-    }
+        }
 
+        public bool OnPushButtonClicked2(object sender, Button.ClickedEventArgs e)
+        {
+            if (_imageView)
+            {
+                Log("OnPushButtonClicked2()!");
+                layer.Remove(_imageView);
+                _imageView = new ImageView();
+                _imageView.ResourceUrl = "./images/gallery-3.jpg";
+                _imageView.ParentOrigin = ParentOrigin.Center;
+                _imageView.AnchorPoint = AnchorPoint.Center;
+                _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f);
+                //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS);
+                layer.Add(_imageView);
+            }
+
+            return true;
+        }
 
-    public bool OnPushButtonClicked1(object sender, Button.ClickedEventArgs e)
-    {
-      if( _isAniFinised == true )
-      {
-        _isAniFinised = false;
-        Log("OnPushButtonClicked1()!");
 
-        // Create a new _animation
-        if( _animation )
+        public bool OnPushButtonClicked1(object sender, Button.ClickedEventArgs e)
         {
-          //_animation.Stop(Dali.Constants.Animation.EndAction.Stop);
-          _animation.Reset();
+            if (_isAniFinised == true)
+            {
+                _isAniFinised = false;
+                Log("OnPushButtonClicked1()!");
+
+                // Create a new _animation
+                if (_animation)
+                {
+                    //_animation.Stop(Dali.Constants.Animation.EndAction.Stop);
+                    _animation.Reset();
+                }
+
+                _animation = new Animation();
+                _animation.StartTime = 0;
+                _animation.EndTime = 1000;
+                _animation.TargetProperty = "PixelArea";
+                _animation.Destination = new Vector4(0.5f, 0.0f, 0.5f, 0.5f);
+                _animation.AnimateTo(_imageView);
+
+                _animation.StartTime = 1000;
+                _animation.EndTime = 2000;
+                _animation.TargetProperty = "PixelArea";
+                _animation.Destination = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
+                _animation.AnimateTo(_imageView);
+
+                _animation.StartTime = 2000;
+                _animation.EndTime = 3000;
+                _animation.TargetProperty = "PixelArea";
+                _animation.Destination = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
+                _animation.AnimateTo(_imageView);
+
+                _animation.StartTime = 3000;
+                _animation.EndTime = 4000;
+                _animation.TargetProperty = "PixelArea";
+                _animation.Destination = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
+                _animation.AnimateTo(_imageView);
+
+                _animation.StartTime = 4000;
+                _animation.EndTime = 6000;
+                _animation.TargetProperty = "Size";
+                KeyFrames _keyFrames = new KeyFrames();
+                _keyFrames.Add(0.0f, new Size3D(0.0f, 0.0f, 0.0f));
+                _keyFrames.Add(0.3f, new Size3D((stage.Size * 0.7f)));
+                _keyFrames.Add(1.0f, new Size3D(stage.Size));
+                _animation.AnimateBetween(_imageView, _keyFrames, Animation.Interpolation.Linear);
+
+                _animation.EndAction = Animation.EndActions.Discard;
+
+                // Connect the signal callback for animaiton finished signal
+                _animation.Finished += AnimationFinished;
+                _animation.Finished += AnimationFinished2;
+
+                // Play the _animation
+                _animation.Play();
+            }
+
+            return true;
         }
 
-        _animation = new Animation();
-        _animation.StartTime = 0;
-        _animation.EndTime = 1000;
-        _animation.TargetProperty = "PixelArea";
-        _animation.Destination = new Vector4(0.5f, 0.0f, 0.5f, 0.5f);
-        _animation.AnimateTo(_imageView);
-
-        _animation.StartTime = 1000;
-        _animation.EndTime = 2000;
-        _animation.TargetProperty = "PixelArea";
-        _animation.Destination = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
-        _animation.AnimateTo(_imageView);
-
-        _animation.StartTime = 2000;
-        _animation.EndTime = 3000;
-        _animation.TargetProperty = "PixelArea";
-        _animation.Destination = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
-        _animation.AnimateTo(_imageView);
-
-        _animation.StartTime = 3000;
-        _animation.EndTime = 4000;
-        _animation.TargetProperty = "PixelArea";
-        _animation.Destination = new Vector4(0.5f, 0.5f, 0.5f, 0.5f);
-        _animation.AnimateTo(_imageView);
-
-        _animation.StartTime = 4000;
-        _animation.EndTime = 6000;
-        _animation.TargetProperty = "Size";
-        KeyFrames _keyFrames = new KeyFrames();
-        _keyFrames.Add(0.0f, new Size3D(0.0f, 0.0f, 0.0f) );
-        _keyFrames.Add(0.3f, new Size3D( (stage.Size * 0.7f) ) );
-        _keyFrames.Add(1.0f, new Size3D( stage.Size ) );
-        _animation.AnimateBetween(_imageView, _keyFrames, Animation.Interpolation.Linear);
-
-        _animation.EndAction = Animation.EndActions.Discard;
-
-        // Connect the signal callback for animaiton finished signal
-        _animation.Finished += AnimationFinished;
-        _animation.Finished += AnimationFinished2;
-
-        // Play the _animation
-        _animation.Play();
-      }
-
-      return true;
-    }
-
-    // Callback for _animation finished signal handling
-    public void AnimationFinished(object sender, EventArgs e)
-    {
-        Log("AnimationFinished()!");
-    }
+        // Callback for _animation finished signal handling
+        public void AnimationFinished(object sender, EventArgs e)
+        {
+            Log("AnimationFinished()!");
+        }
 
-    // Callback for second _animation finished signal handling
-    public void AnimationFinished2(object sender, EventArgs e)
-    {
-      Log("AnimationFinished2()!");
-      if(_animation)
-      {
-        Log("Duration= " + _animation.Duration);
-        Log("EndAction= " + _animation.EndAction);
-        _isAniFinised = true;
-      }
-    }
+        // Callback for second _animation finished signal handling
+        public void AnimationFinished2(object sender, EventArgs e)
+        {
+            Log("AnimationFinished2()!");
+            if (_animation)
+            {
+                Log("Duration= " + _animation.Duration);
+                Log("EndAction= " + _animation.EndAction);
+                _isAniFinised = true;
+            }
+        }
 
-    public void OnStageEventProcessingFinished(object sender, EventArgs e)
-    {
-      Log("OnStageEventProcessingFinished()!");
-      if( e != null)
-      {
-        Log("e != null !");
-      }
-    }
+        public void OnStageEventProcessingFinished(object sender, EventArgs e)
+        {
+            Log("OnStageEventProcessingFinished()!");
+            if (e != null)
+            {
+                Log("e != null !");
+            }
+        }
 
-    public void OnStageKeyPressed(object sender, Stage.KeyEventArgs e)
-    {
-      Log("OnStageKeyEventOccured()!");
-      Log("keyPressedName=" + e.Key.KeyPressedName);
-      Log("state=" + e.Key.State);
-    }
+        public void OnStageKeyPressed(object sender, Stage.KeyEventArgs e)
+        {
+            Log("OnStageKeyEventOccured()!");
+            Log("keyPressedName=" + e.Key.KeyPressedName);
+            Log("state=" + e.Key.State);
+        }
 
-    public void OnStageWheelMoved(object sender, Stage.WheelEventArgs e)
-    {
-      Log("OnStageWheelEventOccured()!");
-      Log("direction=" + e.Wheel.Direction);
-      Log("type=" + e.Wheel.Type);
-    }
+        public void OnStageWheelMoved(object sender, Stage.WheelEventArgs e)
+        {
+            Log("OnStageWheelEventOccured()!");
+            Log("direction=" + e.Wheel.Direction);
+            Log("type=" + e.Wheel.Type);
+        }
 
-    // Callback for stage touched signal handling
-    public void OnStageTouched(object sender, Stage.TouchEventArgs e)
-    {
-      Log("OnStageTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0));
-    }
+        // Callback for stage touched signal handling
+        public void OnStageTouched(object sender, Stage.TouchEventArgs e)
+        {
+            Log("OnStageTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0));
+        }
 
-    public void MainLoop()
-    {
-      _application.MainLoop ();
-    }
+        public void MainLoop()
+        {
+            _application.MainLoop();
+        }
 
-    /// <summary>
-    /// The main entry point for the application.
-    /// </summary>
-    [STAThread]
-    static void Main(string[] args)
-    {
-      Log("Main() called!");
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main(string[] args)
+        {
+            Log("Main() called!");
 
-      Example example = new Example(Application.NewApplication());
-      example.MainLoop ();
+            Example example = new Example(Application.NewApplication());
+            example.MainLoop();
+        }
     }
-  }
 }
+
index cc42168..c4cf845 100755 (executable)
@@ -56,8 +56,8 @@ namespace MyCSharpExample
       _scrollView = new ScrollView();
       Size stageSize = stage.Size;
       _scrollView.Size = new Position(stageSize.W, stageSize.H, 0.0f);
-      _scrollView.ParentOrigin = NDalic.ParentOriginCenter;
-      _scrollView.AnchorPoint = NDalic.AnchorPointCenter;
+      _scrollView.Position = new Position(0,0,0);
+      _scrollView.AnchorPoint = NDalic.AnchorPointTopLeft;
       stage.Add(_scrollView);
 
       // Add actors to a scroll view with 3 pages
@@ -69,8 +69,7 @@ namespace MyCSharpExample
         {
           View pageActor = new View();
           pageActor.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.ALL_DIMENSIONS);
-          pageActor.ParentOrigin = NDalic.ParentOriginCenter;
-          pageActor.AnchorPoint = NDalic.AnchorPointCenter;
+          pageActor.AnchorPoint = NDalic.AnchorPointTopLeft;
           pageActor.Position = new Position(pageColumn * stageSize.W, pageRow * stageSize.H, 0.0f);
 
           // Add images in a 3x4 grid layout for each page
@@ -125,8 +124,7 @@ namespace MyCSharpExample
       _scrollView.WheelMoved += Onwheel;
       _scrollView.KeyInputFocusGained += OnKey;
       _text = new TextLabel("View Touch Event Handler Test");
-      _text.ParentOrigin = NDalic.ParentOriginCenter;
-      _text.AnchorPoint = NDalic.AnchorPointCenter;
+      _text.AnchorPoint = NDalic.AnchorPointTopLeft;
       _text.HorizontalAlignment = "CENTER";
       _text.PointSize = 48.0f;
 
index 5b521b0..40415f9 100755 (executable)
@@ -1,5 +1,4 @@
-/*
-* Copyright (c) 2016 Samsung Electronics Co., Ltd.
+/** 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.
@@ -22,176 +21,175 @@ using Dali.Constants;
 
 namespace MyCSharpExample
 {
-  class Example
-  {
-    private Dali.Application _application;
-    private Animation _animation;
-    private TextLabel _text;
-    private View _view1, _view2, _view3;
-    private UserAlphaFunctionDelegate _user_alpha_func;
-    private int myCount;
-
-    public static void Log(string str)
+    class Example
     {
-      Console.WriteLine("[DALI C# SAMPLE] " + str);
-    }
+        private Dali.Application _application;
+        private Animation _animation;
+        private TextLabel _text;
+        private View _view1, _view2, _view3;
+        private UserAlphaFunctionDelegate _user_alpha_func;
+        private int myCount;
+
+        public static void Log(string str)
+        {
+            Console.WriteLine("[DALI C# SAMPLE] " + str);
+        }
 
-    public Example(Dali.Application application)
-    {
-      _application = application;
-      _application.Initialized += Initialize;
-    }
+        public Example(Dali.Application application)
+        {
+            _application = application;
+            _application.Initialized += Initialize;
+        }
 
-    // Declare user alpha function delegate
-    [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-    delegate float UserAlphaFunctionDelegate(float progress);
+        // Declare user alpha function delegate
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        delegate float UserAlphaFunctionDelegate(float progress);
 
-    public void Initialize(object source, NUIApplicationInitEventArgs e)
-    {
-      Log("Initialize() is called!");
-      Stage stage = Stage.GetCurrent();
-      stage.BackgroundColor = Color.White;
-      stage.Touch += OnStageTouched;
-      stage.Touch += OnStageTouched2;
-      //stage.EventProcessingFinished += OnEventProcessingFinished;
-      stage.Wheel += OnStageWheelEvent;
-
-      // Add a _text label to the stage
-      _text = new TextLabel("Hello Mono World");
-      _text.ParentOrigin = ParentOrigin.BottomCenter;
-      _text.AnchorPoint = AnchorPoint.BottomCenter;
-      _text.HorizontalAlignment = "CENTER";
-      _text.PointSize = 32.0f;
-      stage.Add(_text);
-
-      _view1 = new View();
-      _view1.Size = new Vector3(200.0f, 200.0f, 0.0f);
-      _view1.BackgroundColor = Color.Green;
-      _view1.ParentOrigin = ParentOrigin.Center;
-      _view1.AnchorPoint = AnchorPoint.Center;
-      _view1.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
-      _view1.OnStageEvent += OnStage;
-      stage.Add(_view1);
-
-      _view2 = new View();
-      _view2.BackgroundColor = Color.Red;
-      _view2.Size = new Vector3(50.0f, 50.0f, 0.0f);
-      _view2.ParentOrigin = ParentOrigin.TopLeft;
-      _view2.AnchorPoint = AnchorPoint.TopLeft;
-      _view2.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
-      _view1.Add(_view2);
-
-      _view3 = new View();
-      _view3.BackgroundColor = Color.Blue;
-      _view3.Size = new Vector3(50.0f, 50.0f, 0.0f);
-      _view3.ParentOrigin = ParentOrigin.TopLeft;
-      _view3.AnchorPoint = AnchorPoint.TopLeft;
-      _view3.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
-      _view1.Add(_view3);
-
-      _user_alpha_func = new UserAlphaFunctionDelegate(body);
-
-      MyAnimating();
-    }
+        public void Initialize(object source, NUIApplicationInitEventArgs e)
+        {
+            Log("Initialize() is called!");
+            Stage stage = Stage.GetCurrent();
+            stage.BackgroundColor = Color.White;
+            stage.Touch += OnStageTouched;
+            stage.Touch += OnStageTouched2;
+            stage.Wheel += OnStageWheelEvent;
+
+            // Add a _text label to the stage
+            _text = new TextLabel("Hello Mono World");
+            _text.ParentOrigin = ParentOrigin.BottomCenter;
+            _text.AnchorPoint = AnchorPoint.BottomCenter;
+            _text.HorizontalAlignment = "CENTER";
+            _text.PointSize = 32.0f;
+            stage.Add(_text);
+
+            _view1 = new View();
+            _view1.Size = new Vector3(200.0f, 200.0f, 0.0f);
+            _view1.BackgroundColor = Color.Green;
+            _view1.ParentOrigin = ParentOrigin.Center;
+            _view1.AnchorPoint = AnchorPoint.Center;
+            _view1.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
+            _view1.OnStageEvent += OnStage;
+            stage.Add(_view1);
+
+            _view2 = new View();
+            _view2.BackgroundColor = Color.Red;
+            _view2.Size = new Vector3(50.0f, 50.0f, 0.0f);
+            _view2.ParentOrigin = ParentOrigin.TopLeft;
+            _view2.AnchorPoint = AnchorPoint.TopLeft;
+            _view2.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
+            _view1.Add(_view2);
+
+            _view3 = new View();
+            _view3.BackgroundColor = Color.Blue;
+            _view3.Size = new Vector3(50.0f, 50.0f, 0.0f);
+            _view3.ParentOrigin = ParentOrigin.TopLeft;
+            _view3.AnchorPoint = AnchorPoint.TopLeft;
+            _view3.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
+            _view1.Add(_view3);
+
+            _user_alpha_func = new UserAlphaFunctionDelegate(body);
+
+            MyAnimating();
+        }
 
-    // User defines alpha function as custom alpha function
-    // Important Notification : when this custom alpha-function is implemented,
-    // the other function call nor other data excess is prevented.
-    // this method must be implemented to calculate the values of input and output purely.
-    // unless, this will cause application crash.
-    float body(float progress)
-    {
-      if (progress > 0.2f && progress< 0.7f)
-      {
-        return progress + 0.8f;
-      }
-      return progress;
-    }
+        // User defines alpha function as custom alpha function
+        // Important Notification : when this custom alpha-function is implemented,
+        // the other function call nor other data excess is prevented.
+        // this method must be implemented to calculate the values of input and output purely.
+        // unless, this will cause application crash.
+        float body(float progress)
+        {
+            if (progress > 0.2f && progress < 0.7f)
+            {
+                return progress + 0.8f;
+            }
+            return progress;
+        }
 
-    // Callback for _animation finished signal handling
-    public void AnimationFinished(object sender, EventArgs e)
-    {
-        Log("AnimationFinished() is called!");
-        myCount = 0;
-    }
+        // Callback for _animation finished signal handling
+        public void AnimationFinished(object sender, EventArgs e)
+        {
+            Log("AnimationFinished() is called!");
+            myCount = 0;
+        }
 
-    public void MyAnimating()
-    {
-      // Create a new _animation
-      if( _animation )
-      {
-        _animation.Clear();
-        _animation.Reset();
-      }
-
-      _animation = new Animation(10000); // 10000 milli-second of duration
-      _animation.StartTime = 5000;
-      _animation.EndTime = 10000;
-      _animation.TargetProperty = "Position";
-      _animation.AlphaFunction = new AlphaFunction(_user_alpha_func);
-      _animation.Destination = new Vector3(150.0f, 150.0f, 0.0f);
-      _animation.AnimateTo(_view2);
-      // Connect the signal callback for animaiton finished signal
-      _animation.Finished += AnimationFinished;
-      _animation.EndAction = Animation.EndActions.Discard;
-      // Play the _animation
-      _animation.Play();
-    }
+        public void MyAnimating()
+        {
+            // Create a new _animation
+            if (_animation)
+            {
+                _animation.Clear();
+                _animation.Reset();
+            }
+
+            _animation = new Animation(10000); // 10000 milli-second of duration
+            _animation.StartTime = 5000;
+            _animation.EndTime = 10000;
+            _animation.TargetProperty = "Position";
+            _animation.AlphaFunction = new AlphaFunction(_user_alpha_func);
+            _animation.Destination = new Vector3(150.0f, 150.0f, 0.0f);
+            _animation.AnimateTo(_view2);
+            // Connect the signal callback for animaiton finished signal
+            _animation.Finished += AnimationFinished;
+            _animation.EndAction = Animation.EndActions.Discard;
+            // Play the _animation
+            _animation.Play();
+        }
 
-    // Callback for stage touched signal handling
-    public void OnStageTouched(object source, Stage.TouchEventArgs e)
-    {
-      // Only animate the _text label when touch down happens
-      if( e.Touch.GetState(0) == PointStateType.DOWN )
-      {
-        Log("OnStageTouched() is called! PointStateType.DOWN came!");
-        myCount++;
-        if( myCount > 1 )
+        // Callback for stage touched signal handling
+        public void OnStageTouched(object source, Stage.TouchEventArgs e)
         {
-          _animation.Stop();
-          Log("_animation.Stop() is called!");
+            // Only animate the _text label when touch down happens
+            if (e.Touch.GetState(0) == PointStateType.DOWN)
+            {
+                Log("OnStageTouched() is called! PointStateType.DOWN came!");
+                myCount++;
+                if (myCount > 1)
+                {
+                    _animation.Stop();
+                    Log("_animation.Stop() is called!");
+                }
+            }
         }
-      }
-    }
 
-    // Callback for stage touched signal handling
-    public void OnStageTouched2(object source, Stage.TouchEventArgs e)
-    {
-      Log("OnStageTouched2() is called!state="+ e.Touch.GetState(0) );
-    }
+        // Callback for stage touched signal handling
+        public void OnStageTouched2(object source, Stage.TouchEventArgs e)
+        {
+            Log("OnStageTouched2() is called!state=" + e.Touch.GetState(0));
+        }
 
-    public void OnEventProcessingFinished(object source)
-       {
-      Log("OnEventProcessingFinished() is called!");
-    }
+        public void OnEventProcessingFinished(object source)
+        {
+            Log("OnEventProcessingFinished() is called!");
+        }
 
-    public void OnStageWheelEvent(object source, Stage.WheelEventArgs e)
-    {
-      Log("OnStageWheelEvent() is called!");
-      //Log("OnStageWheelEvent() is called!direction="+ e.WheelEvent.direction + " timeStamp=" + e.WheelEvent.timeStamp );
-    }
+        public void OnStageWheelEvent(object source, Stage.WheelEventArgs e)
+        {
+            Log("OnStageWheelEvent() is called!");
+        }
 
 
-    public void OnStage(object source , View.OnStageEventArgs e)
-       {
-      Log("OnStage() is called!");
-       }
+        public void OnStage(object source, View.OnStageEventArgs e)
+        {
+            Log("OnStage() is called!");
+        }
 
-    public void MainLoop()
-    {
-      _application.MainLoop ();
-    }
+        public void MainLoop()
+        {
+            _application.MainLoop();
+        }
 
-    [STAThread]
-    static void Main(string[] args)
-    {
-      Log("Main() is called!");
+        [STAThread]
+        static void Main(string[] args)
+        {
+            Log("Main() is called!");
 
-      Example example = new Example(Application.NewApplication());
-      example.MainLoop ();
+            Example example = new Example(Application.NewApplication());
+            example.MainLoop();
 
-      Log("After MainLoop()");
+            Log("After MainLoop()");
+        }
     }
-  }
 }
 
+
diff --git a/plugins/dali-swig/manual/cpp/callbackbase_wrap.cpp b/plugins/dali-swig/manual/cpp/callbackbase_wrap.cpp
deleted file mode 100644 (file)
index 6b925d4..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2016 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_CALLBACK_BASE
-#define CSHARP_CALLBACK_BASE
-#endif
-
-#include "common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_MakeCallback(void * jarg1) {
-  void * jresult ;
-  void (*arg1)(void) = (void (*)(void)) 0 ;
-  Dali::CallbackBase *result = 0 ;
-
-  arg1 = (void (*)(void))jarg1;
-  {
-    try {
-      result = (Dali::CallbackBase *)Dali::MakeCallback(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 (...) {
-      {
-        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
-      };
-    }
-  }
-
-  jresult = (void *)result;
-
-  return jresult;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/plugins/dali-swig/manual/cpp/event-thread-callback-wrap.cpp b/plugins/dali-swig/manual/cpp/event-thread-callback-wrap.cpp
new file mode 100644 (file)
index 0000000..736c697
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * 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_EVENT_THREAD_CALLBACK
+#define CSHARP_EVENT_THREAD_CALLBACK
+#endif
+
+#include "common.h"
+#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (SWIGSTDCALL* SWIG_CallbackMakeCallback)(void);
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_EventThreadCallback(SWIG_CallbackMakeCallback callbackOnMakeCallback) {
+  void * jresult ;
+  void (*arg1)(void) = (void (*)(void)) 0 ;
+  Dali::EventThreadCallback *result = 0 ;
+
+  arg1 = (void (*)(void))callbackOnMakeCallback;
+  {
+    try {
+      result = (Dali::EventThreadCallback *)new Dali::EventThreadCallback((Dali::CallbackBase *)Dali::MakeCallback(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 (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return 0;
+      };
+    }
+  }
+  jresult = (void *)result;
+  return jresult;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_EventThreadCallback(void * jarg1) {
+  Dali::EventThreadCallback *arg1 = (Dali::EventThreadCallback *) 0 ;
+
+  arg1 = (Dali::EventThreadCallback *)jarg1;
+  {
+    try {
+      delete arg1;
+    } 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 (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
+      };
+    }
+  }
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_EventThreadCallback_Trigger(void * jarg1) {
+  Dali::EventThreadCallback *arg1 = (Dali::EventThreadCallback *) 0 ;
+
+  arg1 = (Dali::EventThreadCallback *)jarg1;
+  {
+    try {
+      (arg1)->Trigger();
+    } 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 (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return ;
+      };
+    }
+  }
+}
+
+#ifdef __cplusplus
+}
+#endif //CSHARP_EVENT_THREAD_CALLBACK
+
index a62843b..35acafd 100644 (file)
@@ -12,19 +12,16 @@ using System.Collections.Generic;
 
 namespace Dali
 {
-
     public class DisposeQueue
     {
-        private static DisposeQueue _disposableQueue = new DisposeQueue();
+        private static readonly DisposeQueue _disposableQueue = new DisposeQueue();
         private List<IDisposable> _disposables = new List<IDisposable>();
         private Object _listLock = new object();
-        private delegate int ProcessDisposablesDelegate(IntPtr ptr);
-        private ProcessDisposablesDelegate _disposequeueProcessDisposablesDelegate;
+        private EventThreadCallback _eventThreadCallback;
+        private EventThreadCallback.CallbackDelegate _disposeQueueProcessDisposablesDelegate;
 
         private DisposeQueue()
         {
-          _disposequeueProcessDisposablesDelegate = new ProcessDisposablesDelegate(ProcessDisposables);
-          Application.Instance.AddIdle(_disposequeueProcessDisposablesDelegate);
         }
 
         ~DisposeQueue()
@@ -36,17 +33,25 @@ namespace Dali
             get { return _disposableQueue; }
         }
 
+        public void Initialize()
+        {
+            _disposeQueueProcessDisposablesDelegate = new EventThreadCallback.CallbackDelegate(ProcessDisposables);
+            _eventThreadCallback = new EventThreadCallback(_disposeQueueProcessDisposablesDelegate);
+        }
+
         public void Add(IDisposable disposable)
         {
-            lock(_listLock)
+            lock (_listLock)
             {
                 _disposables.Add(disposable);
             }
+
+            _eventThreadCallback.Trigger();
         }
 
-        private int ProcessDisposables(IntPtr ptr)
+        private void ProcessDisposables()
         {
-            lock(_listLock)
+            lock (_listLock)
             {
                 foreach (IDisposable disposable in _disposables)
                 {
@@ -54,7 +59,6 @@ namespace Dali
                 }
                 _disposables.Clear();
             }
-            return 0;
         }
     }
 }
diff --git a/plugins/dali-swig/manual/csharp/EventThreadCallback.cs b/plugins/dali-swig/manual/csharp/EventThreadCallback.cs
new file mode 100644 (file)
index 0000000..a9434a4
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ *
+ */
+
+namespace Dali
+{
+
+    public class EventThreadCallback : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+        public delegate void CallbackDelegate();
+
+        internal EventThreadCallback(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventThreadCallback obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        ~EventThreadCallback()
+        {
+            Dispose();
+        }
+
+        public virtual void Dispose()
+        {
+            lock (this)
+            {
+                if (swigCPtr.Handle != global::System.IntPtr.Zero)
+                {
+                    if (swigCMemOwn)
+                    {
+                        swigCMemOwn = false;
+                        NDalicManualPINVOKE.delete_EventThreadCallback(swigCPtr);
+                    }
+                    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+                }
+                global::System.GC.SuppressFinalize(this);
+            }
+        }
+
+        public EventThreadCallback(CallbackDelegate func) : this(NDalicManualPINVOKE.new_EventThreadCallback(func), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public void Trigger()
+        {
+            NDalicManualPINVOKE.EventThreadCallback_Trigger(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+    }
+
+}
index 6694174..a7ce0a2 100755 (executable)
@@ -184,8 +184,14 @@ namespace Dali
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_ViewWrapperImpl_ApplyThemeStyle")]
         public static extern void ViewWrapperImpl_ApplyThemeStyle(global::System.Runtime.InteropServices.HandleRef jarg1);
 
-        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_MakeCallback")]
-        public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_new_EventThreadCallback")]
+        public static extern global::System.IntPtr new_EventThreadCallback(EventThreadCallback.CallbackDelegate delegate1);
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_delete_EventThreadCallback")]
+        public static extern void delete_EventThreadCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_EventThreadCallback_Trigger")]
+        public static extern void EventThreadCallback_Trigger(global::System.Runtime.InteropServices.HandleRef jarg1);
 
         [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Actor_Property_SIBLING_ORDER_get")]
         public static extern int Actor_Property_SIBLING_ORDER_get();
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index f0660b1..bcc54ec
@@ -1,19 +1,18 @@
-/*
- * Copyright (c) 2016 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.
- *
- */
+/** 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.
+*
+*/
 
 namespace Dali
 {
@@ -34,12 +33,18 @@ namespace Dali
 
         ~ViewWrapper()
         {
-            Dispose();
+            DisposeQueue.Instance.Add(this);
         }
 
         public override void Dispose()
         {
-            lock(this)
+            if (!Stage.IsInstalled())
+            {
+                DisposeQueue.Instance.Add(this);
+                return;
+            }
+
+            lock (this)
             {
                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
                 {
@@ -55,7 +60,8 @@ namespace Dali
             }
         }
 
-        public ViewWrapper (string typeName, ViewWrapperImpl implementation) : this (NDalicManualPINVOKE.ViewWrapper_New(typeName, ViewWrapperImpl.getCPtr(implementation)), true)
+
+        public ViewWrapper(string typeName, ViewWrapperImpl implementation) : this(NDalicManualPINVOKE.ViewWrapper_New(typeName, ViewWrapperImpl.getCPtr(implementation)), true)
         {
             viewWrapperImpl = implementation;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -81,3 +87,4 @@ namespace Dali
         }
     }
 }
+
index 78cb1f2..179ada4 100755 (executable)
@@ -314,7 +314,7 @@ def writeCSharpData
 
             #exception case <<<
             #Tooltip gives swig build error
-            if( property.name == "Tooltip" )
+            if( property.name == "Tooltip" || property.name == "Color")
                 next
             end
             #exception case >>>
old mode 100644 (file)
new mode 100755 (executable)
index f4d6aec..b1e7e97
@@ -1,19 +1,18 @@
-/*
- * 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.
- *
- */
+/** 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.
+*
+*/
 
 using System;
 using System.Runtime.InteropServices;
@@ -23,292 +22,293 @@ using Dali;
 
 namespace Dali
 {
-public class Spin : CustomView
-  {
-    private VisualBase _arrowVisual;
-    private TextField _textField;
-    private int _arrowVisualPropertyIndex;
-    private string _arrowImage;
-    private int _currentValue;
-    private int _minValue;
-    private int _maxValue;
-    private int _singleStep;
-    private bool _wrappingEnabled;
-    private string _fontFamily;
-    private string _fontStyle;
-    private int _pointSize;
-    private Color _textColor;
-    private Color _textBackgroundColor;
-    private int _maxTextLength;
-
-    // Called by DALi Builder if it finds a Spin control in a JSON file
-    static CustomView CreateInstance()
+    public class Spin : CustomView
     {
-      return new Spin();
-    }
-
-    // static constructor registers the control type (only runs once)
-    static Spin()
-    {
-      // ViewRegistry registers control type with DALi type registery
-      // also uses introspection to find any properties that need to be registered with type registry
-      ViewRegistry.Instance.Register(CreateInstance, typeof(Spin) );
-    }
+        private VisualBase _arrowVisual;
+        private TextField _textField;
+        private int _arrowVisualPropertyIndex;
+        private string _arrowImage;
+        private int _currentValue;
+        private int _minValue;
+        private int _maxValue;
+        private int _singleStep;
+        private bool _wrappingEnabled;
+        private string _fontFamily;
+        private string _fontStyle;
+        private int _pointSize;
+        private Color _textColor;
+        private Color _textBackgroundColor;
+        private int _maxTextLength;
+
+        // Called by DALi Builder if it finds a Spin control in a JSON file
+        static CustomView CreateInstance()
+        {
+            return new Spin();
+        }
 
-    public Spin() : base(typeof(Spin).Name, ViewWrapperImpl.CustomViewBehaviour.REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)
-    {
+        // static constructor registers the control type (only runs once)
+        static Spin()
+        {
+            // ViewRegistry registers control type with DALi type registery
+            // also uses introspection to find any properties that need to be registered with type registry
+            ViewRegistry.Instance.Register(CreateInstance, typeof(Spin));
+        }
 
-    }
+        public Spin() : base(typeof(Spin).Name, ViewWrapperImpl.CustomViewBehaviour.REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)
+        {
 
-    public override void OnInitialize()
-    {
-      // Initialize the propertiesControl
-      _arrowImage = "./images/arrow.png";
-      _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
-      _currentValue = 0;
-      _minValue = 0;
-      _maxValue = 0;
-      _singleStep = 1;
-      _maxTextLength = 0;
-
-      // Create image visual for the arrow keys
-      _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new Dali.Property.Value(_arrowImage), Dali.Property.AccessMode.READ_WRITE);
-      _arrowVisual =  VisualFactory.Get().CreateVisual( _arrowImage, new Uint16Pair(150, 150) );
-      RegisterVisual( _arrowVisualPropertyIndex, _arrowVisual );
-
-      // Create a text field
-      _textField = new TextField();
-      _textField.ParentOrigin = NDalic.ParentOriginCenter;
-      _textField.AnchorPoint = NDalic.AnchorPointCenter;
-      _textField.WidthResizePolicy = "SIZE_RELATIVE_TO_PARENT";
-      _textField.HeightResizePolicy = "SIZE_RELATIVE_TO_PARENT";
-      _textField.SizeModeFactor = new Vector3( 1.0f, 0.45f, 1.0f );
-      _textField.PlaceholderText = "----";
-      _textField.BackgroundColor = _textBackgroundColor;
-      _textField.HorizontalAlignment = "Center";
-      _textField.VerticalAlignment = "Center";
-      _textField.SetKeyboardFocusable(true);
-      _textField.Name = "_textField";
-
-      this.Add(_textField);
-
-      _textField.KeyInputFocusGained += TextFieldKeyInputFocusGained;
-      _textField.KeyInputFocusLost += TextFieldKeyInputFocusLost;
-    }
+        }
 
-    public override Vector3 GetNaturalSize()
-    {
-      return new Vector3(150.0f, 150.0f, 0.0f);
-    }
+        public override void OnInitialize()
+        {
+            // Initialize the propertiesControl
+            _arrowImage = "./images/arrow.png";
+            _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
+            _currentValue = 0;
+            _minValue = 0;
+            _maxValue = 0;
+            _singleStep = 1;
+            _maxTextLength = 0;
+
+            // Create image visual for the arrow keys
+            _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new Dali.Property.Value(_arrowImage), Dali.Property.AccessMode.READ_WRITE);
+            _arrowVisual = VisualFactory.Get().CreateVisual(_arrowImage, new Uint16Pair(150, 150));
+            RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual);
+
+            // Create a text field
+            _textField = new TextField();
+            _textField.ParentOrigin = NDalic.ParentOriginCenter;
+            _textField.AnchorPoint = NDalic.AnchorPointCenter;
+            _textField.WidthResizePolicy = "SIZE_RELATIVE_TO_PARENT";
+            _textField.HeightResizePolicy = "SIZE_RELATIVE_TO_PARENT";
+            _textField.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
+            _textField.PlaceholderText = "----";
+            _textField.BackgroundColor = _textBackgroundColor;
+            _textField.HorizontalAlignment = "Center";
+            _textField.VerticalAlignment = "Center";
+            _textField.SetKeyboardFocusable(true);
+            _textField.Name = "_textField";
+
+            this.Add(_textField);
+
+            _textField.KeyInputFocusGained += TextFieldKeyInputFocusGained;
+            _textField.KeyInputFocusLost += TextFieldKeyInputFocusLost;
+        }
 
-    public void TextFieldKeyInputFocusGained(object source, KeyInputFocusGainedEventArgs e)
-    {
-      // Make sure when the current spin that takes input focus also takes the keyboard focus
-      // For example, when you tap the spin directly
-      FocusManager.Instance.SetCurrentFocusActor(_textField);
-    }
+        public override Vector3 GetNaturalSize()
+        {
+            return new Vector3(150.0f, 150.0f, 0.0f);
+        }
 
-    public void TextFieldKeyInputFocusLost(object source, KeyInputFocusLostEventArgs e)
-    {
-      int previousValue = _currentValue;
+        public void TextFieldKeyInputFocusGained(object source, KeyInputFocusGainedEventArgs e)
+        {
+            // Make sure when the current spin that takes input focus also takes the keyboard focus
+            // For example, when you tap the spin directly
+            FocusManager.Instance.SetCurrentFocusActor(_textField);
+        }
 
-      // If the input value is invalid, change it back to the previous valid value
-      if(int.TryParse(_textField.Text, out _currentValue))
-      {
-        if (_currentValue < _minValue || _currentValue > _maxValue)
+        public void TextFieldKeyInputFocusLost(object source, KeyInputFocusLostEventArgs e)
         {
-          _currentValue = previousValue;
+            int previousValue = _currentValue;
+
+            // If the input value is invalid, change it back to the previous valid value
+            if (int.TryParse(_textField.Text, out _currentValue))
+            {
+                if (_currentValue < _minValue || _currentValue > _maxValue)
+                {
+                    _currentValue = previousValue;
+                }
+            }
+            else
+            {
+                _currentValue = previousValue;
+            }
+
+            // Otherwise take the new value
+            this.Value = _currentValue;
         }
-      }
-      else
-      {
-        _currentValue = previousValue;
-      }
-
-      // Otherwise take the new value
-      this.Value = _currentValue;
-    }
 
-    public override Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, View.KeyboardFocus.Direction direction, bool loopEnabled)
-    {
-      // Respond to Up/Down keys to change the value while keeping the current spin focused
-      Actor nextFocusedActor = currentFocusedActor;
-      if (direction == View.KeyboardFocus.Direction.UP)
-      {
-        this.Value += this.Step;
-        nextFocusedActor = _textField;
-      }
-      else if (direction == View.KeyboardFocus.Direction.DOWN)
-      {
-        this.Value -= this.Step;
-        nextFocusedActor = _textField;
-      }
-      else
-      {
-        // Return a native empty handle as nothing can be focused in the left or right
-        nextFocusedActor = new Actor();
-        nextFocusedActor.Reset();
-      }
-
-      return nextFocusedActor;
-    }
+        public override Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, View.KeyboardFocus.Direction direction, bool loopEnabled)
+        {
+            // Respond to Up/Down keys to change the value while keeping the current spin focused
+            Actor nextFocusedActor = currentFocusedActor;
+            if (direction == View.KeyboardFocus.Direction.UP)
+            {
+                this.Value += this.Step;
+                nextFocusedActor = _textField;
+            }
+            else if (direction == View.KeyboardFocus.Direction.DOWN)
+            {
+                this.Value -= this.Step;
+                nextFocusedActor = _textField;
+            }
+            else
+            {
+                // Return a native empty handle as nothing can be focused in the left or right
+                nextFocusedActor = new Actor();
+                nextFocusedActor.Reset();
+            }
+
+            return nextFocusedActor;
+        }
 
 
-    [ScriptableProperty()]
-    public int Value
-    {
-      get
-      {
-        return _currentValue;
-      }
-      set
-      {
-
-        Console.WriteLine ("Value set to "  + value );
-        _currentValue = value;
-
-        // Make sure no invalid value is accepted
-        if (_currentValue < _minValue)
+        [ScriptableProperty()]
+        public int Value
         {
-          _currentValue = _minValue;
+            get
+            {
+                return _currentValue;
+            }
+            set
+            {
+
+                Console.WriteLine("Value set to " + value);
+                _currentValue = value;
+
+                // Make sure no invalid value is accepted
+                if (_currentValue < _minValue)
+                {
+                    _currentValue = _minValue;
+                }
+
+                if (_currentValue > _maxValue)
+                {
+                    _currentValue = _maxValue;
+                }
+
+                _textField.Text = _currentValue.ToString();
+            }
         }
-
-        if (_currentValue > _maxValue)
+        // MinValue property of type int:
+        [ScriptableProperty()]
+        public int MinValue
         {
-          _currentValue = _maxValue;
+            get
+            {
+                return _minValue;
+            }
+            set
+            {
+                _minValue = value;
+            }
         }
 
-        _textField.Text = _currentValue.ToString();
-      }
-    }
-    // MinValue property of type int:
-    [ScriptableProperty()]
-    public int MinValue
-    {
-      get
-      {
-        return _minValue;
-      }
-      set
-      {
-        _minValue = value;
-      }
-    }
+        // MaxValue property of type int:
+        [ScriptableProperty()]
+        public int MaxValue
+        {
+            get
+            {
+                return _maxValue;
+            }
+            set
+            {
+                _maxValue = value;
+            }
+        }
 
-    // MaxValue property of type int:
-    [ScriptableProperty()]
-    public int MaxValue
-    {
-      get
-      {
-        return _maxValue;
-      }
-      set
-      {
-        _maxValue = value;
-      }
-    }
+        // Step property of type int:
+        [ScriptableProperty()]
+        public int Step
+        {
+            get
+            {
+                return _singleStep;
+            }
+            set
+            {
+                _singleStep = value;
+            }
+        }
 
-    // Step property of type int:
-    [ScriptableProperty()]
-    public int Step
-    {
-      get
-      {
-        return _singleStep;
-      }
-      set
-      {
-        _singleStep = value;
-      }
-    }
+        // WrappingEnabled property of type bool:
+        [ScriptableProperty()]
+        public bool WrappingEnabled
+        {
+            get
+            {
+                return _wrappingEnabled;
+            }
+            set
+            {
+                _wrappingEnabled = value;
+            }
+        }
 
-    // WrappingEnabled property of type bool:
-    [ScriptableProperty()]
-    public bool WrappingEnabled
-    {
-      get
-      {
-        return _wrappingEnabled;
-      }
-      set
-      {
-        _wrappingEnabled = value;
-      }
-    }
+        // TextPointSize property of type int:
+        [ScriptableProperty()]
+        public int TextPointSize
+        {
+            get
+            {
+                return _pointSize;
+            }
+            set
+            {
+                _pointSize = value;
+                _textField.PointSize = _pointSize;
+            }
+        }
 
-    // TextPointSize property of type int:
-    [ScriptableProperty()]
-    public int TextPointSize
-    {
-      get
-      {
-        return _pointSize;
-      }
-      set
-      {
-        _pointSize = value;
-        _textField.PointSize = _pointSize;
-      }
-    }
+        // TextColor property of type Color:
+        [ScriptableProperty()]
+        public Color TextColor
+        {
+            get
+            {
+                return _textColor;
+            }
+            set
+            {
+                Console.WriteLine("TextColor set to " + value.R + "," + value.G + "," + value.B);
+
+                _textColor = value;
+                _textField.TextColor = _textColor;
+            }
+        }
 
-    // TextColor property of type Color:
-    [ScriptableProperty()]
-    public Color TextColor
-    {
-      get
-      {
-        return _textColor;
-      }
-      set
-      {
-          Console.WriteLine ("TextColor set to "  + value.R + "," + value.G + ","+ value.B);
-
-        _textColor = value;
-        _textField.TextColor = _textColor;
-      }
-    }
+        // MaxTextLength property of type int:
+        [ScriptableProperty()]
+        public int MaxTextLength
+        {
+            get
+            {
+                return _maxTextLength;
+            }
+            set
+            {
+                _maxTextLength = value;
+                _textField.MaxLength = _maxTextLength;
+            }
+        }
 
-    // MaxTextLength property of type int:
-    [ScriptableProperty()]
-    public int MaxTextLength
-    {
-      get
-      {
-        return _maxTextLength;
-      }
-      set
-      {
-        _maxTextLength = value;
-        _textField.MaxLength = _maxTextLength;
-      }
-    }
+        public TextField SpinText
+        {
+            get
+            {
+                return _textField;
+            }
+            set
+            {
+                _textField = value;
+            }
+        }
 
-    public TextField SpinText
-    {
-      get
-      {
-        return _textField;
-      }
-      set
-      {
-        _textField = value;
-      }
+        // Indicator property of type string:
+        public string IndicatorImage
+        {
+            get
+            {
+                return _arrowImage;
+            }
+            set
+            {
+                _arrowImage = value;
+                _arrowVisual = VisualFactory.Get().CreateVisual(_arrowImage, new Uint16Pair(150, 150));
+                RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual);
+            }
+        }
     }
-
-    // Indicator property of type string:
-    public string IndicatorImage
-    {
-      get
-      {
-        return _arrowImage;
-      }
-      set
-      {
-        _arrowImage = value;
-        _arrowVisual =  VisualFactory.Get().CreateVisual( _arrowImage, new Uint16Pair(150, 150) );
-        RegisterVisual( _arrowVisualPropertyIndex, _arrowVisual );
-      }
-  }
 }
-}
\ No newline at end of file
+