<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
+ <title>Thread Architecture: High-Performance Multi-Threaded Architecture of DALi</title> \r
</head>\r
\r
<body onload="prettyPrint()" style="overflow: auto;">\r
</div> \r
\r
<div id="container"><div id="contents"><div class="content">\r
-<h1>Properties: Accessing to Properties of DALi Objects</h1>\r
+<h1>Thread Architecture: High-Performance Multi-Threaded Architecture of DALi</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 << actor.GetName() << 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 << actor.GetProperty( Actor::Property::NAME ) << std::endl; // "test actor"\r
-std::cout << actor.GetProperty<std::string>( Actor::Property::NAME ) << std::endl; // "test actor"\r
-std::cout << actor.GetProperty( Actor::Property::NAME ).Get<std::string>() << 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& application )\r
- {\r
- for( int i=0; i<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 << button.GetProperty( mCustomDataIndex ) << 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
+<p>DALi uses a multithreaded architecture in order to provide the best performance and scalability.</p>\r
+<ul>\r
+ <li><strong>Event Thread:</strong> The main thread in which application code and event handling runs.</li>\r
+ <li><strong>Update Thread:</strong> Updates the nodes on the scene as well as running animations and constraints.</li>\r
+ <li><strong>Render Thread:</strong> OpenGL drawing, texture and geometry uploading etc.</li>\r
+ <li><strong>Resource Thread:</strong> Loads images and decodes into bitmaps etc.</li>\r
+</ul>\r
\r
+<p class="figure">Figure: DALi Thread Architecture</p> \r
+ <p align="center"><img alt="Thread Architecture" src="../../images/dali_threads.png"/></p> \r
\r
\r
+ <!-- dali todo GetCurrentPosition() -->\r
\r
\r
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r