[DALi][DOC-213] Add Property, Update Handle/Body
authorYoonsang Lee <ysang114.lee@samsung.com>
Fri, 17 Jul 2015 07:05:17 +0000 (16:05 +0900)
committerYoonsang Lee <ysang114.lee@samsung.com>
Fri, 17 Jul 2015 07:23:20 +0000 (16:23 +0900)
Signed-off-by: Yoonsang Lee <ysang114.lee@samsung.com>
Change-Id: I4bc79e44198a2661c082d9a2a41646bfe4e3c93d

org.tizen.ui.guides/html/native/dali/actors_n.htm
org.tizen.ui.guides/html/native/dali/handle_n.htm [new file with mode: 0755]
org.tizen.ui.guides/html/native/dali/properties_n.htm [new file with mode: 0755]
org.tizen.ui.guides/html/native/dali/threads_n.htm [new file with mode: 0755]

index dd6e416..7aab77f 100755 (executable)
@@ -154,7 +154,8 @@ Stage::GetCurrent().Add(actor);
   </table>\r
 \r
 <p>For example, a touch event can be handled as follows:</p> \r
-<pre class="prettyprint">bool OnTouch(Actor actor, const TouchEvent&amp; touch)\r
+<pre class="prettyprint">\r
+bool OnTouch(Actor actor, const TouchEvent&amp; touch)\r
 {\r
 &nbsp;&nbsp;&nbsp;bool handled = false;\r
 \r
diff --git a/org.tizen.ui.guides/html/native/dali/handle_n.htm b/org.tizen.ui.guides/html/native/dali/handle_n.htm
new file mode 100755 (executable)
index 0000000..41da6eb
--- /dev/null
@@ -0,0 +1,202 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />\r
+       <link rel="stylesheet" type="text/css" href="../../css/styles.css" />\r
+       <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />\r
+       <script type="text/javascript" src="../../scripts/snippet.js"></script> \r
+       <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>\r
+\r
+       <title>Handle/Body Pattern: Basic Way of Using DALi Objects</title>  \r
+</head>\r
+\r
+<body onload="prettyPrint()" style="overflow: auto;">\r
+\r
+<div id="toc-navigation">\r
+       <div id="profile">\r
+               <p><img alt="Mobile native" src="../../images/mn_icon.png"/> <img alt="Wearable native" src="../../images/wn_icon.png"/></p>\r
+       </div>\r
+               <div id="toc_border"><div id="toc">\r
+               <p class="toc-title">Content</p>\r
+               <ul class="toc">\r
+                       <li><a href="#guide">Guide for Handles</a></li>\r
+               </ul>\r
+               <p class="toc-title">Related Info</p>\r
+               <ul class="toc">\r
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1BaseHandle.html">Dali::BaseHandle API for Mobile Native</a></li>\r
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1BaseHandle.html">Dali::BaseHandle API for Wearable Native</a></li>\r
+               </ul>\r
+       </div></div>\r
+</div> \r
+\r
+<div id="container"><div id="contents"><div class="content">\r
+<h1>Handle/Body Pattern: Basic Way of Using DALi Objects</h1>\r
+\r
+<p>DALi widely adopts the handle/body pattern (a.k.a. pimpl pattern) which seperates implementation details (the body classes) from their interfaces (the handle classes).</p>\r
+<p><span style="font-family: Courier New,Courier,monospace;">Dali::BaseHandle</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Layer.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Layer.html">wearable</a>) is a base class of these handle classes in DALi. It additionally provides smart-pointer semantics which manages internal objects with reference counts. Most of classes in DALi public API are handle classes, which means they inherit from <span style="font-family: Courier New,Courier,monospace;">Dali::BaseHandle</span>.\r
+</p>\r
+\r
+<p>This structure is benificial for both users and developers of DALi:</p>\r
+<ul>\r
+       <li><strong>Easier memory management</strong>\r
+       <p>Each internal implementation class (the body class) contains a single reference count object which can be intitialized with the static "New" methods in the DALi public API. This means that C++ new/delete operators do not have to be used in the user code.\r
+(For your information, these internal body class inherit from <span style="font-family: Courier New,Courier,monospace;">Dali::BaseObject</span>, but you don't need to use this class directly).\r
+</p>\r
+       </li>\r
+       <li><strong>Better encapsulation</strong>\r
+       <p>The danger of API/ABI breaks is reduced since the implementation of a class can be changed without modifying the public API, thus without recompiling code using the public API. This also can reduce the build time.</p>\r
+       </li>\r
+</ul>\r
+\r
+<h2 id="guide" name="guide">Guide for Handles</h2>\r
+\r
+<ul>\r
+\r
+<li> No need to call destructors\r
+<pre class="prettyprint">\r
+class HandleTest\r
+{\r
+  HandleTest()\r
+  {\r
+    mActor = Actor::New();\r
+  }\r
+\r
+  ~HandleTest() {} // Actor object is destroyed automatically\r
+\r
+  Actor mActor;\r
+};\r
+</pre>\r
+</li>\r
+\r
+<li> Can be stored in STL containers\r
+<pre class="prettyprint">\r
+class HandleTest\r
+{\r
+  HandleTest()\r
+  {\r
+    mActors.push_back( Actor::New() );\r
+    mActors.push_back( Actor::New() );\r
+    ...\r
+  }\r
+\r
+  ~HandleTest() {} // Actors are destroyed automatically\r
+\r
+  std::vector&lt;Actor&gt; mActors;\r
+};\r
+</pre>\r
+</li>\r
+\r
+<li> Passing by value is encouraged\r
+<pre class="prettyprint">\r
+void SomeFunction( Actor actor )\r
+{\r
+  if( actor )\r
+  {\r
+    actor.SomeMethod();\r
+  }\r
+}\r
+</pre>\r
+</li>\r
+\r
+<li> Validity check\r
+<pre class="prettyprint">\r
+{\r
+  ...\r
+  Actor actor;  // Create a NULL object\r
+\r
+  // At this stage we cannot call any of the Actor methods\r
+  if( !actor )  // This test is will pass, since the actor is NULL\r
+  {\r
+    actor = Actor::New();\r
+    ...\r
+  }\r
+  ...\r
+}\r
+</pre>\r
+</li>\r
+\r
+<li> Equality operators\r
+<pre class="prettyprint">\r
+{\r
+  Actor handle1;\r
+  Actor handle2;\r
+  cout &lt;&lt; handle1 == handle2 &lt;&lt; endl; // "true", both handles are empty\r
+\r
+  handle2 = Actor::New();\r
+  cout &lt;&lt; handle1 == handle2 &lt;&lt; endl; // "false", one handle is empty\r
+\r
+  handle1 = Actor::New();\r
+  cout &lt;&lt; handle1 == handle2 &lt;&lt; endl; // "false", handles to different objects\r
+\r
+  handle1 = handle2;\r
+  cout &lt;&lt; handle1 == handle2 &lt;&lt; endl; // "true", handles to same object\r
+}\r
+</pre>\r
+</li>\r
+\r
+<li> Reference counting examples\r
+<pre class="prettyprint">\r
+class AnimationTest\r
+{\r
+...\r
+private:\r
+  Animation mAnimation; // animation handle\r
+};\r
+void AnimationTest::Initialize ()\r
+{\r
+  mAnimation = Animation::New( 10.0f ); // reference count will be 1, animation object stays alive when method returns\r
+  ...\r
+}\r
+void AnimationTest::SetAnimation( Animation anim )\r
+{\r
+  mAnimation = anim; // reference count of original animation decreased, 'anim' is referenced instead\r
+                     // if nobody else had a reference on the initial animation, the object is destroyed\r
+}\r
+</pre>\r
+\r
+<pre class="prettyprint">\r
+// At this point we own a Dali::Actor named "container"\r
+// Enter a code block\r
+{\r
+  // Create an text label\r
+  TextLabel actor = TextLabel::New("test");\r
+  // Add the text label to a container\r
+  container.Add(actor);\r
+}\r
+// Exit the code block\r
+// At this stage the text label is still alive\r
+// We don't keep the handle to the text label, but it can be retrieved from the container\r
+</pre>\r
+\r
+</ul>\r
+\r
+\r
+    \r
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r
+<script type="text/javascript" src="../../scripts/showhide.js"></script>\r
+</div></div></div>\r
+\r
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>\r
+\r
+<div id="footer">\r
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>\r
+</div>\r
+\r
+<script type="text/javascript">\r
+var _gaq = _gaq || [];\r
+_gaq.push(['_setAccount', 'UA-25976949-1']);\r
+_gaq.push(['_trackPageview']);\r
+(function() {\r
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
+})();\r
+</script>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/org.tizen.ui.guides/html/native/dali/properties_n.htm b/org.tizen.ui.guides/html/native/dali/properties_n.htm
new file mode 100755 (executable)
index 0000000..766e586
--- /dev/null
@@ -0,0 +1,257 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />\r
+       <link rel="stylesheet" type="text/css" href="../../css/styles.css" />\r
+       <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />\r
+       <script type="text/javascript" src="../../scripts/snippet.js"></script> \r
+       <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>\r
+\r
+       <title>Properties: Accessing to Properties of DALi Objects</title>  \r
+</head>\r
+\r
+<body onload="prettyPrint()" style="overflow: auto;">\r
+\r
+<div id="toc-navigation">\r
+       <div id="profile">\r
+               <p><img alt="Mobile native" src="../../images/mn_icon.png"/> <img alt="Wearable native" src="../../images/wn_icon.png"/></p>\r
+       </div>\r
+               <div id="toc_border"><div id="toc">\r
+               <p class="toc-title">Content</p>\r
+               <ul class="toc">\r
+                       <li><a href="#access">Accessing to Property Values</a></li>\r
+                       <li><a href="#usage">Usages of Properties</a></li>\r
+                       <li><a href="#index">Index, Type, and Name</a></li>\r
+               </ul>\r
+               <p class="toc-title">Related Info</p>\r
+               <ul class="toc">\r
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Handle.html">Dali::Handle API for Mobile Native</a></li>\r
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Handle.html">Dali::Handle API for Wearable Native</a></li>\r
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Handle.html">Dali::Property API for Mobile Native</a></li>\r
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Handle.html">Dali::Property API for Wearable Native</a></li>\r
+               </ul>\r
+       </div></div>\r
+</div> \r
+\r
+<div id="container"><div id="contents"><div class="content">\r
+<h1>Properties: Accessing to Properties of DALi Objects</h1>\r
+\r
+<p>A property is a value used by an object that can be modified or read via <span style="font-family: Courier New,Courier,monospace;">Dali::Handle::GetProperty()</span> / <span style="font-family: Courier New,Courier,monospace;">SetProperty()</span> API.</p>\r
+\r
+<p>The difference between properties and ordinary C++ member variables is that a property can be dynamically added to or removed from an existing object in runtime, which enables more flexible, script-like programming with DALi.</p>\r
+\r
+<p><span style="font-family: Courier New,Courier,monospace;">Dali::Handle</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Layer.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Layer.html">wearable</a>) provides methods to manage properties, thus the DALi classes that inherit from <span style="font-family: Courier New,Courier,monospace;">Dali::Handle</span> (most of classes that users would use) have a number of predefined properties and can have any number of user-defined custom properties.\r
+</p>\r
+\r
+<h2 id="access" name="access">Accessing to Property Values</h2>\r
+\r
+       <p>Property values of an object usually can be accessed via two ways: by its class member functions or by property getters/setters (<span style="font-family: Courier New,Courier,monospace;">Dali::Handle::GetProperty()</span> / <span style="font-family: Courier New,Courier,monospace;">SetProperty()</span>).</p>\r
+       <p>For example, <span style="font-family: Courier New,Courier,monospace;">Dali::Actor</span> has following predefined properties:</p>\r
+\r
+       <table>\r
+               <caption>\r
+                       Table: Properties of Dali::Actor\r
+               </caption>\r
+               <tbody>\r
+               <tr>\r
+                       <th>Property Index (enumeration)</th>\r
+                       <th>Member Functions</th>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::POSITION</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentPosition()</span> / <span style="font-family: Courier New,Courier,monospace;">SetPosition()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::ORIENTATION</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentOrientation()</span> / <span style="font-family: Courier New,Courier,monospace;">SetOrientation()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::SIZE</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentSize()</span> / <span style="font-family: Courier New,Courier,monospace;">SetSize()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::COLOR</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentColor()</span> / <span style="font-family: Courier New,Courier,monospace;">SetColor()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::NAME</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetName()</span> / <span style="font-family: Courier New,Courier,monospace;">SetName()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td>...</td>\r
+                       <td>...</td>\r
+               </tr>\r
+               </tbody>\r
+       </table>\r
+\r
+       You can access them in both ways:\r
+\r
+       <pre class="prettyprint">\r
+Actor actor = Actor::New();\r
+actor.SetName("test actor");\r
+std::cout &lt;&lt; actor.GetName() &lt;&lt; std::endl;  // "test actor"\r
+</pre>\r
+\r
+       <pre class="prettyprint">\r
+Actor actor = Actor::New();\r
+actor.SetProperty( Actor::Property::NAME, "test actor" );\r
+std::cout &lt;&lt; actor.GetProperty( Actor::Property::NAME ) &lt;&lt; std::endl;  // "test actor"\r
+std::cout &lt;&lt; actor.GetProperty&lt;std::string&gt;( Actor::Property::NAME ) &lt;&lt; std::endl;  // "test actor"\r
+std::cout &lt;&lt; actor.GetProperty( Actor::Property::NAME ).Get&lt;std::string&gt;() &lt;&lt; std::endl;  // "test actor"\r
+</pre>\r
+\r
+<p>Please see API reference for <span style="font-family: Courier New,Courier,monospace;">Dali::Handle</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Layer.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Layer.html">wearable</a>) for more information.\r
+\r
+<h2 id="usage" name="usage">Usages of Properties</h2>\r
+\r
+<h3>Registering User-Defined Custom Properties to Objects</h3>\r
+\r
+<p>Properties can be registered / unregistered in runtime, which enables script-like programming of DALi application, for example, adding custom member data to an instance of a DALi class without subclassing the class or maintaining another pool of custom data.</p>\r
+<p>For example, you can set your own custom data to PushButton objects and use them later when the buttons are clicked like:</p>\r
+<pre class="prettyprint">\r
+void Create( Application&amp; application )\r
+{\r
+  for( int i=0; i&lt;5; ++i )\r
+  {\r
+    Toolkit::PushButton button = Toolkit::PushButton::New();\r
+    button.SetSize( 100, 100 );\r
+    button.SetPosition( 100*i+50, 50 );\r
+    button.ClickedSignal().Connect( this, OnButtonClicked );\r
+\r
+    // Register a custom property having button index.\r
+    // Store the property index so you can look it up later.\r
+    // Note: This is much faster than looking the property up by property name and should always be used if possible.\r
+    // As all control types are the same (PushButtons) the indices to the unique custom property are all same.\r
+    Property::Value data( i );\r
+    mCustomDataIndex = button.RegisterProperty( "custom-data", data );\r
+\r
+    Stage::GetCurrent().Add(button);\r
+  }\r
+}\r
+\r
+bool OnButtonClicked(Toolkit::Button button)\r
+{\r
+  // Look up the custom property by the stored property index.\r
+  // Note: If the property belongs to a control in another library, or we do not know the index, we can look the index up first with:\r
+  // Property::Index index = button.GetPropertyIndex( "custom-data" );\r
+  cout &lt;&lt; button.GetProperty( mCustomDataIndex ) &lt;&lt; endl;\r
+  return true;\r
+}\r
+</pre>\r
+\r
+<p>Please see API reference for <span style="font-family: Courier New,Courier,monospace;">Dali::Handle</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Layer.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Layer.html">wearable</a>) for more information.\r
+\r
+<h3>Animating Objects</h3>\r
+\r
+<p>DALi animation API is used to animate the properties of any number of objects.</p>\r
+\r
+<p>For example, following code animates the value of the <strong>POSITION</strong> property of a radio button to (100.0, 200.0, 0.0) for 2 seconds:</p>\r
+\r
+<pre class="prettyprint">\r
+RadioButton actor = RadioButton::New();\r
+Stage::GetCurrent().Add(actor);\r
+Animation animation = Animation::New(2.0f); // duration 2 seconds\r
+animation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(100.0f, 200.0f, 0.0f));\r
+animation.Play();\r
+</pre>\r
+\r
+<p>Please see <a href="basic_framework_n.htm">Animation Basics</a> for more information.</p>\r
+\r
+<h3>Imposing Constraints on Objects</h3>\r
+\r
+<p>DALi constraint API is used to modify the property of an object based on other properties of other objects.</p>\r
+\r
+<p>For example, following code makes the value of the <strong>SIZE</strong> property of an actor same as the value of the <strong>SIZE</strong> property of its parent actor:</p>\r
+\r
+<pre class="prettyprint">\r
+Constraint constraint = Constraint::New<Vector3>( actor,\r
+                                                  Actor::Property::SIZE,\r
+                                                  EqualToConstraint() );\r
+constraint.AddSource( ParentSource( Actor::Property::SIZE ) );\r
+constraint.Apply();\r
+</pre>\r
+\r
+<p>Please see <a href="constraints_n.htm">Constraints</a> for more information.</p>\r
+\r
+<h2 id="index" name="index">Index, Type, and Name</h2>\r
+\r
+<p>A property has its own index, type, and name.</p>\r
+\r
+<p>For example, predefined properties of <span style="font-family: Courier New,Courier,monospace;">Dali::Actor</span> has following indices, types, and names:</p>\r
+\r
+       <table>\r
+               <caption>\r
+                       Table: Indices, Names, and Types of Properties of Dali::Actor\r
+               </caption>\r
+               <tbody>\r
+               <tr>\r
+                       <th>Property Index (enumeration)</th>\r
+                       <th>Property Type</th>\r
+                       <th>Property Name</th>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::POSITION</span></td>\r
+                       <td>Vector3</td>\r
+                       <td>"position"</td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::ORIENTATION</span></td>\r
+                       <td>Quaternion</td>\r
+                       <td>"orientation"</td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::SIZE</span></td>\r
+                       <td>Vector3</td>\r
+                       <td>"size"</td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::COLOR</span></td>\r
+                       <td>Vector4</td>\r
+                       <td>"color"</td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::NAME</span></td>\r
+                       <td>std::string</td>\r
+                       <td>"name"</td>\r
+               </tr>\r
+               <tr>\r
+                       <td>...</td>\r
+                       <td>...</td>\r
+                       <td>...</td>\r
+               </tr>\r
+               </tbody>\r
+       </table>\r
+\r
+<p>Proper index and type will be only used and property name is currently only for internal use. You can see these information at API reference for property of each class. For example for <span style="font-family: Courier New,Courier,monospace;">Dali::Actor</span>, please see <span style="font-family: Courier New,Courier,monospace;">Dali::Actor::Property</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1CameraActor.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1CameraActor.html">wearable</a>).</p>\r
+\r
+<p>To check all kinds of supported property types, please see <span style="font-family: Courier New,Courier,monospace;">Dali::Property::Type</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1CameraActor.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1CameraActor.html">wearable</a>) and <span style="font-family: Courier New,Courier,monospace;">Dali::PropertyTypes</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1CameraActor.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1CameraActor.html">wearable</a>).</p>\r
+\r
+    \r
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r
+<script type="text/javascript" src="../../scripts/showhide.js"></script>\r
+</div></div></div>\r
+\r
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>\r
+\r
+<div id="footer">\r
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>\r
+</div>\r
+\r
+<script type="text/javascript">\r
+var _gaq = _gaq || [];\r
+_gaq.push(['_setAccount', 'UA-25976949-1']);\r
+_gaq.push(['_trackPageview']);\r
+(function() {\r
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
+})();\r
+</script>\r
+\r
+</body>\r
+</html>\r
+\r
diff --git a/org.tizen.ui.guides/html/native/dali/threads_n.htm b/org.tizen.ui.guides/html/native/dali/threads_n.htm
new file mode 100755 (executable)
index 0000000..e90ea6d
--- /dev/null
@@ -0,0 +1,182 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />\r
+       <link rel="stylesheet" type="text/css" href="../../css/styles.css" />\r
+       <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />\r
+       <script type="text/javascript" src="../../scripts/snippet.js"></script> \r
+       <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>\r
+       <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>\r
+\r
+       <title>Properties: Accessing to Properties of DALi Objects</title>  \r
+</head>\r
+\r
+<body onload="prettyPrint()" style="overflow: auto;">\r
+\r
+<div id="toc-navigation">\r
+       <div id="profile">\r
+               <p><img alt="Mobile native" src="../../images/mn_icon.png"/> <img alt="Wearable native" src="../../images/wn_icon.png"/></p>\r
+       </div>\r
+               <div id="toc_border"><div id="toc">\r
+               <p class="toc-title">Content</p>\r
+               <ul class="toc">\r
+                       <li><a href="#access">Accessing to Properties</a></li>\r
+                       <li><a href="#usage">Usages of Properties</a></li>\r
+               </ul>\r
+               <p class="toc-title">Related Info</p>\r
+               <ul class="toc">\r
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Handle.html">Dali::Handle API for Mobile Native</a></li>\r
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Handle.html">Dali::Handle API for Wearable Native</a></li>\r
+               </ul>\r
+       </div></div>\r
+</div> \r
+\r
+<div id="container"><div id="contents"><div class="content">\r
+<h1>Properties: Accessing to Properties of DALi Objects</h1>\r
+\r
+<h1>GetCurrentPosition()</h1>\r
+\r
+<p>A property is a value used by an object that can be modified or read via <span style="font-family: Courier New,Courier,monospace;">Dali::Handle::GetProperty()</span> / <span style="font-family: Courier New,Courier,monospace;">SetProperty()</span> API.</p>\r
+\r
+<p>The difference between properties and ordinary C++ member variables is that a property can be dynamically added to or removed from an existing object in runtime, which enables more flexible, script-like programming with DALi.</p>\r
+\r
+<p><span style="font-family: Courier New,Courier,monospace;">Dali::Handle</span> (in <a href="../../../../org.tizen.native.mobile.apireference/classDali_1_1Layer.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/classDali_1_1Layer.html">wearable</a>) provides methods to manage properties, thus the DALi classes that inherit from <span style="font-family: Courier New,Courier,monospace;">Dali::Handle</span> (most of classes that users would use) have a number of predefined properties and can have any number of user-defined custom properties.\r
+</p>\r
+\r
+<h2 id="access" name="access">Accessing to Properties</h2>\r
+\r
+       <p>Properties of an object usually can be accessed via two ways: by its class member functions or by property getters/setters (<span style="font-family: Courier New,Courier,monospace;">Dali::Handle::GetProperty()</span> / <span style="font-family: Courier New,Courier,monospace;">SetProperty()</span>).</p>\r
+       <p>For example, <span style="font-family: Courier New,Courier,monospace;">Dali::Actor</span> has following predefined properties:</p>\r
+\r
+       <table>\r
+               <caption>\r
+                       Table: Properties of Dali::Actor\r
+               </caption>\r
+               <tbody>\r
+               <tr>\r
+                       <th>Property Index (enumeration)</th>\r
+                       <th>Member Functions</th>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::POSITION</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentPosition()</span> / <span style="font-family: Courier New,Courier,monospace;">SetPosition()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::ORIENTATION</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentOrientation()</span> / <span style="font-family: Courier New,Courier,monospace;">SetOrientation()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::SIZE</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentSize()</span> / <span style="font-family: Courier New,Courier,monospace;">SetSize()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::COLOR</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetCurrentColor()</span> / <span style="font-family: Courier New,Courier,monospace;">SetColor()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::NAME</span></td>\r
+                       <td><span style="font-family: Courier New,Courier,monospace;">Dali::Actor::GetName()</span> / <span style="font-family: Courier New,Courier,monospace;">SetName()</span></td>\r
+               </tr>\r
+               <tr>\r
+                       <td>...</td>\r
+                       <td>...</td>\r
+               </tr>\r
+               </tbody>\r
+       </table>\r
+\r
+       You can access them in both ways:\r
+\r
+       <pre class="prettyprint">\r
+Actor actor = Actor::New();\r
+actor.SetName("test actor");\r
+std::cout &lt;&lt; actor.GetName() &lt;&lt; std::endl;  // "test actor"\r
+</pre>\r
+\r
+       <pre class="prettyprint">\r
+Actor actor = Actor::New();\r
+actor.SetProperty( Actor::Property::NAME, "test actor" );\r
+std::cout &lt;&lt; actor.GetProperty( Actor::Property::NAME ) &lt;&lt; std::endl;  // "test actor"\r
+std::cout &lt;&lt; actor.GetProperty&lt;std::string&gt;( Actor::Property::NAME ) &lt;&lt; std::endl;  // "test actor"\r
+std::cout &lt;&lt; actor.GetProperty( Actor::Property::NAME ).Get&lt;std::string&gt;() &lt;&lt; std::endl;  // "test actor"\r
+</pre>\r
+\r
+<h2 id="usage" name="usage">Usages of Properties</h2>\r
+\r
+<h3>Registering User-Defined Custom Properties to an Object</h3>\r
+\r
+<p>Properties can be registered / unregistered in runtime, which enables script-like programming of DALi application, for example, adding custom member data to an instance of a DALi class without subclassing the class or maintaining another pool of custom data.</p>\r
+<p>For example, you can set your own custom data to PushButton objects and use them later when the buttons are clicked like:</p>\r
+<pre class="prettyprint">\r
+  void Create( Application&amp; application )\r
+  {\r
+    for( int i=0; i&lt;5; ++i )\r
+    {\r
+      Toolkit::PushButton button = Toolkit::PushButton::New();\r
+      button.SetSize( 100, 100 );\r
+      button.SetPosition( 100*i+50, 50 );\r
+      button.ClickedSignal().Connect( this, OnButtonClicked );\r
+\r
+      // Register a custom property having button index.\r
+      // Store the property index so you can look it up later.\r
+      // Note: This is much faster than looking the property up by property name and should always be used if possible.\r
+      // As all control types are the same (PushButtons) the indices to the unique custom property are all same.\r
+      Property::Value data( i );\r
+      mCustomDataIndex = button.RegisterProperty( "custom-data", data );\r
+\r
+      Stage::GetCurrent().Add(button);\r
+    }\r
+  }\r
+\r
+  bool OnButtonClicked(Toolkit::Button button)\r
+  {\r
+    // Look up the custom property by the stored property index.\r
+    // Note: If the property belongs to a control in another library, or we do not know the index, we can look the index up first with:\r
+    // Property::Index index = button.GetPropertyIndex( "custom-data" );\r
+    cout &lt;&lt; button.GetProperty( mCustomDataIndex ) &lt;&lt; endl;\r
+    return true;\r
+  }\r
+</pre>\r
+\r
+<h3>Animation</h3>\r
+\r
+<h3>Constraint</h3>\r
+\r
+\r
+\r
+types\r
+\r
+set/get add/remove\r
+\r
+constraint animation\r
+\r
+\r
+\r
+\r
+    \r
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r
+<script type="text/javascript" src="../../scripts/showhide.js"></script>\r
+</div></div></div>\r
+\r
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>\r
+\r
+<div id="footer">\r
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>\r
+</div>\r
+\r
+<script type="text/javascript">\r
+var _gaq = _gaq || [];\r
+_gaq.push(['_setAccount', 'UA-25976949-1']);\r
+_gaq.push(['_trackPageview']);\r
+(function() {\r
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
+})();\r
+</script>\r
+\r
+</body>\r
+</html>\r
+\r