From: Seoyeon Kim Date: Thu, 20 Oct 2016 05:52:53 +0000 (+0900) Subject: [DALi] Add 3.0 new features guide X-Git-Tag: GitHub/PR#40/tizen-studio~235^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F93031%2F20;p=sdk%2Fonline-doc.git [DALi] Add 3.0 new features guide - DALi is supported in both mobile applications and wearable applications in Tizen 3.0. PS5: [LB] Reviewed PS7: [LB] Review for PS6 changes PS8: [LB] Link fixes and wearable DALi API addition to Tizen APIs topic PS10: [LB] Reviewed new touch data content PS11: [LB] Fixed training section topic based on new CSS PS13: [LB] New DALi application section topics edited PS17: [LB] New UI application section and DALi section topics edited PS19: [LB] New Visuals topic edited PS20: [LB] Visuals open issues closed Change-Id: I92cb4faec186990110f3f9c3c8cfbcd0920f79ec Signed-off-by: Seoyeon Kim --- diff --git a/org.tizen.devtools/html/web_tools/config_editor_w.htm b/org.tizen.devtools/html/web_tools/config_editor_w.htm index 703fbbd..7be7c22 100755 --- a/org.tizen.devtools/html/web_tools/config_editor_w.htm +++ b/org.tizen.devtools/html/web_tools/config_editor_w.htm @@ -710,7 +710,7 @@

Attributes:

Example:

<tizen:background-category value="media" />
@@ -1075,7 +1075,7 @@

Attributes:

Example:

<tizen:background-category value="media" />
diff --git a/org.tizen.guides/html/images/dali_bevel2.png b/org.tizen.guides/html/images/dali_bevel2.png new file mode 100644 index 0000000..a55262c Binary files /dev/null and b/org.tizen.guides/html/images/dali_bevel2.png differ diff --git a/org.tizen.guides/html/images/dali_bevel3.png b/org.tizen.guides/html/images/dali_bevel3.png new file mode 100644 index 0000000..2b4c9fb Binary files /dev/null and b/org.tizen.guides/html/images/dali_bevel3.png differ diff --git a/org.tizen.guides/html/images/dali_bevel4.png b/org.tizen.guides/html/images/dali_bevel4.png new file mode 100644 index 0000000..68ba6ae Binary files /dev/null and b/org.tizen.guides/html/images/dali_bevel4.png differ diff --git a/org.tizen.guides/html/images/dali_border_visual.png b/org.tizen.guides/html/images/dali_border_visual.png new file mode 100644 index 0000000..05834f7 Binary files /dev/null and b/org.tizen.guides/html/images/dali_border_visual.png differ diff --git a/org.tizen.guides/html/images/dali_color_visual.png b/org.tizen.guides/html/images/dali_color_visual.png new file mode 100644 index 0000000..2bfe28f Binary files /dev/null and b/org.tizen.guides/html/images/dali_color_visual.png differ diff --git a/org.tizen.guides/html/images/dali_cone.png b/org.tizen.guides/html/images/dali_cone.png new file mode 100644 index 0000000..8cd5baf Binary files /dev/null and b/org.tizen.guides/html/images/dali_cone.png differ diff --git a/org.tizen.guides/html/images/dali_cylinder.png b/org.tizen.guides/html/images/dali_cylinder.png new file mode 100644 index 0000000..8db9128 Binary files /dev/null and b/org.tizen.guides/html/images/dali_cylinder.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer1.png b/org.tizen.guides/html/images/dali_flexcontainer1.png new file mode 100644 index 0000000..79c9394 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer1.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_align-content.png b/org.tizen.guides/html/images/dali_flexcontainer_align-content.png new file mode 100644 index 0000000..c0c5f77 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_align-content.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_align-items.png b/org.tizen.guides/html/images/dali_flexcontainer_align-items.png new file mode 100644 index 0000000..91226e6 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_align-items.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_align-self.png b/org.tizen.guides/html/images/dali_flexcontainer_align-self.png new file mode 100644 index 0000000..4d7b4b4 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_align-self.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_content-direction-ltr.png b/org.tizen.guides/html/images/dali_flexcontainer_content-direction-ltr.png new file mode 100644 index 0000000..39f137a Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_content-direction-ltr.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_content-direction-rtl.png b/org.tizen.guides/html/images/dali_flexcontainer_content-direction-rtl.png new file mode 100644 index 0000000..694c9bc Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_content-direction-rtl.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_demo.png b/org.tizen.guides/html/images/dali_flexcontainer_demo.png new file mode 100644 index 0000000..91de153 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_demo.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_flex-direction.png b/org.tizen.guides/html/images/dali_flexcontainer_flex-direction.png new file mode 100644 index 0000000..e17d136 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_flex-direction.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_flex-margin.png b/org.tizen.guides/html/images/dali_flexcontainer_flex-margin.png new file mode 100644 index 0000000..b83106f Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_flex-margin.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_flex-wrap.png b/org.tizen.guides/html/images/dali_flexcontainer_flex-wrap.png new file mode 100644 index 0000000..f86aa58 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_flex-wrap.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_flex.png b/org.tizen.guides/html/images/dali_flexcontainer_flex.png new file mode 100644 index 0000000..eb67e8f Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_flex.png differ diff --git a/org.tizen.guides/html/images/dali_flexcontainer_justify-content.png b/org.tizen.guides/html/images/dali_flexcontainer_justify-content.png new file mode 100644 index 0000000..cd0d1f0 Binary files /dev/null and b/org.tizen.guides/html/images/dali_flexcontainer_justify-content.png differ diff --git a/org.tizen.guides/html/images/dali_frustrum.png b/org.tizen.guides/html/images/dali_frustrum.png new file mode 100644 index 0000000..1f63d6a Binary files /dev/null and b/org.tizen.guides/html/images/dali_frustrum.png differ diff --git a/org.tizen.guides/html/images/dali_gradient_visual_linear.png b/org.tizen.guides/html/images/dali_gradient_visual_linear.png new file mode 100644 index 0000000..1d8074a Binary files /dev/null and b/org.tizen.guides/html/images/dali_gradient_visual_linear.png differ diff --git a/org.tizen.guides/html/images/dali_gradient_visual_radial.png b/org.tizen.guides/html/images/dali_gradient_visual_radial.png new file mode 100644 index 0000000..5b7ac5e Binary files /dev/null and b/org.tizen.guides/html/images/dali_gradient_visual_radial.png differ diff --git a/org.tizen.guides/html/images/dali_image_visual_nPatch.png b/org.tizen.guides/html/images/dali_image_visual_nPatch.png new file mode 100644 index 0000000..530efd3 Binary files /dev/null and b/org.tizen.guides/html/images/dali_image_visual_nPatch.png differ diff --git a/org.tizen.guides/html/images/dali_image_visual_normal.png b/org.tizen.guides/html/images/dali_image_visual_normal.png new file mode 100644 index 0000000..a09f92b Binary files /dev/null and b/org.tizen.guides/html/images/dali_image_visual_normal.png differ diff --git a/org.tizen.guides/html/images/dali_image_visual_svg.png b/org.tizen.guides/html/images/dali_image_visual_svg.png new file mode 100644 index 0000000..a7976d2 Binary files /dev/null and b/org.tizen.guides/html/images/dali_image_visual_svg.png differ diff --git a/org.tizen.guides/html/images/dali_mesh_visual.png b/org.tizen.guides/html/images/dali_mesh_visual.png new file mode 100644 index 0000000..9740469 Binary files /dev/null and b/org.tizen.guides/html/images/dali_mesh_visual.png differ diff --git a/org.tizen.guides/html/images/dali_model1.png b/org.tizen.guides/html/images/dali_model1.png new file mode 100644 index 0000000..5a71076 Binary files /dev/null and b/org.tizen.guides/html/images/dali_model1.png differ diff --git a/org.tizen.guides/html/images/dali_model2.png b/org.tizen.guides/html/images/dali_model2.png new file mode 100644 index 0000000..1818695 Binary files /dev/null and b/org.tizen.guides/html/images/dali_model2.png differ diff --git a/org.tizen.guides/html/images/dali_model3.png b/org.tizen.guides/html/images/dali_model3.png new file mode 100644 index 0000000..85fd9e4 Binary files /dev/null and b/org.tizen.guides/html/images/dali_model3.png differ diff --git a/org.tizen.guides/html/images/dali_primitive_visual1.png b/org.tizen.guides/html/images/dali_primitive_visual1.png new file mode 100644 index 0000000..1dc380c Binary files /dev/null and b/org.tizen.guides/html/images/dali_primitive_visual1.png differ diff --git a/org.tizen.guides/html/images/dali_rendering_cube.png b/org.tizen.guides/html/images/dali_rendering_cube.png new file mode 100644 index 0000000..029c3b6 Binary files /dev/null and b/org.tizen.guides/html/images/dali_rendering_cube.png differ diff --git a/org.tizen.guides/html/images/dali_rendering_line.png b/org.tizen.guides/html/images/dali_rendering_line.png new file mode 100644 index 0000000..1109e9b Binary files /dev/null and b/org.tizen.guides/html/images/dali_rendering_line.png differ diff --git a/org.tizen.guides/html/images/dali_rendering_triangle.png b/org.tizen.guides/html/images/dali_rendering_triangle.png new file mode 100644 index 0000000..b353aba Binary files /dev/null and b/org.tizen.guides/html/images/dali_rendering_triangle.png differ diff --git a/org.tizen.guides/html/images/dali_slices.png b/org.tizen.guides/html/images/dali_slices.png new file mode 100644 index 0000000..8747577 Binary files /dev/null and b/org.tizen.guides/html/images/dali_slices.png differ diff --git a/org.tizen.guides/html/images/dali_slider.png b/org.tizen.guides/html/images/dali_slider.png new file mode 100644 index 0000000..ccab35c Binary files /dev/null and b/org.tizen.guides/html/images/dali_slider.png differ diff --git a/org.tizen.guides/html/images/dali_sphere.png b/org.tizen.guides/html/images/dali_sphere.png new file mode 100644 index 0000000..2edb9a1 Binary files /dev/null and b/org.tizen.guides/html/images/dali_sphere.png differ diff --git a/org.tizen.guides/html/images/dali_stacks.png b/org.tizen.guides/html/images/dali_stacks.png new file mode 100644 index 0000000..fb3cb84 Binary files /dev/null and b/org.tizen.guides/html/images/dali_stacks.png differ diff --git a/org.tizen.guides/html/images/dali_styling1.png b/org.tizen.guides/html/images/dali_styling1.png new file mode 100644 index 0000000..13e98c9 Binary files /dev/null and b/org.tizen.guides/html/images/dali_styling1.png differ diff --git a/org.tizen.guides/html/images/dali_styling2.png b/org.tizen.guides/html/images/dali_styling2.png new file mode 100644 index 0000000..3853c29 Binary files /dev/null and b/org.tizen.guides/html/images/dali_styling2.png differ diff --git a/org.tizen.guides/html/images/dali_texteditor.png b/org.tizen.guides/html/images/dali_texteditor.png new file mode 100644 index 0000000..566391f Binary files /dev/null and b/org.tizen.guides/html/images/dali_texteditor.png differ diff --git a/org.tizen.guides/html/images/dali_videoview.png b/org.tizen.guides/html/images/dali_videoview.png new file mode 100644 index 0000000..49702e8 Binary files /dev/null and b/org.tizen.guides/html/images/dali_videoview.png differ diff --git a/org.tizen.guides/html/images/dali_watch_application.png b/org.tizen.guides/html/images/dali_watch_application.png new file mode 100644 index 0000000..d81e2ba Binary files /dev/null and b/org.tizen.guides/html/images/dali_watch_application.png differ diff --git a/org.tizen.guides/html/images/dali_wireframe_visual.png b/org.tizen.guides/html/images/dali_wireframe_visual.png new file mode 100644 index 0000000..b22bd94 Binary files /dev/null and b/org.tizen.guides/html/images/dali_wireframe_visual.png differ diff --git a/org.tizen.guides/html/images/ui_control_hierarchy.png b/org.tizen.guides/html/images/ui_control_hierarchy.png old mode 100644 new mode 100755 index f45a416..70d9451 Binary files a/org.tizen.guides/html/images/ui_control_hierarchy.png and b/org.tizen.guides/html/images/ui_control_hierarchy.png differ diff --git a/org.tizen.guides/html/index.htm b/org.tizen.guides/html/index.htm index 6b942e1..33677a6 100644 --- a/org.tizen.guides/html/index.htm +++ b/org.tizen.guides/html/index.htm @@ -29,11 +29,24 @@ -
  • Event Handling
  • +
  • Event Handling + +
  • UI Components
  • @@ -265,7 +289,12 @@
  • Resources
  • -
  • Rendering and Effects
  • +
  • Rendering and Effects + +
  • Background Knowledge
    • Handle/Body Pattern
    • diff --git a/org.tizen.guides/html/native/alarm/trigger_n.htm b/org.tizen.guides/html/native/alarm/trigger_n.htm index b768df3..26fd13e 100644 --- a/org.tizen.guides/html/native/alarm/trigger_n.htm +++ b/org.tizen.guides/html/native/alarm/trigger_n.htm @@ -111,7 +111,7 @@ Note - If you only need to monitor a fundamental system event, such as the USB connection status, to launch a service application, and no condition is required, use event callbacks. In these cases, using the event system instead of the contextual trigger is more efficient, as the contextual trigger runs a rule engine to manage state changes of multiple event and condition items simultaneously. + If you only need to monitor a fundamental system event, such as the USB connection status, to launch a service application, and no condition is required, use event callbacks. In these cases, using the event system instead of the contextual trigger is more efficient, as the contextual trigger runs a rule engine to manage state changes of multiple event and condition items simultaneously. diff --git a/org.tizen.guides/html/native/app_management/applications_n.htm b/org.tizen.guides/html/native/app_management/applications_n.htm index ee45f5a..052894e 100644 --- a/org.tizen.guides/html/native/app_management/applications_n.htm +++ b/org.tizen.guides/html/native/app_management/applications_n.htm @@ -48,20 +48,11 @@

      Tizen provides various application models to allow you to create applications targeted for specific tasks:

        -
      • UI Application +
      • UI Applications

        The UI application is the most general Tizen application that has a graphical user interface. You can create diverse applications with a variety of features, and design versatile applications and intriguing user interfaces with text and graphics while taking advantage of many device functionalities, such as sensors and call operations. In addition, you can, for example, manage content and media files, use network and social services, and provide messaging and embedded Web browsing functionality.

      • -
      • DALi Application -

        The DALi application is one of the Tizen native applications based on Dynamic Animation Library. The DALi internally defines a virtual 3D world (space) and maintains hierarchical objects in the 3D world. The hierarchical object tree is known as the scene graph. A node in the scene graph can have several children but often only a single parent, with the effect of a parent applied to all its child nodes; an operation performed on a group automatically propagates its effect to all of its members.

      • - -
      • Service Application +
      • Service Applications

        The service application is a Tizen native application without a graphical user interface that runs in the background. They can be very useful in performing activities (such as getting sensor data in the background) that need to run periodically or continuously, but do not require any user intervention.

      • - -
      • Widget Application -

        The widget application (or widget) is the specialized application that is useful in providing users with quick view of specific information from the parent application. Also, the widget allows users to access certain features without launching the applications. Combined with their parent application, your widgets can have various features to increase usability of your applications.

      • - -
      • Watch Application in wearable applications only -

        Tizen watch application is one of Tizen native applications for wearable devices. It can be shown on the idle screen of the wearable device. For low-powered wearable devices, Tizen watch application supports a special ambient mode. In ambient mode, Tizen watch application on the idle screen can show limited UI and receive only ambient tick events each minute to reduce power consumption.

      Native Application Life-Cycle

      @@ -84,7 +75,7 @@
    • An alarm is triggered for another application, which becomes the top-most window and hides your application.
    -

    Since Tizen 2.4, the application on the background goes into a suspended state. In the suspended state, the application process is executed with limited CPU resources. In other words, the platform does not allow the running of the background applications, except for some exceptional applications (such as Media and Download) that necessarily work on the background. In this case, the application can designate their background category as an allowed category to avoid going into the suspended state.

    +

    Since Tizen 2.4, the application on the background goes into a suspended state. In the suspended state, the application process is executed with limited CPU resources. In other words, the platform does not allow the running of the background applications, except for some exceptional applications (such as Media and Download) that necessarily work on the background. In this case, the application can designate their background category as an allowed category to avoid going into the suspended state.

    When your application becomes visible again, the app_resume_cb() callback is invoked. The visibility returns, when:

      @@ -106,7 +97,7 @@

      Because the service application has no UI, it neither has a pause state. Since Tizen 2.4, the service application can go into the suspended state. Basically, the service application is running on the background by its nature; so the platform does not allow the running of the service application unless it is designated as a background category application. However, when the UI application that is packaged with the service application is running in the foreground, the service application is also regarded as a foreground application and it can be run without a designated background category.

      -

      Application state changes are managed by the underlying framework. For more information about application state transitions, see Managing Application States and Transitions.

      +

      Application state changes are managed by the underlying framework. For more information about application state transitions, see Application States and Transitions.

      @@ -134,4 +125,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.guides/html/native/app_management/dali_app_n.htm b/org.tizen.guides/html/native/app_management/dali_app_n.htm index 7d76791..5238666 100644 --- a/org.tizen.guides/html/native/app_management/dali_app_n.htm +++ b/org.tizen.guides/html/native/app_management/dali_app_n.htm @@ -11,7 +11,7 @@ - DALi Application + DALi Applications @@ -28,8 +28,8 @@

    Content

    Related Info

      @@ -40,251 +40,45 @@
      -

      DALi Application

      +

      DALi Applications

      -

      Dynamic Animation Library (DALi) internally defines a virtual 3D world (space) and maintains hierarchical objects in the 3D world. The hierarchical object tree is known as the scene graph. A node in the scene graph can have several children but often only a single parent, with the effect of a parent applied to all its child nodes; an operation performed on a group automatically propagates its effect to all of its members.

      -

      There are various types of nodes, such as image, text, and buttons.

      +

      You can use the Dynamic Animation Library (DALi) 3D UI toolkit to create a high-performance rich UI application. For 2D-based Tizen native applications, use the Enlightenment Foundation Libraries (EFL) UI toolkit.

      -

      DALi Fundamentals

      +

      Dynamic Animation Library (DALi) internally defines a virtual 3D world (space) and maintains hierarchical objects in the 3D world. The hierarchical object tree is known as the scene graph.

      -

      Before starting UI programming with DALi, familiarize yourself with the basic concepts.

      +

      A node in the scene graph can have several children but often only a single parent, with the effect of a parent applied to all its child nodes; an operation performed on a group automatically propagates its effect to all of its members. There are various types of nodes, such as image, text, and buttons.

      -

      Actor and Stage

      +

      Basic Fundamentals

      -

      Actor is the primary object for interaction in DALi applications. Actors are effective nodes that receive input (such as touch events) and act as a container for drawable elements and other actors. A DALi application uses a hierarchy of actor objects to position visible content. An actor inherits a position relative to its parent, and can be moved relative to this point. UI components can be built by combining multiple actors.

      -

      Stage is a top-level node of the scene graph used for displaying a tree of actors. To display an actor, add it to the stage.

      - -

      Signal and Slot

      - -

      In DALi applications, a signal and slot mechanism is used for communication between objects. This means that, in the DALi event system, objects can send signals containing event information, which can be received by other objects using special functions known as slots.

      - -

      Signal events are emitted when a certain action or event occurs. The application can connect to these signals. Standard C-style functions can be used to connect to these signals if no local data needs to be accessed, otherwise a class function can also be connected.

      -

      Applications can manually disconnect from signals when required. However, DALi also provides safe signal disconnection. This means that when the connecting object is deleted, the signal is automatically disconnected.

      - -

      Coordinate System

      - -

      DALi uses a left-handed coordinate system with the origin at the top-left corner, with positive X to right, positive Y going downwards, and positive Z going outside the screen with the default camera. This is convenient when creating 2D views.

      - -

      The stage has a 2D size that matches the size of the application window. The default unit 1 is 1 pixel with the default camera.

      - -

      Figure: DALi coordinate system

      -

      DALi coordinate system

      - -

      Camera

      - -

      DALi has a concept of a camera to display its virtual 3D world to a 2D screen. There are 2 ways of using the camera in DALi:

      -
        -
      • For 2D applications, you do not need to care about the camera at all. The default camera is already best suited for 2D applications (configured to have the origin of the coordinate system at the top-left corner of the screen, and unit 1 as 1 pixel of the screen). This is a typical way.
      • -
      • For 3D applications, you can change the view by manipulating the camera. You can translate or rotate the camera in this case. Note that the top-left corner of the screen and unit 1 no longer are (0,0,0) and 1 pixel after manipulating the camera.
      • -
      - - -

      DALi Modules

      - -

      DALi consists of the following modules:

      +

      Before you start UI programming with DALi, you must familiarize yourself with the basic DALi fundamentals. DALi consists of the following modules:

      • DALi Core -

        This module provides core functionalities, such as scene graph-based rendering, animation, and event handling. It is a base module and forms the biggest part of DALi.

        +

        This module provides core functionalities, such as scene graph-based rendering, animation, and event handling. It is a base module and forms the biggest part of DALi.

      • DALi Adaptor -

        This module is a platform adaptation layer. It initializes and sets up DALi appropriately and provides many platform-related services with its internal module, platform abstraction. Several signals can be connected to it to keep you informed when certain platform-related activities occur. -

      • +

        This module is a platform adaptation layer. It initializes and sets up DALi appropriately and provides many platform-related services with its internal module, platform abstraction. Several signals can be connected to it to keep you informed when certain platform-related activities occur.

      • DALi Toolkit

        This module provides UI components and various effects on top of the DALi core.

      -

      Figure: Layer diagram for DALi modules

      -

      Layer diagram for DALi modules

      - -

      Creating a DALi Application

      - -

      To create a 'Hello World' application with Dali:

      -
        -
      1. Create a DALi project: -
          -
        1. In the Tizen Studio menu, go to File > New > Tizen Project.
        2. -
        3. In the Project Wizard, select Template > Mobile or Wearable > Native Application > Basic UI with DALi.
        4. -
        5. Click Finish, and your project is created at the default location. If you want to change the location, uncheck Use default location and set a new location. For more information, see Creating the Application Project. - -

          Create a DALi project

          -
        6. -
        7. The new project is shown in the Project Explorer view of the Tizen Studio. If you open the src/basicuiwithdali.cpp file, you can see the source code of the basic DALi application: -
          -#include <dali-toolkit/dali-toolkit.h>
          -
          -using namespace Dali;
          -using namespace Dali::Toolkit;
          -
          -// This example shows how to create and display Hello World using a simple TextLabel
          -
          -class HelloWorldExample : public ConnectionTracker
          -{
          -  public:
          -
          -    HelloWorldExample( Application& application )
          -    : mApplication( application )
          -    {
          -      // Connect to the application's init signal
          -      mApplication.InitSignal().Connect( this, &HelloWorldExample::Create );
          -    }
          -
          -    ~HelloWorldExample()
          -    {
          -      // Nothing to do here
          -    }
          -
          -    // Init signal is received once (only) during the application lifetime
          -    void Create( Application& application )
          -    {
          -      // Get a handle to the stage
          -      Stage stage = Stage::GetCurrent();
          -      stage.SetBackgroundColor( Color::WHITE );
          -
          -      TextLabel textLabel = TextLabel::New( "Hello World" );
          -      textLabel.SetSize( stage.GetSize() );
          -      textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
          -      textLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
          -      textLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
          -      stage.Add( textLabel );
          -
          -      // Connect to touch and key event signals
          -      stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldExample::OnTouch );
          -      stage.KeyEventSignal().Connect( this, &HelloWorldExample::OnKeyEvent );
          -    }
          -
          -    bool OnTouch( Actor actor, const TouchEvent& event )
          -    {
          -      // Quit the application
          -      mApplication.Quit();
          -
          -      return true;
          -    }
          -
          -    void OnKeyEvent( const KeyEvent& event )
          -    {
          -      if( event.state == KeyEvent::Down )
          -      {
          -        if( IsKey( event, DALI_KEY_ESCAPE ) || IsKey( event, DALI_KEY_BACK ) )
          -        {
          -          mApplication.Quit();
          -        }
          -      }
          -    }
          -
          -  private:
          -    Application& mApplication;
          -};
           
          +

          For more detailed information on how to implement a 3D world using DALi, see DALi Overview. It helps you to understand how to use DALi easily, while providing a Hello World example of constructing a virtual 3D world.

          -// Entry point for DALi applications -int main( int argc, char **argv ) -{ -  Application application = Application::New( &argc, &argv ); -  HelloWorldExample test( application ); -  application.MainLoop(); - -  return 0; -} -
          -
        8. -
        -
      2. -
      3. Initialize the DALi application: - -
        • -

          To use the DALi APIs, you only need to include the dali-toolkit.h file. It includes the header files of DALi Core and DALi Adaptor as well as DALi Toolkit.

          - -
          -#include <dali-toolkit/dali-toolkit.h>
          -
          -

          Using the following 2 using-directives can be convenient, because all DALi APIs are contained in either the Dali or Dali::Toolkit namespace:

          -
          -using namespace Dali;
          -using namespace Dali::Toolkit;
          -
          -

          Other code samples in the Tizen DALi documentation assume they already have those directives.

          -
        • - -
        • -

          The Dali::Application class (in mobile and wearable applications) initializes and sets up DALi.

          - -

          Create a Dali::Application instance:

          - -
          -Application application = Application::New( &argc, &argv );
          -
        • -
        • -

          Several signals can be connected to keep you informed when certain platform-related activities occur, and ensure that, upon system events, DALi is called in a thread-safe manner.

          -

          To manage signal connection safely, DALi provides the Dali::ConnectionTracker class (in mobile and wearable applications). A typical way for starting a DALi application is to create a class derived from the Dali::ConnectionTracker class and use its member functions as callback functions for DALi signals (for more information, see Automatic Connection Management). The HelloWorldExample class is used in other code samples in the Tizen DALi documentation.

          - -

          After getting the initialized signal from the Dali::Application instance, you can use the DALi APIs for building the scene graph. Connect the HelloWorldExample::Create() callback to the DALi::Application::InitSignal() function:

          - -
          -mApplication.InitSignal().Connect( this, &HelloWorldExample::Create );
          -
        - -
      4. -
      5. Create an actor and add it to the stage: - -

        The Dali::Toolkit::TextLabel UI component (in mobile and wearable applications) renders a short text string. To display the TextLabel component, add it to a stage. The stage instance is a singleton object (the only instance of its class during the lifetime of the program), so you can get it using a static function.

        - -
        -Stage stage = Stage::GetCurrent();
        -stage.SetBackgroundColor( Color::WHITE );
        -
        -TextLabel textLabel = TextLabel::New( "Hello World" );
        -textLabel.SetSize( stage.GetSize() );
        -textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        -textLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
        -textLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
        -stage.Add( textLabel );
        -
        - -

        The above code additionally sets the background color of the stage and the anchor point, a point defining a position of a child actor from its parent, of the textLabel. The application stores the actor and resource handles. DALi objects are reference-counted, which makes sure they exist only as long as they are needed. Even if the TextLabel component is removed from the stage, it remains alive through the reference.

        - -
      6. -
      7. Connect to input signals: - -

        The application can handle touch and key event signals as follows:

        -
        -stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldExample::OnTouch );
        -stage.KeyEventSignal().Connect( this, &HelloWorldExample::OnKeyEvent );
        -
        -

        Any key inputs and touches on the stage are handled by 2 callback functions, HelloWorldExample::OnKeyEvent and HelloWorldExample::OnTouch.

        - -

        Note that the first parameter of the HelloWorldExample::OnTouch callback (actor) is passed by a value, not by a reference or a pointer. You can simply pass instances of most DALi classes by value, when the class inherits from the Dali::BaseHandle class (in mobile and wearable applications). This is due to the handle/body pattern widely used in DALi.

        - -
        -bool OnTouch( Actor actor, const TouchEvent& event )
        -
        -
      8. - -
      9. Start the application main loop: - -

        To run the application, start its main loop. This ensures that images are displayed, and events as well as signals are dispatched and captured.

        -
        -application.MainLoop();
        -
        +

        Application Types

        +

        With the DALi UI, you can create the following application types:

        +
          +
        • Basic UI application +

          A basic UI application provides a DALi-based user interface which allows the user to interact with the application.

          +

          The basic UI application is available for both mobile and wearable devices.

        • -
        • Build the DALi application: - -

          To build your application, select Project > Build Project or press F10 in the Tizen Studio.

          -

          The Tizen Studio automatically packages the project after building. Note that you need to register your certificate when building for the first time. For more information, see Working with the Certificate Profile and Building Applications.

          - +
        • Watch application in wearable applications only +

          A watch application provides a watch face with the current time (updated every second) as its user interface. You can take advantage of various DALi features to create the watch face.

          +

          The watch application is available for wearable devices only, and it is shown on the idle screen of the device. For low-powered wearable devices, the watch application supports a special ambient mode. The ambient mode reduces power consumption by showing a limited UI and updating the time on the screen only once per minute.

        • -
        • Run the DALi application: - -

          To run your application, select Run > Run or press Ctrl+F11 in the Tizen Studio.

          -

          For more information, see Running Applications.

          -
      - -

      The following figure illustrates the basic DALi application running on a Tizen emulator.

      -

      Figure: Basic DALi application

      -

      Basic DALi application

      +
    - diff --git a/org.tizen.guides/html/native/app_management/dali_basic_app_n.htm b/org.tizen.guides/html/native/app_management/dali_basic_app_n.htm new file mode 100644 index 0000000..e41cf2a --- /dev/null +++ b/org.tizen.guides/html/native/app_management/dali_basic_app_n.htm @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + DALi Basic UI Application + + + + +
    +
    +

    Mobile native Wearable native

    +
    +
    +

    Dependencies

    +
      +
    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 3.0 and Higher for Wearable
    • +
    +

    Content

    + +

    Related Info

    + +
    +
    + +
    +

    DALi Basic UI Application

    + +

    To create a DALi basic UI application, you must:

    + + + +

    For the steps of creating the basic parts of a simple DALi UI application, see Basics of Creating a DALi Application.

    + +

    Main Application Class

    + +

    If you want to use DALi for your application UI, you must create the application with the Dali::Application class (in mobile and wearable applications). This class provides the means for initializing the resources required by DALi.

    + +

    The following table lists the main functions you need in your application. They are all provided by the Dali::Application class.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionDescription
    New()Constructs the Dali::Application class.
    GetWindow()Retrieves the window used by the Dali::Application class.
    SetViewMode()Sets the viewing mode for the application.
    Quit()Quits the application.
    + +

    Event Loop

    + +

    Like all ordinary Tizen applications, the DALi application must start the main event loop. Afterwards, it can receive events from the platform.

    + +

    The mainloop() function is used to start event loop. If you do not call the function and start the event loop, DALi cannot call any callback functions for application events.

    + +

    Event Callbacks

    + +

    The Dali::Application class emits several signals, which you can connect to.

    + +

    The following table lists the callbacks for the basic signals provided by the Dali::Application class. These signals originally occur in the Tizen application framework, and you can use the callbacks to react to them.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table: Callbacks for basic application event signals
    CallbackDescription
    InitSignal()Called when the DALi application is ready to start. The signal is emitted when the DALi core components (windows, resource, thread) are ready for use.
    ResumeSignal()Called when the application becomes visible. The signal is most useful when the application is ready to restart from the paused state.
    PauseSignal()Called when the application becomes invisible. The signal is emitted when the application is paused due to another application becoming active (for example, because of a call, alarm, or message alert).
    TerminateSignal()Called when the application is terminated. The signal is useful when the application has resources to release at the end. By releasing those resources, you allow other applications to use them.
    ResizeSignal()Called when the window size is changes. The signal is called when a window is created or resized. You can use the signal to change the UI layout according to the new window size.
    AppControlSignal()Called when an application control signal is emitted from another application. This provides the means to communicate between applications.
    LanguageChangedSignal()Called when the language is changed on the device. You can use the signal to refresh the display with the new language.
    RegionChangedSignal()Called when the region is changed. You can use the signal to refresh any region-specific information on the screen.
    BatteryLowSignal()Called when the battery state is low. You can use the signal to save any crucial information in case the battery state becomes so low that the application is forcefully terminated.
    MemoryLowSignal()Called when the memory state is low. You can use the signal to release any unused memory.
    + +

    For more information about Tizen UI applications in general, see UI Application.

    + +

    Basics of Creating a DALi Application

    + +

    To create a DALi basic UI application:

    + +
      +
    1. Initialize the application: +
        +
      1. To use the functions and data types of the DALi API, (in mobile and wearable applications), include the <dali-toolkit/dali-toolkit.h> header file in your application: + +
        +#include <dali-toolkit/dali-toolkit.h>
        +
        +
      2. +
      3. Use the following 2 using directives for convenience, because all DALi APIs are contained in either Dali or Dali::Toolkit namespace: + +
        +using namespace Dali;
        +using namespace Dali::Toolkit;
        +
        +
      4. +
      +
    2. + +
    3. Create the Dali::Application class instance to initialize and set up DALi: + +
      +Application application = Application::New( &argc, &argv );
      +
      +
    4. + +
    5. Connect signals to keep yourself informed when certain system events occur. + +

      To manage signal connection safely, DALi provides the Dali::ConnectionTracker class (in mobile and wearable applications). A typical way to start a DALi application is to create a class derived from the Dali::ConnectionTracker class and use its member functions as callback functions for DALi signals.

      + +

      When the application receives the InitSignal(), it can build the 3D scene graph. Connect the HelloWorld::Create() callback to the Dali::Application::InitSignal() function:

      + +
      +mApplication.InitSignal().Connect( this, &HelloWorld::Create );
      +
      +
    6. + +
    7. Create an actor and add it to the stage. + +

      The Dali::Toolkit::TextLabel UI component (in mobile and wearable applications) renders a short text string.

      +

      To display the text label, add it to a stage. The stage instance is a singleton object (the only instance of its class during the lifetime of the program), so you can get it using a static function:

      + +
      +Stage stage = Stage::GetCurrent();
      +
      +TextLabel textLabel = TextLabel::New( "Hello World" );
      +stage.Add( textLabel );
      +
      + +

      The application stores the actor and resource handles. DALi objects are reference-counted, which makes sure they exist only as long as they are needed. Even if the TextLabel component is removed from the stage, it remains alive through the reference.

      +
    8. + +
    9. Handle touch and key event signals: + +
      +stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorld::OnTouch );
      +stage.KeyEventSignal().KeyEventSignal().Connect( this, &HelloWorld::OnKeyEvent );
      +
      +
    10. +
    + + + +
    + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/app_management/dali_watch_app_n.htm b/org.tizen.guides/html/native/app_management/dali_watch_app_n.htm new file mode 100644 index 0000000..f4ebf6e --- /dev/null +++ b/org.tizen.guides/html/native/app_management/dali_watch_app_n.htm @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + DALi Watch Application + + + + +
    +
    +

    Wearable native

    +
    +
    +

    Dependencies

    +
      +
    • Tizen 3.0 and Higher for Wearable
    • +
    +

    Content

    + +

    Related Info

    + +
    +
    + +
    +

    DALi Watch Application

    + +

    You can create a watch application with DALi to retrieve the current date and time and display it accurately on the screen.

    + +

    This feature is supported in wearable applications only.

    + +

    To create a DALi watch application, you must:

    + +
      +
    • Use the Dali::WatchApplication class. + + + + + + + + + +
      Note
      A DALi watch application is implemented similarly to a DALi basic UI application, since the Dali::WatchApplication class inherits from the Dali::Application class. Consequently, make sure you are familiar with the basic UI application details before tackling a watch application.
    • +
    • Make sure you start the event loop.
    • +
    • React to application events with callbacks.
    • +
    • Manage the time handle and display the time with the DALi 3D UI. +

      The TimeTickSignal() and AmbientTickSignal() functions trigger callback functions to update the display with the new accurate time. The WatchTime handle is provided with the callback function to help you to update the current time properly.

    • +
    + +

    Figure: DALi watch application

    +

    DALi watch application

    + +

    For the steps of creating the basic parts of a simple DALi watch application, see Basics of Creating a DALi Watch Application.

    + +

    Main Application Classes

    + +

    If you want to use DALi for your watch application, you must create the application with the Dali::WatchApplication class. This class provides the means for initializing the resources required by DALi.

    + +

    The following table lists the main functions you need in your application to retrieve the current time. They are all provided by the Dali::WatchTime class.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionDescription
    GetHour()Get the hour from the WatchTime handle.
    GetHour24()Get the hour from the WatchTime handle in the 24-hour format.
    GetMinute()Get the minute from the WatchTime handle.
    GetSecond()Get the second from the WatchTime handle.
    + +

    Event Loop

    + +

    Like all ordinary Tizen applications, the DALi watch application must start the main event loop. Afterwards, it can receive usual platform events and dedicated watch events from the platform.

    + +

    The mainloop() function is used to start event loop. If you do not call the function and start the event loop, DALi cannot call any callback functions for application events.

    + +

    Event Callbacks

    + +

    The Dali::WatchApplication class emits several signals, which you can connect to.

    + +

    The following table lists the callbacks for the watch application signals provided by the Dali::WatchApplication class. These signals originally occur in the Tizen application framework, and you can use the callbacks to react to them.

    + + + + + + + + + + + + + + + + + + + + + +
    Table: Callbacks for watch application event signals
    CallbackDescription
    TimeTickSignal()Called every second. You can use the signal to update the time on the screen.
    AmbientTickSignal()Called every minute when the device is in the ambient mode. You can use the signal to update the time on the screen.
    AmbientChangedSignal()Called when the device enters or exits the ambient mode.
    + +

    Basics of Creating a DALi Watch Application

    + +

    To create a DALi watch application, set the time, and draw the UI:

    + +
      +
    1. Initialize the application: +
        +
      1. To use the functions and data types of the DALi watch application, include the <dali/public-api/dali-wearable.h> header file in your application: + +
        +#include <dali/public-api/dali-wearable.h>
        +
        +
      2. +
      3. Like in a basic UI application, use the following 2 using directives for convenience, because all DALi APIs are contained in either Dali or Dali::Toolkit namespace: + +
        +using namespace Dali;
        +using namespace Dali::Toolkit;
        +
        +
      4. +
      +
    2. + +
    3. Create the Dali::WatchApplication class instance to initialize and set up DALi for a watch application: + +
      +WatchApplication application = WatchApplication::New( &argc, &argv );
      +
      +
    4. + +
    5. Connect signals to keep yourself informed when certain system events occur. + +
        +
      1. To manage signal connection safely, DALi provides the Dali::ConnectionTracker class. A typical way to start a DALi application is to create a class derived from the Dali::ConnectionTracker class and use its member functions as callback functions for DALi signals. + +

        When the application receives the InitSignal(), it can create UI components. Connect the WatchExample::Create() callback to the Dali::WatchApplication::InitSignal() function:

        + +
        +class WatchExample : public ConnectionTracker
        +{
        +  public:
        +    WatchExample( WatchApplication& application )
        +    : mApplication( application )
        +    {
        +      mApplication.InitSignal().Connect( this, &WatchExample::Create );
        +    }
        +
        +    void Create( Application& application )
        +    {
        +      // Create a DALi UI component
        +    }
        +
        +  private:
        +    WatchApplication& mApplication;
        +}
        +
        +
      2. +
      3. Handle the tick signals. + +

        The TimeTickSignal() callback is triggered once per second. Retrieve the current time from the WatchTime time handle to draw the updated time.

        + +

        You can get the current hour, minute, and second from the WatchTime time handle by using the time.GetHour(), time.GetMinute(), and time.GetSecond() functions.

        + +
        +mApplication.TimeTickSignal().Connect( this, &WatchExample::OnTimeTick );
        +
        +// Update clock hands on the tick event
        +void OnTimeTick( Application& application, const WatchTime& time )
        +{
        +  UpdateClockHands(time.GetHour(), time.GetMinute(), time.GetSecond());
        +}
        +
        +void UpdateClockHands(int hour, int min, int sec)
        +{
        +  // Update the angle of each hand
        +}
        +
        +
    + + + +
    + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/app_management/efl_app_n.htm b/org.tizen.guides/html/native/app_management/efl_app_n.htm new file mode 100644 index 0000000..e00f87c --- /dev/null +++ b/org.tizen.guides/html/native/app_management/efl_app_n.htm @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + EFL Applications + + + + +
    +
    +

    Mobile native Wearable native

    +
    + +
    +

    Dependencies

    +
      +
    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 2.3.1 and Higher for Wearable
    • +
    +

    Content

    + +

    Related Info

    + +
    +
    + +
    +

    EFL Applications

    + +

    You can use the Enlightenment Foundation Libraries (EFL) to create a 2D-based Tizen native application. However, EFL supports 2.5D and 3D effects and 3D objects as well. For 3D-based Tizen native applications, you can use the Dynamic Animation Library (DALi) UI toolkit as well.

    + +

    EFL is a collection of libraries that are independent or can build on top of each-other. They provide useful features that complement an OS's existing environment, rather than wrap and abstract it, trying to be their own environment and OS in its entirety. This means that EFL expects you to use other system libraries and APIs in conjunction with EFL libraries to provide a whole working application or library - simply using EFL as a set of convenient pre-made libraries to accomplish a whole host of complex or painful tasks for you.

    + +

    Basic Fundamentals

    + +

    Before you start UI programming with EFL, you must familiarize yourself with the basic EFL fundamentals. EFL consists of the following main libraries:

    + +
      +
    • Elementary +

      Elementary provides all the functions you need to create a window, create simple and complex layouts, manage the life-cycle of a view, and add UI components.

      +
    • +
    • Edje +

      Edje provide a powerful theme for your application. You can also use Edje to create your own objects and use them in your application, or even extend the default theme.

      +
    • +
    • Ecore +

      Ecore manages the main loop of your application. The main loop is where events are handled, and where you interact with the user through the callback mechanism.

      +
    • +
    • Evas +

      Evas is the canvas engine responsible for managing the drawing of your content. All graphical objects that you create are Evas objects.

      +
    • +
    • Eina +

      Eina is a toolbox that implements an API for data types in an efficient way. It contains all the functions needed to create lists and hashes, manage shared strings, open shared libraries, and manage errors and memory pools.

      +
    + +

    For more detailed information on how to get started with EFL programming, see Getting Started with EFL UI Programming. It helps you to understand how to EFL works, and how you can create a simply EFL application with basic features.

    + +

    Application Types

    + +

    With the EFL UI, you can create the following application types:

    + +
      +
    • Basic UI application +

      A basic UI application provides a DALi-based user interface which allows the user to interact with the application.

      +

      The basic UI application is available for both mobile and wearable devices.

      +
    • +
    • Watch application in wearable applications only +

      A watch application provides a watch face with the current time (updated every second) as its user interface. You can take advantage of various DALi features to create the watch face.

      +

      The watch application is available for wearable devices only, and it is shown on the idle screen of the device. For low-powered wearable devices, the watch application supports a special ambient mode. The ambient mode reduces power consumption by showing a limited UI and updating the time on the screen only once per minute.

      +
    • +
    • Widget application +

      A widget application (or widget) is a specialized application that provides the user a quick view of specific information from the parent application. In addition, the widget allows the user to access certain features without launching the parent applications. Combined with the parent application, your widget can have various features to increase the usability of your application.

      +

      The widget application is available for both mobile and wearable devices.

      +
    • +
    + + + +
    + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/app_management/efl_ui_app_n.htm b/org.tizen.guides/html/native/app_management/efl_ui_app_n.htm new file mode 100644 index 0000000..1d913a8 --- /dev/null +++ b/org.tizen.guides/html/native/app_management/efl_ui_app_n.htm @@ -0,0 +1,453 @@ + + + + + + + + + + + + + + EFL Basic UI Application + + + + +
    +
    +

    Mobile native Wearable native

    +
    + +
    +

    Dependencies

    +
      +
    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 2.3.1 and Higher for Wearable
    • +
    +

    Content

    + +

    Related Info

    + +
    +
    + +
    +

    EFL Basic UI Application

    + +

    To create an EFL basic UI application, you must:

    + + +

    Event Callbacks

    +

    The following table lists the application state change events.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Table: Application state change events +
    CallbackDescription
    app_create_cb()Used to take necessary actions before the main event loop starts. Place the UI generation code here to prevent missing any events from your application UI.
    app_pause_cb()Used to take necessary actions when the application becomes invisible. For example, release memory resources so other applications can use them. Do not starve the foreground application that is interacting with the user.
    app_resume_cb()Used to take necessary actions when the application becomes visible. If you relinquish anything in the app_pause_cb() callback, re-allocate those resources here before the application resumes.
    app_terminate_cb()Used to take necessary actions when the application is terminating. Release all resources, especially any allocations and shared resources, so that other running applications can fully use any shared resources.
    + +

    For more information, see Application State and Transition Management.

    + +

    To listen to system events, use the ui_app_add_event_handler() function. The system events are triggered with the app_event_cb() callback function. The following table lists the event types.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Table: Event types +
    Event typeDescription
    APP_EVENT_LOW_MEMORYEvent type for the callback function that is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the Tizen platform Low Memory Killer kills your application to get more free memory. The callback function must also release any cached data in the main memory to secure more free memory.
    APP_EVENT_LOW_BATTERYEvent type for the callback function that is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the power goes off completely. The callback function must also stop heavy CPU consumption or power consumption activities to save the remaining power.
    APP_EVENT_DEVICE_ORIENTATION_CHANGEDEvent type for the callback function that is responsible for changing the display orientation to match the device orientation.
    APP_EVENT_LANGUAGE_CHANGEDEvent type for the callback function that is responsible for refreshing the display into the new language.
    APP_EVENT_REGION_FORMAT_CHANGEDEvent type for the callback function that is responsible for refreshing the display into the new time zone.
    APP_EVENT_SUSPENDED_STATE_CHANGEDEvent type for the callback function that is responsible for taking necessary actions before entering the suspended state or after exiting from the state. (Supported since Tizen 2.4.)
    + +

    Application States and Transitions

    + +

    The Tizen native application can be in one of several different application states.

    + +

    The Application API defines 5 states with corresponding transition handlers. The state transition is notified through a state transition callback function, whether the application is created, running, paused, resumed, or terminated. The application must react to each state change appropriately.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Table: Application states +
    StateDescription
    READYApplication is launched.
    CREATEDApplication starts the main loop.
    RUNNINGApplication is running and visible to the user.
    PAUSEDApplication is running but invisible to the user.
    TERMINATEDApplication is terminated.
    + +

    The following figure illustrates the application state transitions.

    + +

    Figure: Application state transitions

    +

    Application state transitions

    + + + +

    Prerequisites

    +

    To use the functions and data types of the Application API (in mobile and wearable applications), include the <app.h> header file in your application:

    +
    +#include <app.h>
    +
    + +

    Handling the Application Fundamentals

    + +

    The Application API is a simple framework all Tizen applications are based on. It only handles interactions between applications and the operating system. In order for an application to operate successfully, it must receive events from the platform. For this, it must start the main event loop - this is mandatory for all Tizen native applications.

    + +

    To manage the application life-cycle:

    +
      +
    1. +

      Start the application with the main() function. It initializes the Application API and starts the main event loop with the ui_app_main() function. Before calling the ui_app_main() function, set up the app_event_callback_s structure variable, which is passed to the function.

      +

      The following code is a minimal application using the Application API. It only builds and runs.

      +
      +int
      +main(int argc, char *argv[])
      +{
      +    /* Create a ui_app_lifecycle_callback_s object and initialize its contents to 0 */
      +    ui_app_lifecycle_callback_s event_callback = {0,};
      +
      +    /* Run the application */
      +    return ui_app_main(&argc, &argv, &event_callback, NULL);
      +}
      +
      +
    2. +
    3. Define the application state callbacks. +

      The Application API has 2 classes of application state callbacks: those about the application life-cycle and those about the system.

      +
        +
      • +

        Application life-cycle callbacks:

        +
          +
        • create: Called after the ui_app_main() function and used to initialize the UI.
        • +
        • control: Triggered when the application is started to do something. It can be called several times during the lifespan of an application, and it shows the screen for the action requested. It requires specific information given to the callback.
        • +
        • terminate: Saves work, releases resources, and exits.
        • +
        • pause: Sets the application window not visible and switches to a mode which uses less resources.
        • +
        • resume: Sets the application window to be visible again.
        • +
        +
      • + +
      • +

        System-related events (handled with the app_event_cb() callback):

        +
          +
        • APP_EVENT_LOW_MEMORY: Used to save data in the main memory to a persistent memory or storage to avoid data loss in case the Tizen platform Low Memory Killer kills your application to get more free memory. The event is also used to release any cached data in the main memory to secure more free memory.
        • +
        • APP_EVENT_LOW_BATTERY: Used to save data in the main memory to a persistent memory or storage to avoid data loss in case the power goes off completely. The event is also used to stop heavy CPU consumption or power consumption activities to save the remaining power.
        • +
        • APP_EVENT_DEVICE_ORIENTATION_CHANGED: Used to change the display orientation to match the device orientation.
        • +
        • APP_EVENT_LANGUAGE_CHANGED: Used to refresh the display into a new language.
        • +
        • APP_EVENT_REGION_FORMAT_CHANGED: Used to refresh the display into a new time zone.
        • +
        +
      • +
      +

      The following example shows a basic application state callback implementation:

      +
      +/*
      +   Structure to store the data for application logic; it is given
      +   to each callback invoked through the Application API
      +*/
      +struct appdata {
      +    char *several;
      +    char *fields;
      +};
      +typedef struct appdata appdata_s;
      +
      +static bool
      +app_create(void *data)
      +{
      +    /*
      +       Hook to take necessary actions before main event loop starts; this
      +       usually means initializing the UI and application data (the "data"
      +       parameter to this function)
      +    */
      +
      +    appdata_s *ad = data;
      +    create_gui(ad);
      +
      +    /* If this function returns true, the main loop starts */
      +    /* If this function returns false, the application is terminated */
      +    return true;
      +}
      +
      +static void
      +app_control(app_control_h app_control, void *data)
      +{
      +    /*
      +       Handle the launch request, show the user the task requested through the
      +       "app_control" parameter (see the next step)
      +    */
      +}
      +
      +static void
      +app_pause(void *data)
      +{
      +    /* Take necessary actions when application becomes invisible */
      +}
      +
      +static void
      +app_resume(void *data)
      +{
      +    /* Take necessary actions when application becomes visible */
      +}
      +
      +static void
      +app_terminate(void *data)
      +{
      +    /* Release all resources */
      +    appdata_s *ad = data;
      +
      +    if (!ad)
      +        return;
      +
      +    /*
      +       If specific steps are needed:
      +       destroy_gui(ad);
      +    */
      +}
      +
      +int
      +main(int argc, char *argv[])
      +{
      +    appdata_s ad = {0,};
      +    ui_app_lifecycle_callback_s event_callback = {0,};
      +
      +    /* Set the callbacks for the application logic */
      +    event_callback.create = app_create;
      +    event_callback.terminate = app_terminate;
      +    event_callback.pause = app_pause;
      +    event_callback.resume = app_resume;
      +    event_callback.app_control = app_control;
      +
      +    /* Note the &ad below is how the struct is given to the callbacks */
      +    return ui_app_main(argc, argv, &event_callback, &ad);
      +}
      +
      +
    4. +
    5. +

      Define any required application controls. An app control is a mechanism through which the application receives additional information about why it was started and with which parameters.

      +

      The application receives a handle to an app control object in the app_control callback. The app_control_h type is opaque and information can only be extracted from it through API functions, such as:

      +
        +
      • app_control_get_operation(): Retrieve a string describing which operation the application was started for.
      • +
      • app_control_get_mime(): Retrieve the MIME type of the data (such as image/jpg).
      • +
      • app_control_get_app_extra_data(): Get the string value associated with a given key.
      • +
      • app_control_get_app_extra_data_array(): Get the string array associated with a given key (first check with app_control_is_extra_data_array() whether the data associated with the key is an array).
      • +
      +

      For other available functions, see the app.h header file.

      +

      For more information about launching other applications from your application using application controls, see Application Controls.

      +
    6. +
    + +

    Background Categories

    + +

    Since Tizen 2.4, the application is not allowed to run on the background except when it is explicitly declared to do so. The following table lists the background categories that allow the application to run on the background.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table: Allowed background application policy
    Background categoryDescriptionRelated APIsManifest file <background-category> element value
    MediaPlaying audio, recording, and outputting streaming video on the backgroundMultimedia API (in mobile and wearable applications)media
    DownloadDownloading data with the Tizen Download-manager APIDownload API (in mobile applications)download
    Background networkProcessing general network operations on the background (such as sync-manager, IM, and VOIP)Sync Manager API (in mobile applications), Socket, and Curl API (in mobile and wearable applications)background-network
    LocationProcessing location data on the backgroundLocation API (in mobile and wearable applications)location
    Sensor (context)Processing context data from the sensors, such as gestureSensor API (in mobile and wearable applications)sensor
    IoT Communication/ConnectivityCommunicating between external devices on the background (such as Wi-Fi and Bluetooth)Wi-Fi (in mobile and wearable applications) and Bluetooth API (in mobile and wearable applications)iot-communication
    + +

    Describing the Background Category

    +

    An application with a background running capability must declare the background category in its manifest file:

    + +
    +<?xml version="1.0" encoding="utf-8"?>
    +<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="org.tizen.test" version="1.0.0">
    +   <ui-application appid="org.tizen.test" exec="text" type="capp" multiple="false" taskmanage="true" nodisplay="false">
    +      <icon>rest.png</icon>
    +      <label>rest</label>
    +      <!--For API version 2.4 and higher-->
    +      <background-category value="media"/>
    +      <background-category value="download"/>
    +      <background-category value="background-network"/>
    +   </ui-application>
    +   <service-application appid="org.tizen.test-service" exec="test-service" multiple="false" type="capp">
    +      <background-category value="background-network"/>
    +      <background-category value="location"/>
    +   </service-application>
    +</manifest>
    +
    + + + + + + + + + + + + +
    Note
    The <background-category> element is supported since the API version 2.4. An application with a <background-category> element declared can fail to be installed on devices with a Tizen version lower than 2.4. In this case, declare the background category as <metadata key="http://tizen.org/metadata/background-category/<value>"/>.
    +
    +<?xml version="1.0" encoding="utf-8"?>
    +<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3" package="org.tizen.test" version="1.0.0">
    +   <ui-application appid="org.tizen.test" exec="text" type="capp" multiple="false" taskmanage="true" nodisplay="false">
    +      <icon>rest.png</icon>
    +      <label>rest</label>
    +      <!--For API version lower than 2.4-->
    +      <metadata key="http://tizen.org/metadata/background-category/media"/>
    +      <metadata key="http://tizen.org/metadata/background-category/download"/>
    +      <metadata key="http://tizen.org/metadata/background-category/background-network"/>
    +   </ui-application>
    +   <service-application appid="org.tizen.test-service" exec="test-service" multiple="false" type="capp">
    +      <metadata key="http://tizen.org/metadata/background-category/background-network"/>
    +      <metadata key="http://tizen.org/metadata/background-category/location"/>
    +   </service-application>
    +</manifest>
    +
    +

    The <metadata key="http://tizen.org/metadata/bacgkround-category/<value>"/> element has no effect on Tizen 2.3 devices, but, in Tizen 2.4 and higher devices, it has the same effect as the <background-category> element.

    +
    + +

    The background category of your application can be specified in the +application project settings in the Tizen Studio.

    + + + +
    + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/app_management/event_n.htm b/org.tizen.guides/html/native/app_management/event_n.htm index 66dcc71..e90acf8 100644 --- a/org.tizen.guides/html/native/app_management/event_n.htm +++ b/org.tizen.guides/html/native/app_management/event_n.htm @@ -65,8 +65,8 @@

    The application can be suspended while in the background, causing a pause in event handling. Since the application cannot receive events in the suspended state, they are all delivered in series after the application exits the suspended state. Consider how to manage this situation and prevent the application from being flooded with events:

    -
    • To handle events in the background without going to a suspended state, declare a background category.
    • -
    • To avoid receiving any events that are triggered while the application is suspended, remove the event handler before entering the suspended state and add it back after exiting the suspended state. You can manage the event handler addition and removal in the APP_EVENT_SUSPENDED_STATE_CHANGED event callback, which is triggered each time the application enters and exist the suspended state.
    +
    • To handle events in the background without going to a suspended state, declare a background category.
    • +
    • To avoid receiving any events that are triggered while the application is suspended, remove the event handler before entering the suspended state and add it back after exiting the suspended state. You can manage the event handler addition and removal in the APP_EVENT_SUSPENDED_STATE_CHANGED event callback, which is triggered each time the application enters and exist the suspended state.

    Prerequisites

    @@ -726,4 +726,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.guides/html/native/app_management/service_app_n.htm b/org.tizen.guides/html/native/app_management/service_app_n.htm index dfada1a..c3e483b 100644 --- a/org.tizen.guides/html/native/app_management/service_app_n.htm +++ b/org.tizen.guides/html/native/app_management/service_app_n.htm @@ -10,7 +10,7 @@ - Service Application + Service Applications @@ -43,7 +43,7 @@
    -

    Service Application

    +

    Service Applications

    Service applications are Tizen native applications with no graphical user interface that run in the background. They can be very useful in performing activities (such as getting sensor data in the background) that need to run periodically or continuously, but do not require any user intervention.

    diff --git a/org.tizen.guides/html/native/app_management/ui_app_n.htm b/org.tizen.guides/html/native/app_management/ui_app_n.htm index 6d0bc2c..0e9ec92 100644 --- a/org.tizen.guides/html/native/app_management/ui_app_n.htm +++ b/org.tizen.guides/html/native/app_management/ui_app_n.htm @@ -11,7 +11,7 @@ - UI Application + UI Applications @@ -27,411 +27,39 @@
  • Tizen 2.4 and Higher for Mobile
  • Tizen 2.3.1 and Higher for Wearable
  • -

    Content

    -

    Related Info

    -

    UI Application

    +

    UI Applications

    -

    A Tizen native application is similar to a conventional Linux application, with some additional features optimized for mobile and wearable devices. The additional features have constraints, such as a relatively small screen size and lack of system resources compared to a larger system. For example, for power management reasons, the application can take actions to reduce usage when it finds out that it has its display window covered over by another application window. State change events are delivered to make it possible to detect these situations.

    - -

    The main Application API features include:

    - - -

    Event Callbacks

    -

    The following table lists the application state change events.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Table: Application state change events -
    CallbackDescription
    app_create_cb()Used to take necessary actions before the main event loop starts. Place the UI generation code here to prevent missing any events from your application UI.
    app_pause_cb()Used to take necessary actions when the application becomes invisible. For example, release memory resources so other applications can use them. Do not starve the foreground application that is interacting with the user.
    app_resume_cb()Used to take necessary actions when the application becomes visible. If you relinquish anything in the app_pause_cb() callback, re-allocate those resources here before the application resumes.
    app_terminate_cb()Used to take necessary actions when the application is terminating. Release all resources, especially any allocations and shared resources, so that other running applications can fully use any shared resources.
    +

    UI applications are Tizen native applications with a graphical user interface that run in the foreground. Since they have a UI, they allow the user to easily interact with them.

    -

    For more information, see Application State and Transition Management.

    - -

    To listen to system events, use the ui_app_add_event_handler() function. The system events are triggered with the app_event_cb() callback function. The following table lists the event types.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Table: Event types -
    Event typeDescription
    APP_EVENT_LOW_MEMORYEvent type for the callback function that is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the Tizen platform Low Memory Killer kills your application to get more free memory. The callback function must also release any cached data in the main memory to secure more free memory.
    APP_EVENT_LOW_BATTERYEvent type for the callback function that is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the power goes off completely. The callback function must also stop heavy CPU consumption or power consumption activities to save the remaining power.
    APP_EVENT_DEVICE_ORIENTATION_CHANGEDEvent type for the callback function that is responsible for changing the display orientation to match the device orientation.
    APP_EVENT_LANGUAGE_CHANGEDEvent type for the callback function that is responsible for refreshing the display into the new language.
    APP_EVENT_REGION_FORMAT_CHANGEDEvent type for the callback function that is responsible for refreshing the display into the new time zone.
    APP_EVENT_SUSPENDED_STATE_CHANGEDEvent type for the callback function that is responsible for taking necessary actions before entering the suspended state or after exiting from the state. (Supported since Tizen 2.4.)
    - -

    Application States and Transitions

    - -

    The Tizen native application can be in one of several different application states.

    - -

    The Application API defines 5 states with corresponding transition handlers. The state transition is notified through a state transition callback function, whether the application is created, running, paused, resumed, or terminated. The application must react to each state change appropriately.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Table: Application states -
    StateDescription
    READYApplication is launched.
    CREATEDApplication starts the main loop.
    RUNNINGApplication is running and visible to the user.
    PAUSEDApplication is running but invisible to the user.
    TERMINATEDApplication is terminated.
    - -

    The following figure illustrates the application state transitions.

    - -

    Figure: Application state transitions

    -

    Application state transitions

    - - - -

    Prerequisites

    -

    To use the functions and data types of the Application API (in mobile and wearable applications), include the <app.h> header file in your application:

    -
    -#include <app.h>
    -
    - -

    Handling the Application Fundamentals

    - -

    The Application API is a simple framework all Tizen applications are based on. It only handles interactions between applications and the operating system. In order for an application to operate successfully, it must receive events from the platform. For this, it must start the main event loop - this is mandatory for all Tizen native applications.

    - -

    To manage the application life-cycle:

    -
      -
    1. -

      Start the application with the main() function. It initializes the Application API and starts the main event loop with the ui_app_main() function. Before calling the ui_app_main() function, set up the app_event_callback_s structure variable, which is passed to the function.

      -

      The following code is a minimal application using the Application API. It only builds and runs.

      -
      -int
      -main(int argc, char *argv[])
      -{
      -    /* Create a ui_app_lifecycle_callback_s object and initialize its contents to 0 */
      -    ui_app_lifecycle_callback_s event_callback = {0,};
      -
      -    /* Run the application */
      -    return ui_app_main(&argc, &argv, &event_callback, NULL);
      -}
      -
      -
    2. -
    3. Define the application state callbacks. -

      The Application API has 2 classes of application state callbacks: those about the application life-cycle and those about the system.

      -
        -
      • -

        Application life-cycle callbacks:

        -
          -
        • create: Called after the ui_app_main() function and used to initialize the UI.
        • -
        • control: Triggered when the application is started to do something. It can be called several times during the lifespan of an application, and it shows the screen for the action requested. It requires specific information given to the callback.
        • -
        • terminate: Saves work, releases resources, and exits.
        • -
        • pause: Sets the application window not visible and switches to a mode which uses less resources.
        • -
        • resume: Sets the application window to be visible again.
        • -
        -
      • - -
      • -

        System-related events (handled with the app_event_cb() callback):

        -
          -
        • APP_EVENT_LOW_MEMORY: Used to save data in the main memory to a persistent memory or storage to avoid data loss in case the Tizen platform Low Memory Killer kills your application to get more free memory. The event is also used to release any cached data in the main memory to secure more free memory.
        • -
        • APP_EVENT_LOW_BATTERY: Used to save data in the main memory to a persistent memory or storage to avoid data loss in case the power goes off completely. The event is also used to stop heavy CPU consumption or power consumption activities to save the remaining power.
        • -
        • APP_EVENT_DEVICE_ORIENTATION_CHANGED: Used to change the display orientation to match the device orientation.
        • -
        • APP_EVENT_LANGUAGE_CHANGED: Used to refresh the display into a new language.
        • -
        • APP_EVENT_REGION_FORMAT_CHANGED: Used to refresh the display into a new time zone.
        • -
        -
      • -
      -

      The following example shows a basic application state callback implementation:

      -
      -/*
      -   Structure to store the data for application logic; it is given
      -   to each callback invoked through the Application API
      -*/
      -struct appdata {
      -    char *several;
      -    char *fields;
      -};
      -typedef struct appdata appdata_s;
      -
      -static bool
      -app_create(void *data)
      -{
      -    /*
      -       Hook to take necessary actions before main event loop starts; this
      -       usually means initializing the UI and application data (the "data"
      -       parameter to this function)
      -    */
      -
      -    appdata_s *ad = data;
      -    create_gui(ad);
      -
      -    /* If this function returns true, the main loop starts */
      -    /* If this function returns false, the application is terminated */
      -    return true;
      -}
      -
      -static void
      -app_control(app_control_h app_control, void *data)
      -{
      -    /*
      -       Handle the launch request, show the user the task requested through the
      -       "app_control" parameter (see the next step)
      -    */
      -}
      -
      -static void
      -app_pause(void *data)
      -{
      -    /* Take necessary actions when application becomes invisible */
      -}
      -
      -static void
      -app_resume(void *data)
      -{
      -    /* Take necessary actions when application becomes visible */
      -}
      +

      A Tizen native UI application is similar to a conventional Linux application, with some additional features optimized for mobile and wearable devices. The additional features have constraints, such as a relatively small screen size and lack of system resources compared to a larger system. For example, for power management reasons, the application can take actions to reduce usage when it finds out that it has its display window covered over by another application window. State change events are delivered to make it possible to detect these situations.

      -static void -app_terminate(void *data) -{ -    /* Release all resources */ -    appdata_s *ad = data; +

      When creating a native UI application, you can select between the EFL and DALi UI frameworks:

      -    if (!ad) -        return; - -    /* -     If specific steps are needed: -     destroy_gui(ad); -    */ -} - -int -main(int argc, char *argv[]) -{ -    appdata_s ad = {0,}; -    ui_app_lifecycle_callback_s event_callback = {0,}; - -    /* Set the callbacks for the application logic */ -    event_callback.create = app_create; -    event_callback.terminate = app_terminate; -    event_callback.pause = app_pause; -    event_callback.resume = app_resume; -    event_callback.app_control = app_control; - -    /* Note the &ad below is how the struct is given to the callbacks */ -    return ui_app_main(argc, argv, &event_callback, &ad); -} -
      -
    4. -
    5. -

      Define any required application controls. An app control is a mechanism through which the application receives additional information about why it was started and with which parameters.

      -

      The application receives a handle to an app control object in the app_control callback. The app_control_h type is opaque and information can only be extracted from it through API functions, such as:

        -
      • app_control_get_operation(): Retrieve a string describing which operation the application was started for.
      • -
      • app_control_get_mime(): Retrieve the MIME type of the data (such as image/jpg).
      • -
      • app_control_get_app_extra_data(): Get the string value associated with a given key.
      • -
      • app_control_get_app_extra_data_array(): Get the string array associated with a given key (first check with app_control_is_extra_data_array() whether the data associated with the key is an array).
      • +
      • DALi UI framework +

        The DALi application is based on the Dynamic Animation Library. The DALi internally defines a virtual 3D world (space) and maintains hierarchical objects in the 3D world. The hierarchical object tree is known as the scene graph. A node in the scene graph can have several children but often only a single parent, with the effect of a parent applied to all its child nodes; an operation performed on a group automatically propagates its effect to all of its members.

        + +

        For more information on the available application types for the DALi framework, see DALi Applications.

        +
      • + +
      • EFL UI framework +

        The EFL application is based on the Enlightenment Foundation Library. The EFL application provides a 2D-based Tizen native application, and streamlined graphic core libraries you need to create powerful applications. EFL needs relatively low memory but provides high performance, and supports a retained mode graphics system and user-centric features, such as themes, 2D/3D effects, and accessibility. In addition, EFL supports various resolutions with the same layout, fast and small file systems, a variety of programming language bindings, and a separate UI and logic.

        + +

        For more information on the available application types for the EFL framework, see EFL Applications.

        +
      -

      For other available functions, see the app.h header file.

      -

      For more information about launching other applications from your application using application controls, see Application Controls.

      -
    6. -
    - -

    Background Categories

    -

    Since Tizen 2.4, the application is not allowed to run on the background except when it is explicitly declared to do so. The following table lists the background categories that allow the application to run on the background.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Table: Allowed background application policy
    Background categoryDescriptionRelated APIsManifest file <background-category> element value
    MediaPlaying audio, recording, and outputting streaming video on the backgroundMultimedia API (in mobile and wearable applications)media
    DownloadDownloading data with the Tizen Download-manager APIDownload API (in mobile applications)download
    Background networkProcessing general network operations on the background (such as sync-manager, IM, and VOIP)Sync Manager API (in mobile applications), Socket, and Curl API (in mobile and wearable applications)background-network
    LocationProcessing location data on the backgroundLocation API (in mobile and wearable applications)location
    Sensor (context)Processing context data from the sensors, such as gestureSensor API (in mobile and wearable applications)sensor
    IoT Communication/ConnectivityCommunicating between external devices on the background (such as Wi-Fi and Bluetooth)Wi-Fi (in mobile and wearable applications) and Bluetooth API (in mobile and wearable applications)iot-communication
    - -

    Describing the Background Category

    -

    An application with a background running capability must declare the background category in its manifest file:

    - -
    -<?xml version="1.0" encoding="utf-8"?>
    -<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="org.tizen.test" version="1.0.0">
    -   <ui-application appid="org.tizen.test" exec="text" type="capp" multiple="false" taskmanage="true" nodisplay="false">
    -      <icon>rest.png</icon>
    -      <label>rest</label>
    -      <!--For API version 2.4 and higher-->
    -      <background-category value="media"/>
    -      <background-category value="download"/>
    -      <background-category value="background-network"/>
    -   </ui-application>
    -   <service-application appid="org.tizen.test-service" exec="test-service" multiple="false" type="capp">
    -      <background-category value="background-network"/>
    -      <background-category value="location"/>
    -   </service-application>
    -</manifest>
    -
    - - - - - - - - - - - - -
    Note
    The <background-category> element is supported since the API version 2.4. An application with a <background-category> element declared can fail to be installed on devices with a Tizen version lower than 2.4. In this case, declare the background category as <metadata key="http://tizen.org/metadata/background-category/<value>"/>.
    -
    -<?xml version="1.0" encoding="utf-8"?>
    -<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3" package="org.tizen.test" version="1.0.0">
    -   <ui-application appid="org.tizen.test" exec="text" type="capp" multiple="false" taskmanage="true" nodisplay="false">
    -      <icon>rest.png</icon>
    -      <label>rest</label>
    -      <!--For API version lower than 2.4-->
    -      <metadata key="http://tizen.org/metadata/background-category/media"/>
    -      <metadata key="http://tizen.org/metadata/background-category/download"/>
    -      <metadata key="http://tizen.org/metadata/background-category/background-network"/>
    -   </ui-application>
    -   <service-application appid="org.tizen.test-service" exec="test-service" multiple="false" type="capp">
    -      <metadata key="http://tizen.org/metadata/background-category/background-network"/>
    -      <metadata key="http://tizen.org/metadata/background-category/location"/>
    -   </service-application>
    -</manifest>
    -
    -

    The <metadata key="http://tizen.org/metadata/bacgkround-category/<value>"/> element has no effect on Tizen 2.3 devices, but, in Tizen 2.4 and higher devices, it has the same effect as the <background-category> element.

    -
    - -

    The background category of your application can be specified in the -application project settings in the Tizen Studio.

    -
    diff --git a/org.tizen.guides/html/native/app_management/watch_app_n.htm b/org.tizen.guides/html/native/app_management/watch_app_n.htm index 7a4657f..2fbf193 100644 --- a/org.tizen.guides/html/native/app_management/watch_app_n.htm +++ b/org.tizen.guides/html/native/app_management/watch_app_n.htm @@ -10,7 +10,7 @@ - Watch Application + EFL Watch Application @@ -48,7 +48,7 @@
    -

    Watch Application

    +

    EFL Watch Application

    Tizen allows you to create a watch application and manage its life-cycle to retrieve the current date and time and display it accurately on the screen.

    This feature is supported in wearable applications only.

    diff --git a/org.tizen.guides/html/native/app_management/widget_app_n.htm b/org.tizen.guides/html/native/app_management/widget_app_n.htm index bb03cac..3f731c2 100644 --- a/org.tizen.guides/html/native/app_management/widget_app_n.htm +++ b/org.tizen.guides/html/native/app_management/widget_app_n.htm @@ -10,7 +10,7 @@ - Widget Application + EFL Widget Application @@ -48,7 +48,7 @@
    -

    Widget Application

    +

    EFL Widget Application

    You can create widget applications, which are Tizen native applications shown on the home screen. They are launched by the home screen when the user selects them in the Add Widget menu.

    The main features of the Widget Application API include:

    diff --git a/org.tizen.guides/html/native/graphics/adv_performance_n.htm b/org.tizen.guides/html/native/graphics/adv_performance_n.htm index 2470695..f386c49 100644 --- a/org.tizen.guides/html/native/graphics/adv_performance_n.htm +++ b/org.tizen.guides/html/native/graphics/adv_performance_n.htm @@ -46,7 +46,7 @@
  • Try to avoid writing a heavy fragment shader. If the same data apply to all fragments, do not compute the data in the fragment shader but compute them at the CPU side and provide them as uniforms. On the other hand, whenever the data can be computed at the vertex shader, use it.
  • In general, the glReadPixels() function is quite slow, because it reinforces CPU-GPU synchronization, drastically decreasing the overall performance. In most cases, it is possible to obtain the desired result with the framebuffer object (FBO), avoiding the use of glReadPixels(). With FBO, you can access the pixels of the framebuffer (the output of GPU processing) through a texture object (render-to-texture). Since it uses texture data from a GPU stage to another GPU stage, CPU does not have to be synchronized. If the application must use the glReadPixels()function, use another thread to avoid blocking the main thread.
  • With FBO, various effects can be made. Consider an application requiring a number of rendering chains for making a complex effect: A framebuffer is mapped to a texture, the texture is used to render another framebuffer, the framebuffer is mapped to another texture, and so on. This enables you to create a very complex scene, but unfortunately the rendering chain cannot be parallelized. Make the rendering chains as small as possible.
  • -
  • According to the application life-cycle, the application gets the app_pause() callback when the application runs at the background. Then, you must stop calling drawcalls during the pause state. +
  • According to the application life-cycle, the application gets the app_pause() callback when the application runs at the background. Then, you must stop calling drawcalls during the pause state.

    As presented in Interactive UI, the application can control the rendering loop by using an animator internally and then stop the animator in the app_pause() callback.

  • @@ -74,4 +74,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.guides/html/native/migration_guide_n.htm b/org.tizen.guides/html/native/migration_guide_n.htm index 874e69c..6674bea 100644 --- a/org.tizen.guides/html/native/migration_guide_n.htm +++ b/org.tizen.guides/html/native/migration_guide_n.htm @@ -48,7 +48,7 @@

    New Background Application Policy

    Since Tizen 2.4, the application on the background goes into a suspended state.

    In the suspended state, the application process is executed with limited CPU resources. In other words, the platform does not allow the running of the background applications, except for some exceptional applications (such as Media and Download) that necessarily work on the background. In this case, the application can designate their background category as an allowed category to avoid going into the suspended state.

    -

    For more information, and a list of background categories that allow the application to run on the background, see Allowing Applications to Run on the Background.

    +

    For more information, and a list of background categories that allow the application to run on the background, see Allowing Applications to Run on the Background.

    You can receive an event when the background application goes to the suspended state. Pass APP_EVENT_SUSPENDED_STATE_CHANGED as event_type to the ui_app_add_event_handler() or service_app_add_event_handler() function to handle the suspended event. You must release the resources properly when your application goes to the suspended state.

    @@ -106,4 +106,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.guides/html/native/ui/dali/actors_n.htm b/org.tizen.guides/html/native/ui/dali/actors_n.htm index a55d461..8d30b30 100644 --- a/org.tizen.guides/html/native/ui/dali/actors_n.htm +++ b/org.tizen.guides/html/native/ui/dali/actors_n.htm @@ -18,12 +18,13 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    Dependencies

    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 3.0 and Higher for Wearable

    Content

    @@ -58,9 +61,9 @@
    • UI Components are used to organize the application appearance. For more information, see UI Components.
    • -
    • Camera actor determines which view of the whole virtual 3D world is rendered on the screen. By default, it is best suited for 2D applications, so you do not need to care about it in this case. For more information, see the Dali::CameraActor class.
    • +
    • Camera actor determines which view of the whole virtual 3D world is rendered on the screen. By default, it is best suited for 2D applications, so you do not need to care about it in this case. For more information, see the Dali::CameraActor class (in mobile and wearable applications).
    • -
    • Layer provides a mechanism for overlaying groups of actors on top of each other. For more information, see the Dali::Layer class.
    • +
    • Layer provides a mechanism for overlaying groups of actors on top of each other. For more information, see the Dali::Layer class (in mobile and wearable applications).
    diff --git a/org.tizen.guides/html/native/ui/dali/animation_n.htm b/org.tizen.guides/html/native/ui/dali/animation_n.htm index 280faa5..3ce6619 100644 --- a/org.tizen.guides/html/native/ui/dali/animation_n.htm +++ b/org.tizen.guides/html/native/ui/dali/animation_n.htm @@ -18,12 +18,13 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    @@ -136,7 +140,7 @@ void HelloWorldExample::OnFinished( Animation& animation )

    Using Alpha Functions

    -

    Alpha functions are used in animations to specify the rate of change of the animation parameter over time. This allows the animation to be, for example, accelerated, decelerated, repeated, or bounced. The built-in supported functions can be viewed in the Dali::AlphaFunction::BuiltinFunction enumeration.

    +

    Alpha functions are used in animations to specify the rate of change of the animation parameter over time. This allows the animation to be, for example, accelerated, decelerated, repeated, or bounced. The built-in supported functions can be viewed in the Dali::AlphaFunction::BuiltinFunction enumeration (in mobile and wearable applications).

     animation.SetDefaultAlphaFunction( Dali::AlphaFunction::EASE_IN );
     
    diff --git a/org.tizen.guides/html/native/ui/dali/animation_types_n.htm b/org.tizen.guides/html/native/ui/dali/animation_types_n.htm index 4595a1b..954aa0e 100644 --- a/org.tizen.guides/html/native/ui/dali/animation_types_n.htm +++ b/org.tizen.guides/html/native/ui/dali/animation_types_n.htm @@ -18,12 +18,13 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    Dependencies

    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 3.0 and Higher for Wearable

    Content

    @@ -79,7 +82,7 @@ path.AddPoint( Vector3( 10.0f, 90.0f, 0.0f ) );
     path.GenerateControlPoints( 0.25f );
     
    -

    Here 0.25f represents the curvature of the path you require. For more information, see the GenerateControlPoints() function in Dali::Path class.

    +

    Here 0.25f represents the curvature of the path you require. For more information, see the GenerateControlPoints() function in the Dali::Path class (in mobile and wearable applications).

    To animate actor1 along this path, use the following function:

     animation.Animate( actor1, path, Vector3::ZERO );
    diff --git a/org.tizen.guides/html/native/ui/dali/background_n.htm b/org.tizen.guides/html/native/ui/dali/background_n.htm
    index b052150..ef274b9 100644
    --- a/org.tizen.guides/html/native/ui/dali/background_n.htm
    +++ b/org.tizen.guides/html/native/ui/dali/background_n.htm
    @@ -18,17 +18,20 @@
     
     	
    diff --git a/org.tizen.guides/html/native/ui/dali/buttons_n.htm b/org.tizen.guides/html/native/ui/dali/buttons_n.htm
    index 8aa372b..f204eb7 100644
    --- a/org.tizen.guides/html/native/ui/dali/buttons_n.htm
    +++ b/org.tizen.guides/html/native/ui/dali/buttons_n.htm
    @@ -18,12 +18,13 @@
     
     
    -

    Mobile native

    +

    Mobile native Wearable native

    diff --git a/org.tizen.guides/html/native/ui/dali/constraints_n.htm b/org.tizen.guides/html/native/ui/dali/constraints_n.htm index 756c8a7..59e3a7c 100644 --- a/org.tizen.guides/html/native/ui/dali/constraints_n.htm +++ b/org.tizen.guides/html/native/ui/dali/constraints_n.htm @@ -18,12 +18,13 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    Dependencies

    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 3.0 and Higher for Wearable

    Content

    @@ -169,7 +171,7 @@ void HelloWorldExample::OnPan( Actor actor, const PanGesture& gesture ) }
    -

    For more information, see the New() function in the Dali::Constraint class.

    +

    For more information, see the New() function in the Dali::Constraint class (in mobile and wearable applications).

    Using Functors as Constraint Functions

    @@ -291,12 +293,12 @@ actor.RemoveConstraints( tag ); Need an actor to appear centered around the bottom-right corner of its parent. - Use the Dali::ParentOrigin and Dali::AnchorPoint namespaces. + Use the Dali::ParentOrigin (in mobile and wearable applications) and Dali::AnchorPoint (in mobile and wearable applications) namespaces.

    For more information, see Positioning Actors.

    Need to lay out a series of controls with various alignment requirements. - Use either ParentOrigin and AnchorPoint settings, or the Dali::Toolkit::TableView class. + Use either ParentOrigin and AnchorPoint settings, or the Dali::Toolkit::TableView class (in mobile and wearable applications). Need to automatically modify the position property of one actor based on the position property of another actor that is neither a parent or a child. diff --git a/org.tizen.guides/html/native/ui/dali/control_base_n.htm b/org.tizen.guides/html/native/ui/dali/control_base_n.htm index 918822b..c658c76 100644 --- a/org.tizen.guides/html/native/ui/dali/control_base_n.htm +++ b/org.tizen.guides/html/native/ui/dali/control_base_n.htm @@ -18,12 +18,13 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    Dependencies

    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 3.0 and Higher for Wearable

    Content

    diff --git a/org.tizen.guides/html/native/ui/dali/dali_n.htm b/org.tizen.guides/html/native/ui/dali/dali_n.htm index d0c3583..b20f7e7 100644 --- a/org.tizen.guides/html/native/ui/dali/dali_n.htm +++ b/org.tizen.guides/html/native/ui/dali/dali_n.htm @@ -18,16 +18,18 @@
    -

    Mobile native

    +

    Mobile native Wearable native

    Dependencies

    • Tizen 2.4 and Higher for Mobile
    • +
    • Tizen 3.0 and Higher for Wearable

    Related Info

    @@ -37,8 +39,6 @@

    DALi is a cross-platform 3D UI Toolkit for embedded systems. Its 3D user interface engine enables you to create rich and high-performance UI applications. DALi is based on OpenGL ES 2.0, but provides a clean cross-platform C++ framework. This means that you can use high-level DALi APIs instead of accessing low-level OpenGL APIs directly.

    -

    This feature is supported in mobile applications only.

    -

    When creating a DALi application, make sure you understand the following main features:

      diff --git a/org.tizen.guides/html/native/ui/dali/dali_overview_n.htm b/org.tizen.guides/html/native/ui/dali/dali_overview_n.htm index e18edd0..d0cde81 100644 --- a/org.tizen.guides/html/native/ui/dali/dali_overview_n.htm +++ b/org.tizen.guides/html/native/ui/dali/dali_overview_n.htm @@ -18,12 +18,13 @@
      -

      Mobile native

      +

      Mobile native Wearable native

      Dependencies

      • Tizen 2.4 and Higher for Mobile
      • +
      • Tizen 3.0 and Higher for Wearable

      Content

      @@ -98,14 +100,15 @@

      To create a 'Hello World' application with Dali:

        -
      1. Create a DALi project: +
      2. Create a DALi project:
          -
        1. In the Tizen Studio menu, go to File > New > Tizen Project. -

          Select a template for a mobile native application and create a project using the Basic UI with DALi template. Click Finish, and your project is created at the default location. If you want to change the location, uncheck Use default location and set a new location. For more information, see Creating the Application Project.

          +
        2. In the Tizen Studio menu, go to File > New > Tizen Project.
        3. +
        4. In the Project Wizard, select Template > Mobile or Wearable > Native Application > Basic UI with DALi.
        5. +
        6. Click Finish, and your project is created at the default location. If you want to change the location, uncheck Use default location and set a new location. For more information, see Creating the Application Project.

          Create a DALi project

        7. -
        8. The new project is shown in the Project Explorer view of the Tizen Studio. If you open the src/basicdaliapplication.cpp file, you can see the source code of the basic DALi application: +
        9. The new project is shown in the Project Explorer view of the Tizen Studio. If you open the src/basicuiwithdali.cpp file, you can see the source code of the basic DALi application:
           #include <dali-toolkit/dali-toolkit.h>
           
          @@ -138,16 +141,18 @@ class HelloWorldExample : public ConnectionTracker
                 stage.SetBackgroundColor( Color::WHITE );
           
                 TextLabel textLabel = TextLabel::New( "Hello World" );
          +      textLabel.SetSize( stage.GetSize() );
                 textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
          -      textLabel.SetName( "hello-world-label" );
          +      textLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
          +      textLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
                 stage.Add( textLabel );
           
                 // Connect to touch and key event signals
          -      stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldExample::OnTouch );
          +      stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldExample::OnTouch );
                 stage.KeyEventSignal().Connect( this, &HelloWorldExample::OnKeyEvent );
               }
           
          -    bool OnTouch( Actor actor, const TouchEvent& event )
          +    bool OnTouch( Actor actor, const TouchData& touch )
               {
                 // Quit the application
                 mApplication.Quit();
          @@ -184,7 +189,7 @@ int main( int argc, char **argv )
           
      3. -
      4. Initialize the DALi application: +
      5. Initialize the DALi application:
        • To use the DALi APIs, you only need to include the dali-toolkit.h file. It includes the header files of DALi Core and DALi Adaptor as well as DALi Toolkit.

          @@ -201,7 +206,7 @@ using namespace Dali::Toolkit;
        • -

          The Dali::Application class initializes and sets up DALi.

          +

          The Dali::Application class (in mobile and wearable applications) initializes and sets up DALi.

          Create a Dali::Application instance:

          @@ -210,7 +215,7 @@ Application application = Application::New( &argc, &argv );
        • Several signals can be connected to keep you informed when certain platform-related activities occur, and ensure that, upon system events, DALi is called in a thread-safe manner.

          -

          To manage signal connection safely, DALi provides the Dali::ConnectionTracker class. A typical way for starting a DALi application is to create a class derived from the Dali::ConnectionTracker class and use its member functions as callback functions for DALi signals (for more information, see Automatic Connection Management). The HelloWorldExample class is used in other code samples in the Tizen DALi documentation.

          +

          To manage signal connection safely, DALi provides the Dali::ConnectionTracker class (in mobile and wearable applications). A typical way for starting a DALi application is to create a class derived from the Dali::ConnectionTracker class and use its member functions as callback functions for DALi signals (for more information, see Automatic Connection Management). The HelloWorldExample class is used in other code samples in the Tizen DALi documentation.

          After getting the initialized signal from the Dali::Application instance, you can use the DALi APIs for building the scene graph. Connect the HelloWorldExample::Create() callback to the DALi::Application::InitSignal() function:

          @@ -219,40 +224,42 @@ mApplication.InitSignal().Connect( this, &HelloWorldExample::Create );
      6. -
      7. Create an actor and add it to the stage: +
      8. Create an actor and add it to the stage: -

        The Dali::Toolkit::TextLabel UI component renders a short text string. To display the TextLabel component, add it to a stage. The stage instance is a singleton object (the only instance of its class during the lifetime of the program), so you can get it using a static function.

        +

        The Dali::Toolkit::TextLabel UI component (in mobile and wearable applications) renders a short text string. To display the TextLabel component, add it to a stage. The stage instance is a singleton object (the only instance of its class during the lifetime of the program), so you can get it using a static function.

         Stage stage = Stage::GetCurrent();
         stage.SetBackgroundColor( Color::WHITE );
         
         TextLabel textLabel = TextLabel::New( "Hello World" );
        +textLabel.SetSize( stage.GetSize() );
         textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        -textLabel.SetName( "hello-world-label" );
        +textLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
        +textLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
         stage.Add( textLabel );
         

        The above code additionally sets the background color of the stage and the anchor point, a point defining a position of a child actor from its parent, of the textLabel. The application stores the actor and resource handles. DALi objects are reference-counted, which makes sure they exist only as long as they are needed. Even if the TextLabel component is removed from the stage, it remains alive through the reference.

      9. -
      10. Connect to input signals: +
      11. Connect to input signals:

        The application can handle touch and key event signals as follows:

        -stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldExample::OnTouch );
        +stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldExample::OnTouch );
         stage.KeyEventSignal().Connect( this, &HelloWorldExample::OnKeyEvent );
         

        Any key inputs and touches on the stage are handled by 2 callback functions, HelloWorldExample::OnKeyEvent and HelloWorldExample::OnTouch.

        -

        Note that the first parameter of the HelloWorldExample::OnTouch callback (actor) is passed by a value, not by a reference or a pointer. You can simply pass instances of most DALi classes by value, when the class inherits from the Dali::BaseHandle class. This is due to the handle/body pattern widely used in DALi.

        +

        Note that the first parameter of the HelloWorldExample::OnTouch callback (actor) is passed by a value, not by a reference or a pointer. You can simply pass instances of most DALi classes by value, when the class inherits from the Dali::BaseHandle class (in mobile and wearable applications). This is due to the handle/body pattern widely used in DALi.

        -bool OnTouch( Actor actor, const TouchEvent& event )
        +bool OnTouch( Actor actor, const TouchData& touch )
         
      12. -
      13. Start the application main loop: +
      14. Start the application main loop:

        To run the application, start its main loop. This ensures that images are displayed, and events as well as signals are dispatched and captured.

        @@ -261,13 +268,13 @@ application.MainLoop();
         
         
         
      15. -
      16. Build the DALi application: +
      17. Build the DALi application:

        To build your application, select Project > Build Project or press F10 in the Tizen Studio.

        The Tizen Studio automatically packages the project after building. Note that you need to register your certificate when building for the first time. For more information, see Working with the Certificate Profile and Building Applications.

      18. -
      19. Run the DALi application: +
      20. Run the DALi application:

        To run your application, select Run > Run or press Ctrl+F11 in the Tizen Studio.

        For more information, see Running Applications.

        diff --git a/org.tizen.guides/html/native/ui/dali/event_handling_n.htm b/org.tizen.guides/html/native/ui/dali/event_handling_n.htm index 9dc10ed..0e1ae10 100644 --- a/org.tizen.guides/html/native/ui/dali/event_handling_n.htm +++ b/org.tizen.guides/html/native/ui/dali/event_handling_n.htm @@ -18,16 +18,17 @@ @@ -78,23 +88,23 @@
      21. Many-to-many relationship: 1 slot can connect to many signals and 1 signal can be connected to many slots, for example
    -

    Touch Events

    -

    The Dali::Actor class provides the TouchedSignal() function to inform the application that a user touches the actor. It is defined as follows:

    +

    Touch Data

    +

    The Dali::Actor class (in mobile and wearable applications) provides the TouchSignal() function to inform the application that a user touches the actor. It is defined as follows:

    -typedef Signal<bool ( Actor, const TouchEvent& )> TouchSignalType;
    -TouchSignalType& TouchedSignal();
    +typedef Signal<bool ( Actor, const TouchData& )> TouchDataSignalType; +TouchDataSignalType& TouchSignal(); -

    This means that a slot of the following type can be connected to the return value of the Actor::TouchedSignal() function:

    +

    This means that a slot of the following type can be connected to the return value of the Actor::TouchSignal() function:

    -bool YourCallbackName( Actor actor, const TouchEvent& event );
    +bool YourCallbackName( Actor actor, const TouchData& data );
     

    The return value true indicates that the touch event must be consumed. Otherwise, the signal is emitted on the next sensitive parent of the actor. Note that a callback function signature varies depending on its corresponding signal type. Some signal types do not have a return value in their callback functions.

    Each point on the screen being or having been touched is represented by the Dali::TouchPoint object. This object stores information about the state of the touch point (such as down, up, or motion.) and the coordinates of the touch.

    -

    A collection of touch points at a specific moment in time is collated into the Dali::TouchEvent object. When a multi-touch event occurs, each touch point represents the points that are currently being touched or the points where touch has stopped.

    +

    A collection of touch points at a specific moment in time is collated into the Dali::TouchData object (in mobile and wearable applications). When a multi-touch event occurs, each touch point represents the points that are currently being touched or the points where touch has stopped.

    The following example shows how a connection to a touch event signal can be established:

    @@ -111,31 +121,33 @@ void HelloWorldExample::Create( Application& application )   Stage::GetCurrent().Add( control );   // Connect to a touch signal emitted by the control -  control.TouchedSignal().Connect( this, &HelloWorldExample::OnTouch ); +  control.TouchSignal().Connect( this, &HelloWorldExample::OnTouch ); } -bool HelloWorldExample::OnTouch( Actor actor, const TouchEvent& event ) +bool HelloWorldExample::OnTouch( Actor actor, TouchData& touch ) { -  bool handled = false; -  unsigned int pointCount = event.GetPointCount(); +  const std::size_t pointCount = touch.GetPointCount();   if( pointCount == 1 )   { -    if( event.GetPoint( 0 ).state == TouchPoint::Down ) +    // Single touch event + +    // Get touch state of the primary point +    PointState::Type pointState = touch.GetState( 0 ); +    if( pointState == PointState::DOWN )     { -      // Act on the first touch on screen -      handled = true; +      // User has just pressed on the device     } -  } -  else if( pointCount > 1 ) -  { -    if( event.GetPoint( pointCount-1 ).state == TouchPoint::Down ) +    else if( pointState == PointState::UP )     { -      // Act on a multi-touch on screen -      handled = true; +      // User has just released their finger from the device     }   } -  // true if the touch has been handled, false otherwise -  return handled; +  else +  { +    // Multi-touch event +  } + +  return true; // Touch handled } @@ -143,6 +155,8 @@ bool HelloWorldExample::OnTouch( Actor actor, const TouchEvent& event )

    If a parent and child actor both connect to the touch signal, the touch event is first offered to the child. If it is consumed by the child, the parent is not informed.

    +

    For more information on handling touch event data, see Touch Data.

    +

    Key Events

    The following example shows how to handle key events on the stage:

    @@ -315,7 +329,7 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )

    The basic DALi input signals are as follows:

      -
    • Touched signal notifies you of a screen touch or mouse click
    • +
    • Touch signal notifies you of a screen touch or mouse click
    • Hovered signal notifies you of mouse hovering
    • Wheel event signal notifies you of wheel rolling (for example, mouse wheel)
    • Key event signal notifies you of a keyboard input
    • @@ -337,9 +351,9 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event ) Description - TouchedSignal() + TouchSignal() Emitted when touch input is received. -

      Callback: bool YourCallbackName( Actor actor, const TouchEvent& event );

      +

      Callback: bool YourCallbackName( Actor actor, const TouchData& touch );

      HoveredSignal() @@ -358,7 +372,7 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )
    • -Dali::Stage +Dali::Stage (in mobile and wearable applications) - + +

      Callback: void YourCallbackName( const TouchData& data )

      @@ -391,7 +405,7 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )
    • -Dali::Toolkit::Control +Dali::Toolkit::Control (in mobile and wearable applications)
    • @@ -370,9 +384,9 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )
      Description
      TouchedSignal()TouchSignal() Emitted when touch input is received. -

      Callback: void YourCallbackName( const TouchEvent& event )

      HoveredSignal()
      - + @@ -432,7 +446,7 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )
    • -Dali::Toolkit::KeyboardFocusManager +Dali::Toolkit::KeyboardFocusManager (in mobile and wearable applications)
    • @@ -420,7 +434,7 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )

      Callback: bool YourCallbackName( Control control );

      TouchedSignal(), HoveredSignal(), KeyEventSignal()TouchSignal(), HoveredSignal(), KeyEventSignal() Same as the ones supported by Actor.
      @@ -497,10 +511,10 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )
    • Dali::Toolkit::AccessibilityFocusManager
    • Dali::Toolkit::KeyboardFocusManager
    • -

      For the signals of each class and their usage, see the API Reference.

      +

      For the signals of each class and their usage, see the DALi API Reference (in mobile and wearable applications).

      Gestures

      -

      Gesture is a user-friendly high-level event produced from a stream of touch events. The Dali::GestureDetector class analyzes a stream of touch events and attempts to determine the intention of the user.

      +

      Gesture is a user-friendly high-level event produced from a stream of touch events. The Dali::GestureDetector class (in mobile and wearable applications) analyzes a stream of touch events and attempts to determine the intention of the user.

      If an actor is attached to a gesture detector and the detector recognizes a user intention (detects a predefined pattern in a stream of touch events), the actor emits a detected gesture signal to the application.

      @@ -518,10 +532,10 @@ void HelloWorldExample::OnKeyEvent( const KeyEvent& event )

      DALi currently supports following gesture detectors:

        -
      • Dali::LongPressGestureDetector detects when the user does a long-press action.
      • -
      • Dali::TapGestureDetector detects when the user does a tap action.
      • -
      • Dali::PinchGestureDetector detects when the user moves 2 fingers towards or away from each other.
      • -
      • Dali::PanGestureDetector detects when the user moves one or more fingers in the same direction.
      • +
      • Dali::LongPressGestureDetector (in mobile and wearable applications) detects when the user does a long-press action.
      • +
      • Dali::TapGestureDetector (in mobile and wearable applications) detects when the user does a tap action.
      • +
      • Dali::PinchGestureDetector (in mobile and wearable applications) detects when the user moves 2 fingers towards or away from each other.
      • +
      • Dali::PanGestureDetector (in mobile and wearable applications) detects when the user moves one or more fingers in the same direction.

      The following example shows how an application can be notified of a pan gesture:

      @@ -560,12 +574,9 @@ void HelloWorldExample::OnPan( Actor actor, const PanGesture& gesture )

      If you have a pair of a connected signal (for example, a button clicked signal) and a slot (for example, a toolbar object having the callback for the signal), and one of them (the button or the toolbar) is deleted without any notification, the application crashes when the signal is emitted or the slot tries to disconnect the signal.

      -

      DALi provides the automatic connection management mechanism to prevent this kind of situation. The key is the Dali::ConnectionTracker class. It tracks connections between signals and slots, and performs an automatic disconnection when either the signal or slot is deleted.

      +

      DALi provides the automatic connection management mechanism to prevent this kind of situation. The key is the Dali::ConnectionTracker class (in mobile and wearable applications). It tracks connections between signals and slots, and performs an automatic disconnection when either the signal or slot is deleted.

      Due to this mechanism, all the DALi sample codes start with a controller class derived from the Dali::ConnectionTracker class. This is a safe and typical way of making a DALi application. You can, of course, create other structures using the Dali::ConnectionTracker class.

      - - - diff --git a/org.tizen.guides/html/native/ui/dali/flexcontainer_n.htm b/org.tizen.guides/html/native/ui/dali/flexcontainer_n.htm new file mode 100644 index 0000000..87d17b0 --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/flexcontainer_n.htm @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + FlexContainer + + + + +
      +
      +

      Mobile native Wearable native

      +
      +
      +

      Dependencies

      +
        +
      • Tizen 3.0 and Higher for Mobile
      • +
      • Tizen 3.0 and Higher for Wearable
      • +
      +

      Content

      + +

      Related Info

      + +
      +
      + +
      +

      FlexContainer

      + +

      The Dali::Toolkit::FlexContainer class provides a control that implements a subset of the CSS Flexible Box Layout Module Level 1 specification (defined by W3C).

      + +

      The flexible box (flexbox) is a CSS3 Web layout model, which allows responsive elements within a container, automatically arranged to different size screens or devices. The following figure illustrates the various directions and terms applied to a flex container with the "flex direction" defined as "row".

      + +

      Figure: Flex container terms

      +

      Flex container terms

      + + +

      Creating a Flexbox Layout with FlexContainer

      + +

      The following basic example shows how to create a gallery-like flexbox layout using the Dali::Toolkit::FlexContainer object.

      + +

      Figure: Flex container example

      +

      Flex container example

      + +
        +
      1. Create a flex container as the whole view and set its resize policy to fill its parent (the stage): + +
        +// Create the main flex container
        +FlexContainer flexContainer = FlexContainer::New();
        +flexContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +flexContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +flexContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
        +// Set the background color to be white
        +flexContainer.SetBackgroundColor( Color::WHITE );
        +// Add the container to the stage
        +Stage::GetCurrent().Add( flexContainer ); 
        +
        +
      2. + +
      3. Set the flex direction of the main container to "column" to make the toolbar and the actual content display vertically: + +
        +// Display toolbar and content vertically
        +flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::COLUMN ); 
        +
        +
      4. + +
      5. Create a new flex container as the toolbar and add it to the main container. Because the flex direction in the main container is column, the toolbar is arranged at the top of the main container. + +
        +// Create the toolbar
        +FlexContainer toolBar = FlexContainer::New();
        +toolBar.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +toolBar.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +// Set the background color for the toolbar
        +toolBar.SetBackgroundColor( Color::CYAN ); 
        +// Add it to the main container
        +flexContainer.Add( toolBar );
        +flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::COLUMN ); 
        +
        +
      6. + +
      7. To make the buttons and title display horizontally and be vertically aligned to the center of the toolbar, set the toolbar flex direction to "row" and set its ALIGN_ITEMS property to center. +

        Set the FLEX property to make the toolbar and the actual content share the height of the main container, so that the toolbar occupies 10 percent of the whole vertical space and the content occupies the rest of the vertical space.

        + +
        +// Display toolbar items horizontally
        +toolBar.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
        +// Align toolbar items vertically center
        +toolBar.SetProperty( FlexContainer::Property::ALIGN_ITEMS, FlexContainer::ALIGN_CENTER );
        +// 10 percent of available space in the cross axis
        +toolBar.SetProperty( FlexContainer::ChildProperty::FLEX, 0.1f );
        +
        +
      8. + +
      9. Create a third flex container as the content area to display the image. It is displayed at the bottom of the main container. +

        Make the item inside the content area container horizontally and vertically centered, so that the image is always at the center of the content area.

        + +
        +// Create the content area
        +FlexContainer content = FlexContainer::New();
        +content.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +content.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +// Display items horizontally
        +content.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
        +// Align items horizontally center 
        +content.SetProperty( FlexContainer::Property::JUSTIFY_CONTENT, FlexContainer::JUSTIFY_CENTER );
        +// Align items vertically center
        +content.SetProperty( FlexContainer::Property::ALIGN_ITEMS, FlexContainer::ALIGN_CENTER );
        +// 90 percent of available space in the cross axis
        +content.SetProperty( FlexContainer::ChildProperty::FLEX, 0.9f ); 
        +// Add it to the main container
        +flexContainer.Add( content );
        +
        +
      10. + +
      11. Add items to the toolbar. +

        The toolbar has 1 button on the left, 1 button on the right, and a title always in the center (regardless of the screen size). To achieve that, make the title flexible so that it automatically takes all the available horizontal space left. To make the layout look nicer, also add some space around the items.

        + +
        +// Add a button to the left of the toolbar
        +PushButton prevButton = PushButton::New();
        +prevButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +prevButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +// Minimum size the button must keep
        +prevButton.SetMinimumSize( Vector2( 100.0f, 60.0f ) ); 
        +// Set 10 pixel margin around the button
        +prevButton.SetProperty( FlexContainer::ChildProperty::FLEX_MARGIN, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) ); 
        +toolBar.Add( prevButton );
        +// Set the button text
        +Property::Map labelMap;
        +labelMap["text"] = "Prev";
        +labelMap["textColor"] = Color::BLACK;
        +prevButton.SetProperty( Button::Property::LABEL, labelMap );
        +// Add a title to the center of the toolbar
        +TextLabel title = TextLabel::New( "Gallery" );
        +title.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +title.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +title.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
        +title.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
        +title.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
        +// Take all the available space left apart from the 2 buttons
        +title.SetProperty( FlexContainer::ChildProperty::FLEX, 1.0f ); 
        +// Set 10 pixel margin around the title
        +title.SetProperty( FlexContainer::ChildProperty::FLEX_MARGIN, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) ); 
        +toolBar.Add( title );
        +// Add a button to the right of the toolbar
        +PushButton nextButton = PushButton::New();
        +nextButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +nextButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +// Minimum size the button must keep
        +nextButton.SetMinimumSize( Vector2( 100.0f, 60.0f ) ); 
        +// Set 10 pixel margin around the button
        +nextButton.SetProperty( FlexContainer::ChildProperty::FLEX_MARGIN, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) ); 
        +toolBar.Add( nextButton );
        +// Set the button text
        +labelMap["text"] = "Next";
        +nextButton.SetProperty( Button::Property::LABEL, labelMap );
        +
        + +

        The above settings are very convenient when running the application on different size devices or when changing the screen orientation, because the toolbar expands or shrinks based on the available space and the title is always at the center, keeping the layout of the toolbar the same.

        +
      12. + +
      13. Add the image to the content area: + +
        +// Add an image to the center of the content area
        +ImageView imageView = ImageView::New( "image.jpg" );
        +imageView.SetParentOrigin( ParentOrigin::TOP_LEFT );
        +imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
        +content.Add( imageView ); 
        +
        +
      14. +
      + + +

      Modifying FlexContainer Properties

      + +

      You can modify the flex container appearance and behavior through the following properties:

      + +
        +
      • CONTENT_DIRECTION + +

        This property specifies the primary direction in which content is ordered on a line.

        + +

        Figure: CONTENT_DIRECTION LTR

        +

        CONTENT_DIRECTION LTR

        + +

        Figure: CONTENT_DIRECTION RTL

        +

        CONTENT_DIRECTION RTL

        + + + + + + + + + + + + + + + + + + + + + +
        Table: CONTENT_DIRECTION values
        Property valueDescription
        INHERITInherits the parent's direction
        LTRFrom left to right
        RTLFrom right to left
        +
      • +
      • FLEX_DIRECTION + +

        This property specifies the direction of the main axis, which determines the direction in which the flex items are laid out.

        + +

        Figure: FLEX_DIRECTION

        +

        FLEX_DIRECTION

        + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: FLEX_DIRECTION values
        Property valueDescription
        COLUMNFlex items are laid out vertically as a column
        COLUMN_REVERSEFlex items are laid out vertically as a column, but in a reverse order
        ROWFlex items are laid out horizontally as a row
        ROW_REVERSEFlex items are laid out horizontally as a row, but in a reverse order
        +
      • +
      • FLEX_WRAP + +

        This property specifies whether the flex items must wrap if there is not enough room for them on 1 flex line.

        + +

        Figure: FLEX_WRAP

        +

        FLEX_WRAP

        + + + + + + + + + + + + + + + + + +
        Table: FLEX_WRAP values
        Property valueDescription
        NO_WRAPFlex items laid out in a single line (shrunk to fit the flex container along the main axis)
        WRAPFlex items laid out in multiple lines, if needed
        +
      • +
      • JUSTIFY_CONTENT + +

        This property specifies the alignment of flex items when they do not use all available space on the main axis.

        + +

        Figure: JUSTIFY_CONTENT

        +

        JUSTIFY_CONTENT

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: JUSTIFY_CONTENT values
        Property valueDescription
        JUSTIFY_FLEX_STARTItems are positioned at the beginning of the container
        JUSTIFY_CENTERItems are positioned at the center of the container
        JUSTIFY_FLEX_ENDItems are positioned at the end of the container
        JUSTIFY_SPACE_BETWEENItems are positioned with equal space between the lines
        JUSTIFY_SPACE_AROUNDItems are positioned with equal space before, between, and after the lines
        +
      • + +
      • ALIGN_ITEMS + +

        This property specifies the alignment of flex items when they do not use all available space on the cross axis.

        + +

        Figure: ALIGN_ITEMS

        +

        ALIGN_ITEMS

        + + + + + + + + + + + + + + + + + + + + + + + + + +
        Table: ALIGN_ITEMS values
        Property valueDescription
        ALIGN_FLEX_STARTItems are aligned at the beginning of the container
        ALIGN_CENTERItems are aligned at the center of the container
        ALIGN_FLEX_ENDItems are aligned at the end of the container
        ALIGN_STRETCHItems are stretched to fit the container
        +
      • +
      • ALIGN_CONTENT + +

        This property specifies the alignment of flex lines when they do not use all available space on the cross axis, so only works when there are multiple lines.

        + +

        Figure: ALIGN_CONTENT

        +

        ALIGN_CONTENT

        + + + + + + + + + + + + + + + + + + + + + +
        Table: ALIGN_CONTENT values
        Property valueDescription
        ALIGN_FLEX_STARTItems are aligned at the beginning of the container
        ALIGN_CENTERItems are aligned at the center of the container
        ALIGN_FLEX_ENDItems are aligned at the end of the container
        +
      • +
      + +

      Modifying FlexItem Properties

      + +

      The flex item properties are non-animatable properties registered dynamically to each child that is to be added to the flex container, and once added, their values cannot be changed. When an actor is added to the flex container, these properties are checked to decide how to lay out the actor inside the flex container.

      + +
        +
      • FLEX + +

        By default, the items in the flex container are not flexible. If set, this property makes the item flexible, which means the item can alter its width and height in order to receive the specified proportion of the free space in the flex container. If all items in the flex container use this pattern, their sizes are proportional to the specified flex factor. Flex items do not shrink below their minimum size (if set using the Dali::Actor::SetMinimumSize() function).

        + +

        Figure: FLEX

        +

        FLEX

        + +

        The following example shows how the items achieve the proportion of free space as illustrated in the above figure:

        + +
        +// Create the flex container
        +FlexContainer flexContainer = FlexContainer::New();
        +// Set the flex direction to lay out the items horizontally
        +flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
        +
        +// Create flex items and set the proportion
        +Control item1 = Control::New();
        +item1.SetProperty( FlexContainer::ChildProperty::FLEX, 1.0f );
        +flexContainer.Add( item1 );
        +Control item2 = Control::New();
        +item2.SetProperty( FlexContainer::ChildProperty::FLEX, 3.0f );
        +flexContainer.Add( item2 );
        +Control item3 = Control::New();
        +item3.SetProperty( FlexContainer::ChildProperty::FLEX, 1.0f );
        +flexContainer.Add( item3 );
        +Control item4 = Control::New();
        +item4.SetProperty( FlexContainer::ChildProperty::FLEX, 2.0f );
        +flexContainer.Add( item4 );
        +Control item5 = Control::New();
        +item5.SetProperty( FlexContainer::ChildProperty::FLEX, 1.0f );
        +flexContainer.Add( item5 );
        +
        +
      • +
      • ALIGN_SELF + +

        This property specifies how the item aligns along the cross axis. If set, this property overrides the default alignment for all items defined by the container's ALIGN_ITEMS property.

        +

        Figure: ALIGN_SELF

        +

        ALIGN_SELF

        + +

        The following example shows how the items achieve the alignment on the cross axis as illustrated in the above figure:

        + +
        +// Create the flex container
        +FlexContainer flexContainer = FlexContainer::New();
        +// Set the flex direction to lay out the items horizontally
        +flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
        +// Set the items to be aligned at the beginning of the container on the cross axis by default 
        +flexContainer.SetProperty( FlexContainer::Property::ALIGN_ITEMS, FlexContainer::ALIGN_FLEX_START );
        +
        +// Create flex items and add them to the flex container
        +Control item1 = Control::New();
        +// Align item1 at the center of the container
        +item1.SetProperty( FlexContainer::ChildProperty::ALIGN_SELF, FlexContainer::ALIGN_CENTER );
        +flexContainer.Add( item1 );
        +Control item2 = Control::New();
        +// item2 is aligned at the beginning of the container
        +flexContainer.Add( item2 );
        +Control item3 = Control::New();
        +// Align item3 at the bottom of the container
        +item3.SetProperty( FlexContainer::ChildProperty::ALIGN_SELF, FlexContainer::ALIGN_FLEX_END );
        +flexContainer.Add( item3 );
        +Control item4 = Control::New();
        +// item4 is aligned at the beginning of the container
        +flexContainer.Add( item4 ); 
        +
        +
      • +
      • FLEX_MARGIN + +

        Each flex item inside the flex container is treated as a box (in CSS term) that is made up of:

        + +
          +
        • Content: The content of the item +
        • +
        • Padding: The space around the content (inside the border) of the item +
        • +
        • Border: The border that goes around the padding and the content of the item +
        • +
        • Flex margin: The space outside the border +
        • +
        +

        Figure: FLEX_MARGIN

        +

        FLEX_MARGIN

        + +

        In DALi, the size of the flex item = content size + padding + border. The flex margin specifies the space around the flex item.

        + +

        The following example shows how to add some space around the items.

        + +
        +// Create the flex container
        +FlexContainer flexContainer = FlexContainer::New();
        +// Create flex item
        +Control item = Control::New();
        +// Add the margin around the item
        +item.SetProperty( FlexContainer::ChildProperty::FLEX_MARGIN, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
        +// Add the item to the container
        +flexContainer.Add( item );
        +
        +
      • +
      + + + + +
      + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/handle_n.htm b/org.tizen.guides/html/native/ui/dali/handle_n.htm index 3ea1406..207f50c 100644 --- a/org.tizen.guides/html/native/ui/dali/handle_n.htm +++ b/org.tizen.guides/html/native/ui/dali/handle_n.htm @@ -18,16 +18,18 @@
      -

      Mobile native

      +

      Mobile native Wearable native

      Dependencies

      • Tizen 2.4 and Higher for Mobile
      • +
      • Tizen 3.0 and Higher for Wearable

      Related Info

      @@ -37,7 +39,7 @@

      DALi widely adopts the handle/body pattern (also known as the pimpl pattern), which separates the implementation details (body class) from its interface (handle class).

      -

      The Dali::BaseHandle is a base class for handle classes in DALi. It additionally provides smart-pointer semantics, which manage internal objects with reference counts. Most of the classes in the DALi public API are handle classes, which means they inherit from the Dali::BaseHandle class.

      +

      The Dali::BaseHandle class (in mobile and wearable applications) is a base class for handle classes in DALi. It additionally provides smart-pointer semantics, which manage internal objects with reference counts. Most of the classes in the DALi public API are handle classes, which means they inherit from the Dali::BaseHandle class.

      The handle/body pattern structure is beneficial for both DALi users and developers:

        diff --git a/org.tizen.guides/html/native/ui/dali/imageview_n.htm b/org.tizen.guides/html/native/ui/dali/imageview_n.htm index 0017e67..77bc90e 100644 --- a/org.tizen.guides/html/native/ui/dali/imageview_n.htm +++ b/org.tizen.guides/html/native/ui/dali/imageview_n.htm @@ -18,12 +18,13 @@
        -

        Mobile native

        +

        Mobile native Wearable native

        diff --git a/org.tizen.guides/html/native/ui/dali/itemview_n.htm b/org.tizen.guides/html/native/ui/dali/itemview_n.htm index 27839b3..481f3f8 100644 --- a/org.tizen.guides/html/native/ui/dali/itemview_n.htm +++ b/org.tizen.guides/html/native/ui/dali/itemview_n.htm @@ -18,12 +18,13 @@
        -

        Mobile native

        +

        Mobile native Wearable native

        diff --git a/org.tizen.guides/html/native/ui/dali/layout_n.htm b/org.tizen.guides/html/native/ui/dali/layout_n.htm index 4a526d1..fe1b37d 100644 --- a/org.tizen.guides/html/native/ui/dali/layout_n.htm +++ b/org.tizen.guides/html/native/ui/dali/layout_n.htm @@ -18,12 +18,13 @@
        -

        Mobile native

        +

        Mobile native Wearable native

        Dependencies

        • Tizen 2.4 and Higher for Mobile
        • +
        • Tizen 3.0 and Higher for Wearable

        Content

        @@ -44,7 +46,7 @@

        DALi provides rule-based layout management (size negotiation), which is used to allocate the actor sizes on the stage based on the dependency rules between the actors.

        Dimensions

        -

        The notion of width and height is generalized into a concept of a dimension. Several functions take the Dimension parameter. The Dali::Dimension::Type enum specifies the available dimensions as bit fields:

        +

        The notion of width and height is generalized into a concept of a dimension. Several functions take the Dimension parameter. The Dali::Dimension::Type enum (in mobile and wearable applications) specifies the available dimensions as bit fields:

        • Dimension::WIDTH
        • Dimension::HEIGHT
        • @@ -53,7 +55,7 @@

          Resize Policies

          -

          The Dali::ResizePolicy::Type enum specifies a range of options for controlling the way actors resize. These rules enable automatic resizing.

          +

          The Dali::ResizePolicy::Type enum (in mobile and wearable applications) specifies a range of options for controlling the way actors resize. These rules enable automatic resizing.

          - + @@ -83,14 +85,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
          @@ -137,7 +139,7 @@ control.Add( imageView );

          Adjusting the Negotiated Size

          -

          When an actor must maintain the aspect ratio of its natural size, use the SetSizeScalePolicy() function with the Dali::SizeScalePolicy::Type enum. This is useful to ensure that images maintain their aspect ratio while still fitting the bounds they have been allocated.

          +

          When an actor must maintain the aspect ratio of its natural size, use the SetSizeScalePolicy() function with the Dali::SizeScalePolicy::Type enum (in mobile and wearable applications). This is useful to ensure that images maintain their aspect ratio while still fitting the bounds they have been allocated.

          You can use the following resize policies:

          • SizeScalePolicy::USE_SIZE_SET diff --git a/org.tizen.guides/html/native/ui/dali/model3dview_n.htm b/org.tizen.guides/html/native/ui/dali/model3dview_n.htm new file mode 100644 index 0000000..ad18cd1 --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/model3dview_n.htm @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + Model3dView + + + + +
            +
            +

            Mobile native Wearable native

            +
            +
            +

            Dependencies

            +
              +
            • Tizen 3.0 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable
            • +
            +

            Content

            + +

            Related Info

            + +
            +
            + +
            +

            Model3dView

            + +

            The Dali::Toolkit::Model3dView is a control for displaying static 3D content. It is capable of reading .obj and .mtl files, and up to 3 textures, with a single light and 3 simple illumination types.

            + +

            The OBJ or .obj (object) file is a geometry definition file format and the MTL or .mtl (material) file contains one or more material definitions, each of which includes the color, texture, and reflection map of individual materials.

            + +

            The Model3dView control automatically scales the loaded geometry to fit within its size boundary.

            + +

            Creating a Model3dView

            + +

            The following basic example shows how to create a Dali::Toolkit::Model3dView object:

            + +
            +// You must define the path to the geometry and material files, and the images directory
            +Model3dView model3dView = Model3dView::New( MODEL_FILE, MATERIAL_FILE, IMAGE_PATH );
            +model3dView.SetParentOrigin( ParentOrigin::CENTER );
            +model3dView.SetAnchorPoint( AnchorPoint::CENTER );
            +model3dView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
            +Stage::GetCurrent().Add( model3dView );
            +
            + + +

            Modifying Model3dView Properties

            + +

            You can modify the Model3dView appearance and behavior through its properties. To change a property from its default value, use the SetProperty() function.

            + + + + + + + + + + +
            Note
            The resource properties require absolute references as their paths. However, the root resource path for your application can be obtained through the app_get_resource_path() function of the App Common API (in mobile and wearable applications), and relative paths can be appended to that root path. If you want to use relative paths, you must specify them in your build files.
            + +

            The following table lists the available Model3dView properties.

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            Table: Model3dView properties
            PropertyTypeDescriptions
            GEOMETRY_URLStringLocation of the geometry resource (the OBJ file)
            MATERIAL_URLStringLocation of the material resource (the MTL file) to render the object with a material
            IMAGES_URLStringLocation of the images directory
            ILLUMINATION_TYPEIntegerType of illumination
            TEXTURE0_URLStringPath to the first texture (diffuse texture)
            TEXTURE1_URLStringPath to the second texture (normal map)
            TEXTURE2_URLStringPath to the third texture (gloss texture)
            LIGHT_POSITIONVector3Coordinates of the light
            + +

            The MTL material file references the texture files using a relative path. The IMAGES_URL property is used to define the location of the root of this path. The textures are set automatically when the material URL is loaded.

            + +

            Specifying the Illumination Model

            + +

            Illumination models are used to calculate the intensity of light that is reflected at a given point on a surface. The diffuse reflection is the reflection of light from a surface such that an incident ray is reflected at many angles rather than at just one angle as in the case of specular reflection.

            + +

            The following table illustrates the available illumination models.

            + + + + + + + + + + + + + + + + + + + + + +
            + Table: Available illumination models
            Illumination typeDescription
            DIFFUSERender the model with simple lighting using the actor color
            DIFFUSE_WITH_TEXTURERender the model with specular highlighting on the supplied diffuse and gloss textures
            DIFFUSE_WITH_NORMAL_MAPRender the model with specular highlighting with the supplied diffuse, gloss, and normal map textures
            + + +

            Each of the illumination models takes account of the light position, which can be specified using the Model3dView::Property::LIGHT_POSITION property. To position the light in front of the 3D model, give it a positive Z value.

            + +

            The following figure illustrates the illumination models: DIFFUSE (top left), DIFFUSE_WITH_TEXTURE (top right), and DIFFUSE_WITH_NORMAL_MAP (bottom).

            + +

            Figure: Illumination models

            +

            DIFFUSE model DIFFUSE_WITH_TEXTURE model

            +

            DIFFUSE_WITH_NORMAL_MAP model

            + + + +
            + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/multi_threaded_n.htm b/org.tizen.guides/html/native/ui/dali/multi_threaded_n.htm index e856428..5357642 100644 --- a/org.tizen.guides/html/native/ui/dali/multi_threaded_n.htm +++ b/org.tizen.guides/html/native/ui/dali/multi_threaded_n.htm @@ -18,12 +18,13 @@
            -

            Mobile native

            +

            Mobile native Wearable native

            Dependencies

            • Tizen 2.4 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable

            Content

            diff --git a/org.tizen.guides/html/native/ui/dali/properties_n.htm b/org.tizen.guides/html/native/ui/dali/properties_n.htm index 97d0169..89fbdc9 100644 --- a/org.tizen.guides/html/native/ui/dali/properties_n.htm +++ b/org.tizen.guides/html/native/ui/dali/properties_n.htm @@ -18,12 +18,13 @@
            -

            Mobile native

            +

            Mobile native Wearable native

            Dependencies

            • Tizen 2.4 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable

            Content

            @@ -46,13 +49,13 @@

            The difference between properties and ordinary C++ member variables is that a property can be dynamically added to or removed from an existing object at runtime, enabling more flexible, script-like programming with DALi.

            -

            The Dali::Handle class provides functions to manage properties. Because of this, the DALi classes that inherit from the Dali::Handle class (most of classes that you use) have a number of predefined properties and can have any number of user-defined custom properties. +

            The Dali::Handle class (in mobile and wearable applications) provides functions to manage properties. Because of this, the DALi classes that inherit from the Dali::Handle class (most of classes that you use) have a number of predefined properties and can have any number of user-defined custom properties.

            Accessing Property Values

            Property values of an object can usually be accessed in 2 ways: by its class member functions or by property getters and setters (GetProperty() and SetProperty() function of the Dali::Handle class).

            -

            For example, the following table lists the predefined properties of the Dali::Actor class.

            +

            For example, the following table lists the predefined properties of the Dali::Actor class (in mobile and wearable applications).

            @@ -145,7 +148,7 @@ bool OnButtonClicked( Toolkit::Button button )

            Animating Objects

            -

            The Dali::Animation class is used to animate the properties of any number of objects.

            +

            The Dali::Animation class (in mobile and wearable applications) is used to animate the properties of any number of objects.

            For example, the following code animates the value of the POSITION property of a radio button to (100.0, 200.0, 0.0) for 2 seconds:

            @@ -159,7 +162,7 @@ animation.Play();

            Imposing Constraints on Objects

            -

            The Dali::Constraint class is used to modify the property of an object based on other properties of other objects.

            +

            The Dali::Constraint class (in mobile and wearable applications) is used to modify the property of an object based on other properties of other objects.

            For example, the following code makes the SIZE property value of an actor the same as the SIZE property value of its parent actor:

            @@ -228,7 +231,7 @@ constraint.Apply();
            -

            For more information about properties, see the API reference of each class. For example, for the Dali::Actor class, see the Dali::Actor::Property struct. For information on the supported property types, see Dali::Property::Type and Dali::PropertyTypes.

            +

            For more information about properties, see the API reference of each class. For example, for the Dali::Actor class, see the Dali::Actor::Property struct (in mobile and wearable applications). For information on the supported property types, see Dali::Property::Type (in mobile and wearable applications) and Dali::PropertyTypes (in mobile and wearable applications).

            diff --git a/org.tizen.guides/html/native/ui/dali/rendering_effects_n.htm b/org.tizen.guides/html/native/ui/dali/rendering_effects_n.htm index 4798235..2ead759 100644 --- a/org.tizen.guides/html/native/ui/dali/rendering_effects_n.htm +++ b/org.tizen.guides/html/native/ui/dali/rendering_effects_n.htm @@ -18,12 +18,13 @@
            -

            Mobile native

            +

            Mobile native Wearable native

            Dependencies

            • Tizen 2.4 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable

            Content

            @@ -63,6 +65,8 @@

            With the Google cardboard viewer or a similar device, you can transform your phone into a basic virtual reality headset.

            +

            For more information about DALi rendering and practical examples of rendering shapes and SVG graphics, see Shape Drawing and SVG Rendering.

            +

            Stereoscopic Rendering in DALi

            The STEREO_HORIZONTAL mode presents the left image on the top half of the screen and the right image on the bottom half. It is intended to be used in landscape orientation, so the images are rotated 90 degrees counter-clockwise. The STEREO_VERTICAL mode, on the other hand, renders the left image on the left half of the screen and the right image on the right half.

            diff --git a/org.tizen.guides/html/native/ui/dali/rendering_tutorial_n.htm b/org.tizen.guides/html/native/ui/dali/rendering_tutorial_n.htm new file mode 100644 index 0000000..6d156ee --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/rendering_tutorial_n.htm @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + Shape Drawing + + + + + + +
            +

            Shape Drawing

            + +

            DALi offers a low-level rendering API. Do not use it for building user interfaces - DALi UI controls must be used instead. For example, if you need to display an icon, you can do it using the rendering API, but it requires a lot more effort than simply creating an ImageView UI control.

            + +

            This topic shows how to use the rendering API through examples that draw a line, triangle, and cube.

            + +

            Drawing a Line

            + +

            To draw a line with the renderer API:

            + +
              +
            1. Create the shader source code: +
                +
              1. You must create a shader suitable for drawing lines. The vector (x,y) position for each point on the line is passed using the aPosition attribute. The vertex shader transforms this to match the size and position of an actor. + +
                +const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
                +  attribute mediump vec2 aPosition;
                +  uniform mediump mat4 uMvpMatrix;
                +  uniform mediump vec3 uSize;
                +  void main()
                +  {
                +    mediump vec4 vertexPosition = vec4( aPosition, 0.0, 1.0 );
                +    vertexPosition.xyz *= uSize;
                +    gl_Position = uMvpMatrix * vertexPosition;
                +  }
                +);
                +
                +
              2. +
              3. The fragment shader applies the actor's color: + +
                +const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
                +  uniform lowp vec4 uColor;
                +  void main()
                +  {
                +    gl_FragColor = uColor;
                +  }
                +);
                +
                +
              +
            2. +
            3. Create geometry. + +

              Specify a vertex format matching the shader attributes: the format is specified using a list of string/value pairs in a Property::Map. The vertex format and data (in this case 2 points) are stored in a PropertyBuffer. Finally, a LINES-type Geometry object is created.

              + +
              +Property::Map vertexFormat;
              +vertexFormat["aPosition"] = Property::VECTOR2;
              +PropertyBuffer vertices = PropertyBuffer::New( vertexFormat );
              +
              +struct Vertex { Vector2 position1; };
              +Vertex vertexData[2] =
              +{
              +  { Vector2(  0.5f, 0.5f) },
              +  { Vector2( -0.5f, -0.5f) }
              +};
              +const unsigned short INDEX_LINES[] = { 0, 1 };
              +vertices.SetData( vertexData, 2 );
              +
              +Geometry geometry = Geometry::New();
              +geometry.AddVertexBuffer( vertices );
              +geometry.SetIndexBuffer( &INDEX_LINES[0], sizeof(INDEX_LINES)/sizeof(INDEX_LINES[0]) );
              +geometry.SetType( Geometry::LINES );
              +
              +
            4. +
            5. Create a renderer. + +

              You can create a renderer with the shader source and geometry. In order to position the renderer on-screen, it must be added to an actor which must be placed on the stage.

              + +
              +Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
              +Renderer renderer = Renderer::New( geometry, shader );
              +
              +Stage stage = Stage::GetCurrent();
              +stage.SetBackgroundColor( Color::WHITE );
              +
              +Actor actor = Actor::New();
              +actor.SetSize( stage.GetSize() );
              +actor.SetParentOrigin( ParentOrigin::CENTER );
              +actor.SetAnchorPoint( AnchorPoint::CENTER );
              +actor.SetColor( Color::BLACK );
              +actor.AddRenderer( renderer );
              +stage.Add( actor );
              +
              + +

              In this example, the line is rendered from one corner of the screen to the other.

              +

              Line

              +
            6. +
            + +

            Drawing a Triangle

            + +

            To draw a triangle, use the same shader and renderer set-up as in the previous "Drawing a Line" example, and simply modify the geometry to draw the triangle:

            + +
            +Vertex vertexData[3] =
            +{
            +  { Vector2(  0.45f, 0.45f) },
            +  { Vector2( -0.45f, 0.45f) },
            +  { Vector2(  0.0f, -0.45f) }
            +};
            +const unsigned short INDEX_TRIANGLES[] = { 0, 1, 2 };
            +vertices.SetData( vertexData, 3 );
            +
            +Geometry geometry = Geometry::New();
            +geometry.AddVertexBuffer( vertices );
            +geometry.SetIndexBuffer( &INDEX_TRIANGLES[0], sizeof(INDEX_TRIANGLES)/sizeof(INDEX_TRIANGLES[0]) );
            +geometry.SetType( Geometry::TRIANGLES );
            +
            + +

            You can also call the Actor::SetColor(Color::RED) function to get a more colorful end result, as shown in the following figure.

            + +

            Figure: Triangle

            +

            Triangle

            + +

            Drawing a Cube

            + +

            To draw a colored cube, you need a slightly more complicated shader and geometry format:

            + +
              +
            1. Create the shader source code: +
                +
              1. The aPosition attribute must be changed to vec3, since the cube has 3 dimensions: + +
                +const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
                +  attribute mediump vec3 aPosition;
                +  attribute mediump vec3 aColor;
                +  uniform mediump mat4 uMvpMatrix;
                +  uniform mediump vec3 uSize;
                +  varying mediump vec4 vColor;
                +  void main()
                +  {
                +    mediump vec4 vertexPosition = vec4( aPosition, 1.0 );
                +    vertexPosition.xyz *= uSize;
                +    gl_Position = uMvpMatrix * vertexPosition;
                +    vColor = vec4( aColor, 1.0 );
                +  }
                +);
                +
                +
              2. +
              3. Each face of the cube is given a different color using the vColor varying: + +
                +const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
                +  varying mediump vec4 vColor;
                +  void main()
                +  {
                +    gl_FragColor = vColor;
                +  }
                +);
                +
                +
              +
            2. +
            3. Create the cube geometry. + +

              The vertex format is extended to match the shader. Each of the 6 cube faces requires 4 vertices (24 in total). Each vertex consists of a vec3 and RGB color component.

              + +
              +Property::Map vertexFormat;
              +vertexFormat["aPosition"] = Property::VECTOR3;
              +vertexFormat["aColor"]    = Property::VECTOR3;
              +PropertyBuffer vertices = PropertyBuffer::New( vertexFormat );
              +
              +struct Vertex
              +{
              +  Vector3 position;
              +  Vector3 color;
              +};
              +
              +Vertex vertexData[24] =
              +{
              +  { Vector3( -0.5, -0.5,  0.5 ), Vector3( 1.0, 0.0, 0.0 ) },
              +  { Vector3(  0.5, -0.5,  0.5 ), Vector3( 1.0, 0.0, 0.0 ) },
              +  { Vector3( -0.5,  0.5,  0.5 ), Vector3( 1.0, 0.0, 0.0 ) },
              +  { Vector3(  0.5,  0.5,  0.5 ), Vector3( 1.0, 0.0, 0.0 ) },
              +  { Vector3( -0.5, -0.5, -0.5 ), Vector3( 0.0, 1.0, 0.0 ) },
              +  { Vector3(  0.5, -0.5, -0.5 ), Vector3( 0.0, 1.0, 0.0 ) },
              +  { Vector3( -0.5,  0.5, -0.5 ), Vector3( 0.0, 1.0, 0.0 ) },
              +  { Vector3(  0.5,  0.5, -0.5 ), Vector3( 0.0, 1.0, 0.0 ) },
              +  { Vector3( -0.5, -0.5, -0.5 ), Vector3( 0.0, 0.0, 1.0 ) },
              +  { Vector3(  0.5, -0.5, -0.5 ), Vector3( 0.0, 0.0, 1.0 ) },
              +  { Vector3( -0.5, -0.5,  0.5 ), Vector3( 0.0, 0.0, 1.0 ) },
              +  { Vector3(  0.5, -0.5,  0.5 ), Vector3( 0.0, 0.0, 1.0 ) },
              +  { Vector3( -0.5,  0.5, -0.5 ), Vector3( 1.0, 1.0, 0.0 ) },
              +  { Vector3(  0.5,  0.5, -0.5 ), Vector3( 1.0, 1.0, 0.0 ) },
              +  { Vector3( -0.5,  0.5,  0.5 ), Vector3( 1.0, 1.0, 0.0 ) },
              +  { Vector3(  0.5,  0.5,  0.5 ), Vector3( 1.0, 1.0, 0.0 ) },
              +  { Vector3( -0.5, -0.5, -0.5 ), Vector3( 1.0, 0.0, 1.0 ) },
              +  { Vector3( -0.5,  0.5, -0.5 ), Vector3( 1.0, 0.0, 1.0 ) },
              +  { Vector3( -0.5, -0.5,  0.5 ), Vector3( 1.0, 0.0, 1.0 ) },
              +  { Vector3( -0.5,  0.5,  0.5 ), Vector3( 1.0, 0.0, 1.0 ) },
              +  { Vector3(  0.5, -0.5, -0.5 ), Vector3( 0.0, 1.0, 1.0 ) },
              +  { Vector3(  0.5,  0.5, -0.5 ), Vector3( 0.0, 1.0, 1.0 ) },
              +  { Vector3(  0.5, -0.5,  0.5 ), Vector3( 0.0, 1.0, 1.0 ) },
              +  { Vector3(  0.5,  0.5,  0.5 ), Vector3( 0.0, 1.0, 1.0 ) },
              +};
              +
              +const unsigned short INDEX_CUBE[] = { 0,  2,  3,  0,  3,  1,
              +                                      5,  7,  6,  5,  6,  4,
              +                                      8, 10, 11,  8, 11,  9,
              +                                      14, 12, 13, 14, 13, 15,
              +                                      16, 17, 19, 16, 19, 18,
              +                                      22, 23, 21, 22, 21, 20 };
              +
              +vertices.SetData( vertexData, 24 );
              +
              +Geometry geometry = Geometry::New();
              +geometry.AddVertexBuffer( vertices );
              +geometry.SetIndexBuffer( &INDEX_CUBE[0], sizeof(INDEX_CUBE)/sizeof(INDEX_CUBE[0]) );
              +geometry.SetType( Geometry::TRIANGLES );
              +
              +
            4. +
            5. Create a renderer. + +

              There is no SetColor() function needed for the actor, since you are not using the uColor uniform. Face culling is enabled to hide the backward facing sides of the cube.

              + +
              +Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
              +Renderer renderer = Renderer::New( geometry, shader );
              +renderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
              +
              +Actor actor = Actor::New();
              +float length = stage.GetSize().width * 0.5f;
              +actor.SetSize( length, length, length );
              +actor.SetParentOrigin( ParentOrigin::CENTER );
              +actor.AddRenderer( renderer );
              +stage.Add( actor );
              +
              +mAnimation = Animation::New( 10.0f );
              +mAnimation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 180 ) ), Vector3::ZAXIS ) );
              +mAnimation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 180 ) ), Vector3::YAXIS ) );
              +mAnimation.Play();
              +
              + +

              The following figure shows the running animation.

              +

              Cube

              +
            + + + +
            + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/resources_n.htm b/org.tizen.guides/html/native/ui/dali/resources_n.htm index 84cb8a8..ea02ac9 100644 --- a/org.tizen.guides/html/native/ui/dali/resources_n.htm +++ b/org.tizen.guides/html/native/ui/dali/resources_n.htm @@ -18,12 +18,13 @@
            -

            Mobile native

            +

            Mobile native Wearable native

            Dependencies

            • Tizen 2.4 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable

            Content

            @@ -122,7 +125,7 @@ class ResourceImageController : public ConnectionTracker

            Load Time Resizing

            -

            An application loading images from an external source often wants to display those images at a lower resolution than their native ones. To support this, DALi can resize an image at load time so that its in-memory copy uses less space and its visual quality benefits from being prefiltered. The Dali::FittingMode namespace provides 4 algorithms, which can be used to fit an image to a desired rectangle, a desired width, or a desired height.

            +

            An application loading images from an external source often wants to display those images at a lower resolution than their native ones. To support this, DALi can resize an image at load time so that its in-memory copy uses less space and its visual quality benefits from being prefiltered. The Dali::FittingMode namespace (in mobile and wearable applications) provides 4 algorithms, which can be used to fit an image to a desired rectangle, a desired width, or a desired height.

            The following code snippet is an example of rescaling:

            @@ -175,7 +178,7 @@ Dali::ImageDimensions dimensions = Dali::ResourceImage::GetImageSize( "/my-

            Using a Buffer Image

            -

            A DALi::BufferImage class represents an image resource in the form of pixel buffer data. The application can write to this buffer as required and the image is updated on the screen:

            +

            A Dali::BufferImage class (in mobile and wearable applications) represents an image resource in the form of pixel buffer data. The application can write to this buffer as required and the image is updated on the screen:

             // Create a 200 by 200 pixel buffer with a color-depth of 32-bits (with alpha)
            diff --git a/org.tizen.guides/html/native/ui/dali/scrollview_n.htm b/org.tizen.guides/html/native/ui/dali/scrollview_n.htm
            index 56dbdb8..b3a8dcd 100644
            --- a/org.tizen.guides/html/native/ui/dali/scrollview_n.htm
            +++ b/org.tizen.guides/html/native/ui/dali/scrollview_n.htm
            @@ -18,12 +18,13 @@
             
             
            -

            Mobile native

            +

            Mobile native Wearable native

            diff --git a/org.tizen.guides/html/native/ui/dali/slider_n.htm b/org.tizen.guides/html/native/ui/dali/slider_n.htm new file mode 100644 index 0000000..cecf594 --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/slider_n.htm @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + Slider + + + + +
            +
            +

            Mobile native Wearable native

            +
            +
            +

            Dependencies

            +
              +
            • Tizen 3.0 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable
            • +
            +

            Content

            + +

            Related Info

            + +
            +
            + +
            +

            Slider

            + +

            The slider is a control used to indicate a value within a specific range. The user can drag a handle left or right to set the current value between a specified minimum and maximum. The base class for the slider control is Dali::Toolkit::Slider.

            + +

            Figure: Slider

            +

            Slider

            + +

            The slider has 2 important elements:

            + +
              +
            • The handle is the indicator sliding within the range +

              You can draw the handle using the HANDLE_VISUAL property.

            • +
            • The track is the bar along which the handle moves. +

              The slider draws the track using 2 distinct images. The region between the start of the track and the handle is the progress region, and you can draw it using the PROGRESS_VISUAL property. The region between the handle and the end of the track is drawn using the TRACK_VISUAL property.

            • +
            + +

            The following table lists the basic signals provided by the Dali::Toolkit::Slider class.

            + + + + + + + + + + + + + + + + + + + + + +
            + Table: Dali::Toolkit::Slider input signals
            Input signalDescription
            ValueChangedSignal()Emitted when the slider value changes.
            SlidingFinishedSignal()Emitted when the sliding is finished.
            MarkReachedSignal()Emitted when the slider handle reaches a mark.
            + +

            Creating a Slider

            + +

            The following basic example shows how to create a Dali::Toolkit::Slider object:

            + +
            +Slider slider = Slider::New();
            +slider.SetSize( mStageWidth, mStageHeight * 0.2 );
            +slider.SetAnchorPoint( AnchorPoint::TOP_LEFT );
            +slider.SetPosition( 0.0f, mStageHeight * 0.1 );
            +Stage::GetCurrent().Add( slider );
            +
            + +

            Modifying Slider Properties

            + +

            You can modify the slider appearance and behavior through its properties.

            + +

            To change a property from its default value, use the SetProperty() function:

            + +
            +// To set the basic values, use SetProperty()
            +slider.SetProperty( Slider::Property::LOWER_BOUND, 0.0f );
            +slider.SetProperty( Slider::Property::UPPER_BOUND, 3.0f );
            +slider.SetProperty( Slider::Property::VALUE, 0.5f );
            +slider.SetProperty( Slider::Property::SHOW_POPUP, true );
            +
            + +

            The following table lists the available slider properties.

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            + Table: Slider properties
            PropertyTypeDescription
            LOWER_BOUNDFloatMinimum value of the track
            UPPER_BOUNDFloatMaximum value of the track
            VALUEFloatInitial value of the slider
            TRACK_VISUALProperty::MapAppearance of the track between the handle and the end of the track
            HANDLE_VISUALProperty::MapAppearance of the handle
            PROGRESS_VISUALProperty::MapAppearance of the progress region of the track
            POPUP_VISUALProperty::MapAppearance of the slider pop-up
            POPUP_ARROW_VISUALProperty::MapAppearance of the pop-up arrow
            DISABLED_COLORVector4Color when the slider is disabled
            VALUE_PRECISIONIntegerPrecision of the floating point of the value
            SHOW_POPUPBoolWhether the slider shows pop-up
            SHOW_VALUEBoolWhether the slider shows the value
            MARKSProperty::ArrayArray of the marks
            SNAP_TO_MARKSBoolWhether the handle snaps to the marks
            MARK_TOLERANCEFloatPercentage of the slider width for which snapping to the marks occur
            + +

            Customizing the Slider Appearance

            + +

            The slider provides a set of default images, which are used automatically if you do not specify anything else.

            +

            If you want to customize the slider appearance, you can assign your own images using the Property::Map class. You can set the size and image of the track, handle, progress region, popup, and popup arrow.

            + +

            The following example shows how to customize the handle:

            + +
            +// Customize the slider handle
            +Property::Map handleVisual;
            +handleVisual["size"] = Vector2( 120.0f, 120.0f ); // Set the handle size
            +handleVisual["url"] = mImageDirectory + "handle_img.png"; // Set the handle image
            +slider.SetProperty( Slider::Property::HANDLE_VISUAL, handleVisual );
            +
            + + + +
            + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/styling_n.htm b/org.tizen.guides/html/native/ui/dali/styling_n.htm new file mode 100644 index 0000000..6416d4f --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/styling_n.htm @@ -0,0 +1,405 @@ + + + + + + + + + + + + + + Styling UI Components + + + + +
            +
            +

            Mobile native Wearable native

            +
            +
            +

            Dependencies

            +
              +
            • Tizen 3.0 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable
            • +
            +

            Content

            + +

            Related Info

            + +
            +
            + +
            +

            Styling UI Components

            + +

            You can style DALi UI components with a theme bundle or a folder containing a JSON style file and resources. Styling allows you to modify the look of your application. You can alter the images, colors, and other properties specifying the look of each control type. You can also change the visuals of a control, for example, instead of a background image, you can use a fill color or gradient instead.

            + +

            You can specify how each application component looks by using a stylesheet with the JSON file format:

            + +
              +
            • Application-specific resources must be installed into a particular directory, and you can access them in the stylesheet indirectly through the APPLICATION_RESOURCE_PATH constant, which has the value returned by the app_get_resource_path() function. For more information on the resource directory, see the app_get_resource_path() function in the App Common API (in mobile and wearable applications). +
            • +
            • You can style particular controls or sub-groups of controls by specifying their style name programmatically.
            • +
            • Styles can be inherited and tweaked, so you can create minor updates to existing styles with very little code.
            • +
            • The platform can change the default system font family and logical size. This is handled by the default stylesheets, but it is possible to override this behavior in your own stylesheets. You can also listen to the style manager's StyleChangedSignal() in order to determine when the platform style has changed.
            • +
            + +

            Stylesheet Loading

            + +

            The stylesheet is usually supplied at the application start-up or through the Dali::Toolkit::StyleManager API:

            + +
              +
            • At the start-up, use the Dali::Application::New() function: +
              +int main( int argc, char** argv )
              +{
              +  Application application = Application::New( &argc, &argv, "stylesheet.json" );
              +  {
              +    Demo::StylingApplication stylingApplication( application );
              +    application.MainLoop();
              +  }
              +
              +  return 0;
              +}
              +
              +
            • +
            • During runtime, use the Dali::Toolkit::StyleManager::ApplyTheme() function: +
              +StyleManager::Get().ApplyTheme( "stylesheet.json" );
              +
              +
            + +

            When the stylesheet is loaded, it is automatically merged with the default DALi toolkit stylesheet, and applied to each Control instance.

            + +

            Stylesheet Format

            + +

            A style sheet has several top level sections, which are named JSON objects. The following table lists the available sections.

            + + + + + + + + + + + + + + + + + + + + + + + + + +
            Table: Stylesheet sections
            SectionDescription
            constantsAn object containing a map of tokens that are replaced in JSON value strings.
            includesAn array of filenames to include and merge.
            mappingsAn object containing a map of keys to property maps. These maps replace the key as a value when converting to DALi properties.
            stylesAn object containing a map of style names to property maps. These property maps contain key-value pairs with the key matching a DALi property name for the object being styled, and the value is an appropriate type for that property.
            + +

            Constants Section

            + +

            The constants section contains string constants that can be used by any string value in the current stylesheet or included stylesheets. The following table lists the predefined constants.

            + + + + + + + + + + + + + + + + + +
            Table: Predefined constants
            ConstantDescription
            APPLICATION_RESOURCE_PATHThis points to the application-specific resource path returned by the app_get_resource_path() function.
            PACKAGE_PATHThis points to the DALi toolkit resource path.
            + +

            Constants can also be set programmatically by using the StyleManager::SetStyleConstant() function. However, the function only works after the Application::New() function has been called, so it does not affect stylesheets loaded in the Application::New() function.

            + +

            The constants can be used in any string value in the JSON files, delimited by '{' and '}' characters. In the following example, the IMAGE_DIR constant is defined within the stylesheet, and is used to access the unselectedStateImage image path in the Dali::Toolkit::PushButton control:

            + +
            +{
            +  "constants": {
            +    IMAGE_DIR="{APPLICATION_RESOURCE_PATH}/images"
            +  },
            +
            +  "styles": {
            +    "PushButton": {
            +      "unselectedStateImage": "{IMAGE_DIR}/button-up.9.png"
            +    }
            +  }
            +}
            +
            + +

            Includes Section

            + +

            The includes section allows inclusion of other JSON files into the stylesheet. Note that since this section is a JSON array, it is delimited by square brackets ('[' and ']').

            + +

            The content of the included files are merged with the other content of the current stylesheet. If more than one included file supplies values for a particular key-value pair, then the last file has the highest priority.

            + +

            In the following example, the include/first-include.json and include/second-include.json files are loaded. These include files can also include other files, and use constants defined in this top-level stylesheet.

            + +
            +{
            +  "constants": {
            +    "INCLUDE_DIR": "include"
            +  },
            +  "includes":
            +  [
            +    "{INCLUDE_DIR}/first-include.json",
            +    "{INCLUDE_DIR}/second-include.json"
            +  ]
            +}
            +
            + +

            Mappings Section

            + +

            To reduce the number of repeated key-values, you can use the mappings section. It contains an object of key-value pairs, where the value is any valid JSON type (so can also form a tree).

            + +

            If a value in any section is a JSON string delimited by '<' and '>', it is checked against the keys in the mapping section, and the value is replaced by the mapping.

            + +

            In the following example, the confirmation popup's backingColor property value becomes the JSON array representing RGBA values, which is converted internally into a Dali::Vector4 when it is applied to an object:

            + +
            +{
            +  "mappings": {
            +    "backgroundColor": [0.12, 0.0, 0.25, 1.0]
            +  },
            +  "styles": {
            +    "ConfirmationPopup": {
            +      "backingColor": "<backgroundColor>"
            +    }
            +  }
            +}
            +
            + +

            Styles Section

            + +

            The styles section is the main section of the stylesheet. Each key in this JSON object is a style name, which is used to match against control instances in your application:

            + +
              +
            • By default, a Dali::Toolkit::Control class's name is also its style name. For finer control, you can programmatically set a style name for a given control using the Control::SetStyleName() function. In the following example, the slider control handle text label has been given the style name SliderHandleTextLabel. This means that for any instance of the slider, the handle label style can be specified independently of any other label.
            • +
            • For each entry in the styles section, the children of the entry are the property names of the matching control. In the following example, showPopup is the name of a property in the slider. For more information on the properties of a specific control, see its API Reference.
            • +
            • Each control has a background property, which can specify a visual. In addition, properties named visual, such as those in the following example, specify a visual.
            • +
            + +

            The following example switches on the value label of the handle and the popup tooltip, and changes the visuals of the slider control to use the specified 9-patch images with the given sizes. It changes the property of the slider handle text label to alter the color of the text, and changes the background of the slider to show a gradient fill.

            + +
            +{
            +  "styles": {
            +    "Slider": {
            +      "showValue": true,
            +      "showPopup": true,
            +      "trackVisual": {
            +        "url": "{IMAGE_DIR}/slider-skin.9.png",
            +        "size": [27, 27]
            +      },
            +      "progressVisual": {
            +        "url": "{IMAGE_DIR}/slider-skin-progress.9.png",
            +        "size": [27, 27]
            +      },
            +      "handleVisual": {
            +        "url": "{IMAGE_DIR}/slider-skin-handle.png",
            +        "size": [72,72]
            +      },
            +      "background": {
            +        "visualType": "GRADIENT",
            +        "startPosition": [0.0, -0.5],
            +        "endPosition": [0.0, 0.5],
            +        "stopOffset": [0.0, 0.5, 0.75,1.0],
            +        "stopColor": [[0.0,0.0,1.0,1.0], [0.0,0.0,0.75,1.0], [0.0,0.0,0.5,1.0], [1.0,1.0,1.0,0.0]]
            +      }
            +    },
            +    "SliderHandleTextLabel": {
            +      "textColor":[0.8, 0.8, 1.0, 1.0]
            +    }
            +  }
            +}
            +
            + + + + + + + + + + + +
            Before styling:After styling:
            Slider before stylingSlider after styling
            + +

            When styling UI components, consider the following issues:

            + +
              +
            • Setting the font size + +

              Setting an explicit font size for text controls is generally considered to be a bad idea: the Tizen platform offers 5 levels of logical font size that can be set by the user, and the stylesheet can be used on multiple devices with different screen sizes and resolutions.

              + +

              To handle the logical to point size conversion after a settings change, the style manager appends FontSize and the logical value ("0"-"4") to each style name during the update, and uses that style in preference to the control class name or style name if it can find it in the style sheet.

              + +

              This means that you can specify alternative mappings for particular text labels. The following example shows how to map the alternative logical sizes, if you have a text label that has a style name of FolderLabel:

              + +
              +{
              +  "styles": {
              +    "FolderLabelFontSize0": {
              +      "pointSize": 8
              +    },
              +    "FolderLabelFontSize1": {
              +      "pointSize": 10
              +    },
              +    "FolderLabelFontSize2": {
              +      "pointSize": 12
              +    },
              +    "FolderLabelFontSize3": {
              +      "pointSize": 16
              +    },
              +    "FolderLabelFontSize4": {
              +      "pointSize": 20
              +    }
              +  }
              +}
              +
              +
            • +
            • Using style inheritance + +

              It is possible to "inherit" properties from one style into another by specifying the style names in a styles array. More than 1 style can be merged in this way. The inherited styles are first merged in order, and then any properties that follow are merged on top.

              + +

              In the following example, the ColorSlider inherits all of the properties from the slider entry, and changes the background to a gradient:

              + +
              +{
              +  "styles": {
              +    "ColorSlider": {
              +      "styles": ["Slider"], // Inherit from Slider style
              +      "background": {
              +        "visualType": "GRADIENT",
              +        "startPosition": [0.0, -0.5],
              +        "endPosition": [0.0, 0.5],
              +        "stopOffset": [0.0, 0.5, 0.75,1.0],
              +        "stopColor": [[0.0,0.0,1.0,1.0], [0.0,0.0,0.75,1.0], [0.0,0.0,0.5,1.0], [1,1,1,0.09]]
              +      }
              +    }
              +  }
              +}
              +
              +
            • +
            • Applying a style to your own control instances + +

              If you require finer-grained control of styling, for example, for particular labels in your application, you can use an alternative style. Set the style name of these instances after they are created:

              + +
              +TextLabel label = TextLabel::New( myLabelText );
              +label.SetStyleName( "AppLabel" );
              +
              + +

              You can add the alternative style to the application stylesheet as usual:

              + +
              +{
              +  "styles": {
              +    "AppLabel": {
              +      "textColor": [0.8, 0.8, 1.0, 1.0]
              +    }
              +  }
              +}
              +
              +
            • +
            • Using alternative color representations + +

              For style properties that explicitly map to a known DALi property with the Vector4 type, the style system can deduce that the map can also represent a color. In this case, the style system also accepts alternative color representations.

              + + + + + + + + + + +
              Note
              This type deduction does not work in the visual property maps where there is no explicit mapping.
              + +

              The usual representation is a Vector4 with its components mapped to the R, G, B and A components in the range of 0-1:

              + +
              +{
              +  "styles": {
              +    "AppLabel": {
              +      "textColor": [0.49, 0.235, 0.596, 1.0]
              +    }
              +  }
              +}
              +
              + +

              For example, in the following text label example, the textColor is a known property of TextLabel, so it can use an alternative color format, in this case, the HTML #code:

              + +
              +{
              +  "styles": {
              +    "AppLabel": {
              +      "textColor": "#7D3C98"
              +    }
              +  }
              +}
              +
              + +

              As well as HTML codes, you can use device-specific strings, or you can also use the object format with separately specified RGB components (and optional alpha component):

              + +
              +{
              +  "styles": {
              +    "AppLabel": {
              +      "textColor": {"r":125, "g":60, "b":152}
              +    }
              +  }
              +}
              +
              +
            + + + +
            + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/svg_rendering_n.htm b/org.tizen.guides/html/native/ui/dali/svg_rendering_n.htm new file mode 100644 index 0000000..835f9ae --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/svg_rendering_n.htm @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + SVG Rendering + + + + +
            +
            +

            Mobile native Wearable native

            +
            +
            +

            Dependencies

            +
              +
            • Tizen 3.0 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable
            • +
            +

            Related Info

            + +
            +
            + +
            +

            SVG Rendering

            + +

            SVG (Scalable Vector Graphics) defines vector-based graphics in the XML format. The SVG graphics do not lose any quality when they are zoomed or resized.

            + +

            Dali SVG rendering covers the following core features:

            + +
              +
            • Basic shapes and paths
            • +
            • Solid and gradient color fill
            • +
            • Solid color stroke, and stroke line cap and line join
            • +
            + +

            Other SVG features, such as gradient color stroke, text, clip path, and animation, are not supported.

            + +

            To more information on the SVG features, see SVG Tiny 1.2 Specification.

            + +

            SVG Rendering Methods

            + +

            You can render an SVG image on screen with DALi with both C++ and JSON. You can render an image in 2 ways:

            +
              +
            • Use the SVG URL to create an ImageView object (in mobile and wearable applications). + + +

              You can show the SVG image in a C++ file or, without using C++, write the JSON representations in a style sheet.

              + +
              +// C++ example, use ImageView to render the SVG image
              +ImageView myImageView = ImageView::New( "source-image-url.svg" );
              +Stage::GetCurrent().Add( myImageView );
              +
              +// JSPN example, use ImageView to render SVG                                          
              +{"stage":[
              +  {
              +    "type": "ImageView",
              +    "image": { "url", "ome-image-url.svg" }
              +  }
              +] }
              +
              +
            • +
            • Create a control, generate a property map with the SVG URL as the ImageVisual::Property::URL key value, and set it to Control::Property::BACKGROUND. + +

              You can show the SVG image in a C++ file or, without using C++, write the JSON representations in a style sheet.

              + +
              +// C++ example, set SVG image as control background
              +Control myControl = Control::New();
              +Property::Map backgroundMap;
              +backgroundMap[ImageVisual::Property::URL] = "source-image-url.svg";
              +myControl.SetProperty( Control::Property::BACKGROUND, backgroundMap );
              +Stage::GetCurrent().Add( myControl );
              +
              +// JSON example, set SVG image as control background
              +{"stage":[
              +  {
              +    "type": "Control",
              +    "background": { "url", "some-image-url.svg" }
              +  }
              +] }
              +
              +
            • +
            + + + +
            + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/tableview_n.htm b/org.tizen.guides/html/native/ui/dali/tableview_n.htm index 2b622a0..50fa145 100644 --- a/org.tizen.guides/html/native/ui/dali/tableview_n.htm +++ b/org.tizen.guides/html/native/ui/dali/tableview_n.htm @@ -18,16 +18,18 @@
            -

            Mobile native

            +

            Mobile native Wearable native

            Dependencies

            • Tizen 2.4 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable

            Related Info

            diff --git a/org.tizen.guides/html/native/ui/dali/texteditor_n.htm b/org.tizen.guides/html/native/ui/dali/texteditor_n.htm new file mode 100644 index 0000000..d73507c --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/texteditor_n.htm @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + TextEditor + + + + +
            +
            +

            Mobile native Wearable native

            +
            +
            +

            Dependencies

            +
              +
            • Tizen 3.0 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable
            • +
            +

            Content

            + +

            Related Info

            + +
            +
            + +
            +

            TextEditor

            + +

            The Dali::Toolkit::TextEditor class provides a control that allows multi-line text editing. It is similar to the TextField control, where a different formatting can be applied to different parts of the text. You can change, for example, the font color, font style, point size, and font family.

            + +

            The TextEditor also supports markup, and text can be scrolled vertically within it.

            + +

            Figure: TextEditor

            +

            TextEditor

            + +

            The following table lists the basic signals provided by the Dali::Toolkit::TextEditor class.

            + + + + + + + + + + + + + + + + + +
            Table: Dali::Toolkit::TextEditor input signals
            Input signalDescription
            TextChangedSignal()Emitted when the text changes.
            InputStyleChangedSignal()Emitted when the input style is updated as a consequence of a change in the cursor position.
            + + +

            Creating a TextEditor

            + +

            The following basic example shows how to create a Dali::Toolkit::TextEditor object:

            + +
            +TextEditor editor = TextEditor::New();
            +editor.SetSize( mStageWidth, mStageHeight * 0.4f );
            +editor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
            +editor.SetParentOrigin( ParentOrigin::TOP_CENTER );
            +editor.SetProperty( TextEditor::Property::DECORATION_BOUNDING_BOX, boundingBox );
            +editor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK );
            +editor.SetProperty( TextEditor::Property::TEXT,
            +                    "This is a multiline text.\n"
            +                    "I can write several lines.\n"
            +                    "Line wrapping is also supported for very long sentences."
            +                    "The text should be scrollable as well.\n" );
            +Stage::GetCurrent().Add( editor );
            +
            + +

            Modifying TextEditor Properties

            + +

            You can modify the TextEditor appearance and behavior through its properties. To change a property from its default value, use the SetProperty() function.

            + +

            The following table lists the available TextEditor properties.

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            Table: TextEditor properties
            PropertyTypeDescription
            RENDERING_BACKENDIntegerType or rendering (suc as bitmap-based)
            TEXTStringText to display in the UTF-8 format
            TEXT_COLORVector4Text color
            FONT_FAMILYStringRequested font family
            FONT_STYLEStringRequested font style
            POINT_SIZEFloatSize of font in points
            HORIZONTAL_ALIGNMENTStringText horizontal alignment. The possible values are BEGIN, CENTER, END.
            SCROLL_THRESHOLDFloatVertical scrolling occurs if the cursor is within the threshold area next to the control border.
            SCROLL_SPEEDFloatScroll speed in pixels per second
            PRIMARY_CURSOR_COLORVector4Color to apply to the primary cursor
            SECONDARY_CURSOR_COLORVector4Color to apply to the secondary cursor
            ENABLE_CURSOR_BLINKBooleanWhether the cursor blinks
            CURSOR_BLINK_INTERVALFloatTime interval in seconds between the cursor on and off states
            CURSOR_BLINK_DURATIONFloatCursor stops blinking after this number of seconds (if non-zero)
            CURSOR_WIDTHIntegerCursor width
            GRAB_HANDLE_IMAGEStringImage to display for the grab handle
            GRAB_HANDLE_PRESSED_IMAGEStringImage to display when the grab handle is pressed
            SELECTION_HANDLE_IMAGE_LEFTProperty::MapImage to display for the left selection handle
            SELECTION_HANDLE_IMAGE_RIGHTProperty::MapImage to display for the right selection handle
            SELECTION_HANDLE_PRESSED_IMAGE_LEFTProperty::MapImage to display when the left selection handle is pressed
            SELECTION_HANDLE_PRESSED_IMAGE_RIGHTProperty::MapImage to display when the right selection handle is pressed
            SELECTION_HANDLE_MARKER_IMAGE_LEFTProperty::MapImage to display for the left selection handle marker
            SELECTION_HANDLE_MARKER_IMAGE_RIGHTProperty::MapImage to display for the right selection handle marker
            SELECTION_HIGHLIGHT_COLORVector4Color of the selection highlight
            DECORATION_BOUNDING_BOXRectangleDecorations (such as handles) are positioned within this area on the screen
            ENABLE_MARKUPBooleanWhether the markup processing is enabled
            INPUT_COLORVector4Color of the new input text
            INPUT_FONT_FAMILYStringFont family of the new input text
            INPUT_FONT_STYLEStringFont style of the new input text
            INPUT_POINT_SIZEFloatFont size of the new input text in points
            LINE_SPACINGFloatDefault extra space between lines in points
            INPUT_LINE_SPACINGFloatExtra space between lines in points. It affects the whole paragraph where the new input text is inserted.
            UNDERLINEStringDefault underline parameters
            INPUT_UNDERLINEStringUnderline parameters of the new input text
            SHADOWStringDefault shadow parameters
            INPUT_SHADOWStringShadow parameters of the new input text
            EMBOSSStringDefault emboss parameters
            INPUT_EMBOSSStringEmboss parameters of the new input text
            OUTLINEStringDefault outline parameters
            INPUT_OUTLINEStringOutline parameters of the new input text
            + + + +
            + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/textfield_n.htm b/org.tizen.guides/html/native/ui/dali/textfield_n.htm index bc55ee7..58c3dfa 100644 --- a/org.tizen.guides/html/native/ui/dali/textfield_n.htm +++ b/org.tizen.guides/html/native/ui/dali/textfield_n.htm @@ -18,12 +18,13 @@
            -

            Mobile native

            +

            Mobile native Wearable native

            Dependencies

            • Tizen 2.4 and Higher for Mobile
            • +
            • Tizen 3.0 and Higher for Wearable

            Content

              @@ -34,6 +35,7 @@

              Related Info

              diff --git a/org.tizen.guides/html/native/ui/dali/textlabel_n.htm b/org.tizen.guides/html/native/ui/dali/textlabel_n.htm index e13d81f..d124822 100644 --- a/org.tizen.guides/html/native/ui/dali/textlabel_n.htm +++ b/org.tizen.guides/html/native/ui/dali/textlabel_n.htm @@ -18,12 +18,13 @@
              -

              Mobile native

              +

              Mobile native Wearable native

              Dependencies

              • Tizen 2.4 and Higher for Mobile
              • +
              • Tizen 3.0 and Higher for Wearable

              Content

                @@ -36,6 +37,7 @@

                Related Info

                diff --git a/org.tizen.guides/html/native/ui/dali/touchdata_n.htm b/org.tizen.guides/html/native/ui/dali/touchdata_n.htm new file mode 100644 index 0000000..7b9cfb9 --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/touchdata_n.htm @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + Touch Data + + + + +
                +
                +

                Mobile native Wearable native

                +
                +
                +

                Dependencies

                +
                  +
                • Tizen 3.0 and Higher for Mobile
                • +
                • Tizen 3.0 and Higher for Wearable
                • +
                +

                Related Info

                + +
                +
                + +
                +

                Touch Data

                + +

                DALi informs you with a callback when the user touches the screen and when the touch ends. The information is encapsulated in the Dali::TouchData class, which is a collection of points at a specific moment in time. When a multi-touch event occurs, each point represents the points that are currently being touched or the points where a touch has stopped.

                + +

                The Dali::TouchData class replaces the old deprecated Dali::TouchEvent struct. It contains functions for retrieving the information that the Dali::TouchEvent struct provided, but also adds the radius, touch pressure, and angle information.

                + + + + + + + + + + +
                Note
                Do not use the Dali::TouchData class in a container. +

                As the Dali::TouchData class is a handle to an internal object, it must not be copied (or used in a container) as all that happens is that the handle is copied to the same object, and the internal object can change unexpectedly. If the data must be stored in the application, save only the required data (retrieved using the class functions).

                + + +

                The first point that the user touches is the primary point and the one that is used for hit-testing. Hit-testing is the process of determining whether a user-controlled cursor (such as a mouse cursor or touch-point) intersects a given graphical object drawn on the screen. There are many different algorithms that can be used for hit-testing, with different performance or accuracy outcomes. For more information on DALi hit-testing, see the Detailed Description for the Dali::Actor class (in mobile and wearable applications).

                + +

                Detecting Touches on Actors

                + +

                To establish a connection to a touch data signal:

                + +
                  +
                1. Connect to the actor's touch signal: +
                  1. Create your touch handling function: + +
                    +class MyApplication : public ConnectionTracker
                    +{
                    +  bool OnTouch( Actor actor, TouchData& touch );
                    +};
                    +
                    +
                  2. +
                  3. Connect to the required actor's touch signal (this is normally done when the init signal is received). +

                    Ensure that your MyApplication class is set up to connect to signals, and that it inherits from the ConnectionTracker class (in mobile and wearable applications). The ConnectionTracker provides a way of automatically disconnecting from the connected signals when the application dies. This is more useful for application objects that exist only temporarily.

                    + +
                    +Actor actor = Actor::New();
                    +actor.TouchSignal().Connect( this, &MyApplication::OnTouch );
                    +
                    + +

                    The first parameter of the Connect() function (this) refers to an object of the MyApplication* class. The Connect() function connects between this and the OnTouch() member function.

                    +
                  +
                2. +
                3. Implement the touch handler. +

                  When your touch handler is called, you can retrieve a lot of information about how the user has interacted with your actor:

                  + +
                    +
                  • To retrieve the point count (the total number of points in the touch data), and the state of a specific point, use the GetPointCount() and GetState() functions: + +
                    +bool MyApplication::OnTouch( Actor actor, TouchData& touch )
                    +{
                    +  const std::size_t pointCount = touch.GetPointCount();
                    +  if( pointCount == 1 )
                    +  {
                    +    // Single touch event
                    +
                    +    // Get touch state of the primary point
                    +    PointState::Type pointState = touch.GetState( 0 );
                    +    if( pointState == PointState::DOWN )
                    +    {
                    +      // User has just pressed on the device
                    +    }
                    +    else if( pointState == PointState::UP )
                    +    {
                    +      // User has just released their finger from the device
                    +    }
                    +  }
                    +  else
                    +  {
                    +    // Multi-touch event
                    +  }
                    +
                    +  return true; // Touch handled
                    +}
                    +
                    +
                  • +
                  • To retrieve the time the touch occurred, use the GetTime() function. +

                    You can also get the ID of the device that a particular touch originated from. It is useful when multiple touch points are pressed or released.

                    + +
                    +unsigned long touchTime = touchData.GetTime();
                    +int32_t touchDeviceId = touchData.GetDeviceId( 0 );
                    +
                    +
                  • +
                  • To retrieve the hit actor (the actor that was underneath a specific point), use the GetHitActor() function. The hit actor can be useful, as it can be a child of the actor that has been given as a parameter. + +
                    +Actor hitActor = touchData.GetHitActor( 0 );
                    +
                    +
                  • +
                  • To retrieve the local hit actor and screen positions, use the GetLocalPosition() and GetScreenPosition() functions. The function returns the coordinates relative to the top-left of the hit actor or screen at the specific point. + +
                    +const Vector2& screen = touchData.GetScreenPosition( 0 );
                    +const Vector2& local = touchData.GetLocalPosition( 0 );
                    +
                    +
                  • +
                  • To retrieve the pressure with which the user touched the screen, use the GetPressure() function. +

                    The pressure range starts at 0.0f and normal pressure is defined as 1.0f. A value between 0.0f and 1.0f means light pressure has been applied, whereas a value greater than 1.0f means that more pressure than normal has been applied.

                    + +
                    +float touchPressure = touchData.GetPressure( 0 );
                    +
                    +
                  • +
                  • To retrieve the radius of the touch point, use the GetRadius() or GetEllipseRadius() function. The first returns a float which is the average of both the horizontal and the vertical radii of the pressed point, while the second returns a Vector2 which stores both the horizontal and the vertical radii of the pressed point. + +
                    +float averageRadius = touchData.GetRadius( 0 );
                    +const Vector2& ellipseRadii = touchData.GetEllipseRadius( 0 );
                    +
                    +
                  • +
                  • To retrieve the angle of the user's finger when touching the screen, use the GetAngle() function. The return value is the angle relative to the Y axis. + +
                    +Degree angle = touchData.GetAngle( 0 );
                    +
                    +
                  +
                + + + +
                + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/ui_components_n.htm b/org.tizen.guides/html/native/ui/dali/ui_components_n.htm index e19a826..48ca438 100644 --- a/org.tizen.guides/html/native/ui/dali/ui_components_n.htm +++ b/org.tizen.guides/html/native/ui/dali/ui_components_n.htm @@ -18,16 +18,18 @@
                -

                Mobile native

                +

                Mobile native Wearable native

                Dependencies

                • Tizen 2.4 and Higher for Mobile
                • +
                • Tizen 3.0 and Higher for Wearable

                Related Info

                @@ -35,7 +37,7 @@

                UI Components

                -

                UI components are interactive components for layouting and scrolling the user interface. DALi provides UI components, such as buttons, item view, scroll view, table view, and text controls.

                +

                UI components are interactive components for layouting and scrolling the user interface. DALi provides UI components, such as buttons, item view, scroll view, table view, text controls, image view, flex container, model3dview, slider, and video view.

                Figure: DALi UI components

                DALi UI components

                @@ -74,7 +76,7 @@
          TextFieldA text field that provides a single-line editable text field.A text field that provides a single-line editable text. TextField
          TextLabel
          TextEditorA text field that provides a multi-line editable text.TextEditor
          ImageView An image view that renders an image. ImageView
          FlexContainerA layout model that allows responsive elements within a container, automatically arranged to different size screens or devices.FlexContainer
          Model3dViewA model view that displays static 3D content.Model3dView
          SliderA control that indicates a modifiable value within a specific range.Slider
          VideoViewA video view that controls and displays video playback.VideoView
          -

          The base class for the components is Dali::Toolkit::Control. This class can also be used to create your own custom UI components. For tips for the control class, see Control. In this UI Components guide, both the terms control and component are used to refer to a UI component.

          +

          The base class for the components is Dali::Toolkit::Control (in mobile and wearable applications). This class can also be used to create your own custom UI components. For tips for the control class, see Control. In this UI Components guide, both the terms control and component are used to refer to a UI component.

          + +

          You can customize the look of the UI components with stylesheets. For a reusable rendering logic that can be used by all UI components, take advantage of DALi visuals.

          The following figure illustrates the hierarchy of the UI components.

          diff --git a/org.tizen.guides/html/native/ui/dali/videoview_n.htm b/org.tizen.guides/html/native/ui/dali/videoview_n.htm new file mode 100644 index 0000000..635512f --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/videoview_n.htm @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + VideoView + + + + +
          +
          +

          Mobile native Wearable native

          +
          +
          +

          Dependencies

          +
            +
          • Tizen 3.0 and Higher for Mobile
          • +
          • Tizen 3.0 and Higher for Wearable
          • +
          +

          Content

          + +

          Related Info

          + +
          +
          + +
          +

          VideoView

          + +

          The Dali::Toolkit::VideoView is a control for video playback and display. It provides minimum functions for playback (play, pause, stop, forward, and backward). Some options, such as volume, can be controlled through the control properties. For the VideoView to work, a video plugin is needed. The Tizen 3.0 platform includes the required Dali video plugin.

          + +

          Figure: VideoView

          +

          VideoView

          + + + + + + + + + + +
          Note
          The VideoView control does not use any privileges APIs on its own. However, if you use video files in a specific device storage, the application can require privileges to access the storage. For more information, see the Player API Reference (in mobile and wearable applications).
          + +

          The VideoView class provides the FinishedSignal(), which is emitted when the video playback is finished. The related callback can support some basic actions.

          + +
          +void Create( Application& application )
          +{
          +  mView.FinishedSignal().Connect( this, &VideoViewController::OnFinished );
          +}
          +
          +void OnFinished( VideoView& view )
          +{
          +  mFinished = true;
          +}
          +
          + +

          Creating a VideoView

          + +

          The following basic example shows how to create a Dali::Toolkit::VideoView object:

          + +
          +class VideoViewController: public ConnectionTracker
          +{
          +  public:
          +    VideoViewController( Application& application )
          +    : mApplication( application )
          +    {
          +      mApplication.InitSignal().Connect( this, &VideoViewController::Create );
          +    }
          +
          +    void Create( Application& application )
          +    {
          +      // Set the handle
          +      mView = Toolkit::VideoView::New( "videofile.mp4" );
          +      Stage::GetCurrent().Add( mView );
          +      mView.SetParentOrigin( ParentOrigin::CENTER );
          +      mView.SetAnchorPoint( AnchorPoint::CENTER );
          +      mView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
          +      mView.SetSize( WIDTH, HEIGHT );
          +      mView.Play();
          +    }
          +
          +  private:
          +    Application& mApplication;
          +    VideoView mView;
          +}
          +
          + + + + + + + + + + +
          Note
          You can set the video file to be played in the VideoView::New() function, or by modifying VIDEO property with SetProperty( VideoView::Property::VIDEO, "videofile2.mp4" ).
          + +

          Modifying VideoView Properties

          + +

          You can modify the VideoView appearance and behavior through its properties.

          + +

          To change a property from its default value, use the SetProperty() function:

          + +
          +Property::Map oldMap;
          +Property::Value value = mView.GetProperty( VideoView::Property::VOLUME );
          +Value.Get( oldMap );
          +
          +Property::Map newMap;
          +newMap.Insert( "volumeLeft", 1.0f );
          +newMap.Insert( "volumeRight", 0.5f );
          +mView.SetProperty( VideoView::Property::VOLUME, newMap );
          +
          + +

          The following table lists the available VideoView properties.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: VideoView properties
          PropertyTypeDescription
          VIDEOString or Property::MapVideo file URL string. This property can also provide additional features, such as a custom shader, by Property::Map.
          LOOPINGBoolWhether the playback loops
          MUTEDBoolWhether the playback is muted
          VOLUMEProperty::MapPlayback volume. The Property::Map must get left and right volume scalar as a float type.
          + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/dali/visuals_n.htm b/org.tizen.guides/html/native/ui/dali/visuals_n.htm new file mode 100644 index 0000000..75d2bc4 --- /dev/null +++ b/org.tizen.guides/html/native/ui/dali/visuals_n.htm @@ -0,0 +1,955 @@ + + + + + + + + + + + + + + Visuals + + + + +
          +
          +

          Mobile native Wearable native

          +
          +
          +

          Dependencies

          +
            +
          • Tizen 3.0 and Higher for Mobile
          • +
          • Tizen 3.0 and Higher for Wearable
          • +
          +

          Content

          + +

          Related Info

          + +
          +
          + +
          +

          Visuals

          + +

          You can create a reusable rendering logic, which can be used by all controls, by using DALi visuals. The Dali::Toolkit::Visual instance (in mobile and wearable applications) can control rendering the content as when using control properties. First, you set the type of Visual, and then you render the content with each visual property.

          + +

          DALi provides the following visuals:

          + + + +

          The controls can provide properties that allow you to specify the visual type (visualType). You set visual properties through a property map. The visualType field in the property map specifies the visual to use or create. The visual type is required to avoid ambiguity as multiple visuals can be capable of rendering the same content.

          + +

          The Control::Property::BACKGROUND is an example of a property which takes in a property map to create a visual.

          + +

          Color Visual

          + +

          The color visual renders a solid color to the control's quad.

          + +

          Figure: Color visual

          +

          Color visual

          + +

          The following table lists the supported properties. The visual type is Visual::COLOR or "COLOR".

          + + + + + + + + + + + + + + + + + + + +
          Table: Image visual properties
          PropertyStringTypeRequiredDescription
          ColorVisual::Property::MIX_COLORmixColorVECTOR4YesThe solid color is required.
          + +

          Usage:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::COLOR;
          +map[ColorVisual::Property::MIX_COLOR] = Color::RED;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + +

          Gradient Visual

          + +

          The gradient visual renders a smooth transition of colors to the control's quad. Both linear (left in the following figure) and radial (right in the following figure) gradients are supported.

          + +

          Figure: Gradient visual

          +

          Gradient visual linear Gradient visual radial

          + + +

          The following table lists the supported properties. The visual type is Visual::GRADIENT or "GRADIENT".

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Gradient visual properties
          PropertyStringTypeRequiredDescription
          GradientVisual::Property::START_POSITIONstartPositionVECTOR2For linear onlyThe start position of the linear gradient.
          GradientVisual::Property::END_POSITIONendPositionVECTOR2For linear onlyThe end position of the linear gradient.
          GradientVisual::Property::CENTERcenterVECTOR2For radial onlyThe center point of the radial gradient.
          GradientVisual::Property::RADIUSradiusFLOATFor radial onlyThe size of the radius.
          GradientVisual::Property::STOP_OFFSETstopOffsetARRAY of FLOATNoAll the stop offsets. If not supplied, the default is 0.0 and 1.0.
          GradientVisual::Property::STOP_COLORstopColorARRAY of FLOATYesThe color at the stop offsets. At least 2 are required to show a gradient.
          GradientVisual::Property::UNITSunitsINTEGER or STRINGNoThe coordinate system.
          GradientVisual::Property::SPREAD_METHODspreadMethodINTEGER or STRINGNoIndicates what happens if a gradient starts or ends inside bounds.
          + +
            +
          • If the stopOffset and stopColor arrays do not have the same number of elements, the minimum of the 2 is used as the stop points.
          • +
          • The units are used to define the coordinate system for the attributes: +
              +
            • Start (x1, y1) and end (x2 and y2) points of a line, if using a linear gradient.
            • +
            • Center point (cx, cy) and radius (r) of a circle, if using a radial gradient.
            • +
            + + + + + + + + + + + + + + + + + + + +
            Table: Unit values
            EnumerationStringDescription
            GradientVisual::Units::OBJECT_BOUNDING_BOXOBJECT_BOUNDING_BOXDefault. Uses the normals for the start, end, and center points, so that the top-left is (-0.5, -0.5) and bottom-right is (0.5, 0.5).
            GradientVisual::Units::USER_SPACEUSER_SPACEUses the user coordinates for the start, end, and center points, so that in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200).
            +
          • +
          • The spreadMethod indicates what happens if the gradient starts or ends inside the bounds of the target rectangle. + + + + + + + + + + + + + + + + + + + + + + + + + +
            Table: Spread method values
            EnumerationStringDescription
            GradientVisual::SpreadMethod::PADPADDefault. Uses the terminal colors of the gradient to fill the remainder of the quad.
            GradientVisual::SpreadMethod::REFLECTREFLECTReflects the gradient pattern start-to-end, end-to-start, start-to-end, and so on, until the quad is filled.
            GradientVisual::SpreadMethod::REPEATREPEATRepeats the gradient pattern start-to-end, start-to-end, start-to-end, and so on, until the quad is filled.
            +
          • +
          • The gradient type is determined by the properties specified in the property map; for example, if both START_POSITION and END_POSITION are given, a linear gradient is shown, and if both CENTER and RADIUS are given, a radial gradient is shown. +
          + +

          Usage:

          + +
          +// Linear
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::GRADIENT;
          +map[GradientVisual::Property::START_POSITION] = Vector2( 0.5f, 0.5f );
          +map[GradientVisual::Property::END_POSITION] = Vector2( -0.5f, -0.5f );
          +Dali::Property::Array stopOffsets;
          +stopOffsets.PushBack( 0.0f );
          +stopOffsets.PushBack( 0.3f );
          +stopOffsets.PushBack( 0.6f );
          +stopOffsets.PushBack( 0.8f );
          +stopOffsets.PushBack( 1.f );
          +map[GradientVisual::Property::STOP_OFFSET] = stopOffsets;
          +Dali::Property::Array stopColors;
          +stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
          +stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f );
          +stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
          +stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
          +stopColors.PushBack( Color::YELLOW );
          +map[GradientVisual::Property::STOP_COLOR] = stopColors;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          +// Radial
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::GRADIENT;
          +map[GradientVisual::Property::CENTER] = Vector2( 0.5f, 0.5f );
          +map[GradientVisual::Property::RADIUS] = 1.414f;
          +Dali::Property::Array stopOffsets;
          +stopOffsets.PushBack( 0.0f );
          +stopOffsets.PushBack( 0.3f );
          +stopOffsets.PushBack( 0.6f );
          +stopOffsets.PushBack( 0.8f );
          +stopOffsets.PushBack( 1.f );
          +map[GradientVisual::Property::STOP_OFFSET] = stopOffsets;
          +Dali::Property::Array stopColors;
          +stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
          +stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f );
          +stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
          +stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
          +stopColors.PushBack( Color::YELLOW );
          +map[GradientVisual::Property::STOP_COLOR] = stopColors;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + +

          Image Visual

          + +

          The image visual renders an image into the control's quad. Depending on the extension of the image, a different visual is provided to render the image onto the screen:

          + +
            +
          • Normal (Quad)
          • +
          • N-Patch
          • +
          • SVG
          • +
          + +

          Normal Image

          + +

          The normal image visual renders a raster image (such as JPG or PNG) into the control's quad.

          + +

          Figure: Normal image visual

          +

          Normal image visual

          + +

          The following table lists the supported properties. The visual type is Visual::IMAGE or "IMAGE".

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Normal image visual properties
          PropertyStringTypeRequiredDescription
          ImageVisual::Property::URLurlSTRINGYesThe URL of the image.
          ImageVisual::Property::FITTING_MODEfittingModeINTEGER or STRINGNoFitting options, used when resizing images to fit the desired dimensions.
          ImageVisual::Property::SAMPLING_MODEsamplingModeINTEGER or STRINGNoFiltering options, used when resizing images to the sample original pixels.
          ImageVisual::Property::DESIRED_WIDTHdesiredWidthINTEGERNoThe desired image width. Actual image width is used, if not specified.
          ImageVisual::Property::DESIRED_HEIGHTdesiredHeightINTEGERNoThe desired image height. Actual image height is used, if not specified.
          + +

          Usage:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE;
          +map[ImageVisual::Property::URL] = "path-to-image.jpg";
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + +

          N-Patch Image

          + +

          The n-patch image visual renders an n-patch or a 9-patch image into the control's quad.

          + +

          Figure: N-patch image visual

          +

          N-patch image visual

          + +

          The following table lists the supported properties. The visual type is Visual::IMAGE or "IMAGE".

          + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: N-patch image visual properties
          PropertyStringTypeRequiredDescription
          ImageVisual::Property::URLurlSTRINGYesThe URL of the n-patch image.
          ImageVisual::Property::BORDER_ONLYborderOnlyBOOLEANNoIf true, only draws the borders.
          + +

          Usage:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE;
          +map[Dali::Toolkit::ImageVisual::Property::URL] = "path-to-image.9.png";
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + +

          SVG Image

          + +

          The SVG image visual renders an SVG image into the control's quad. It supports the following features from the SVG Tiny 1.2 Specification:

          + +
            +
          • Basic shapes
          • +
          • Paths
          • +
          • Solid color fill
          • +
          • Gradient color fill
          • +
          • Solid color stroke
          • +
          + +

          The following features are not supported:

          +
            +
          • Gradient color stroke
          • +
          • Dash array stroke
          • +
          • View box
          • +
          • Text
          • +
          • Clip path
          • +
          + +

          Figure: SVG image visual

          +

          SVG image visual

          + +

          The following table lists the supported properties. The visual type is Visual::IMAGE or "IMAGE".

          + + + + + + + + + + + + + + + + + + + +
          Table: SVG image visual properties
          PropertyStringTypeRequiredDescription
          ImageVisual::Property::URLurlSTRINGYesThe URL of the image.
          + +

          Usage:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE;
          +map[Dali::Toolkit::ImageVisual::Property::URL] = "path-to-image.svg";
          +control.SetSize( 200.f, 200.f );
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + + +

          Border Visual

          + +

          The border visual renders a solid color as an internal border to the control's quad.

          + +

          Figure: Border visual

          +

          Border visual

          + +

          The following table lists the supported properties. The visual type is Visual::BORDER or "BORDER".

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Border visual properties
          PropertyStringTypeRequiredDescription
          BorderVisual::Property::COLORborderColorVECTOR4YesThe color of the border.
          BorderVisual::Property::SIZEborderSizeFLOATYesThe width of the border (in pixels).
          BorderVisual::Property::ANTI_ALIASINGantiAliasingBOOLEANNoWhether anti-aliasing of the border is required.
          + +

          Usage:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::BORDER;
          +map[BorderVisual::Property::COLOR] = Color::BLUE;
          +map[BorderVisual::Property::SIZE] = 5.0f;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + + +

          Mesh Visual

          + +

          The mesh visual renders a mesh using a .obj file, optionally with textures provided by a .mtl file. The mesh is scaled to fit the control.

          + +

          Figure: Mesh visual

          +

          Mesh visual

          + +

          The following table lists the supported properties. The visual type is Visual::MESH or "MESH".

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Mesh visual properties
          PropertyStringTypeRequiredDescription
          MeshVisual::Property::OBJECT_URLobjectUrlSTRINGYesThe location of the .obj file.
          MeshVisual::Property::MATERIAL_URLmaterialUrlSTRINGNoThe location of the .mtl file. Leave blank for a textureless object.
          MeshVisual::Property::TEXTURES_PATHtexturesPathSTRINGIf using materialThe path to the directory the textures (including gloss and normal) are stored in.
          MeshVisual::Property::SHADING_MODEshadingModeINTEGER or STRINGNoThe type of the shading mode that the mesh uses.
          MeshVisual::Property::USE_MIPMAPPINGuseMipmappingBOOLEANNoWhether to use mipmaps for textures. By default, true.
          MeshVisual::Property::USE_SOFT_NORMALSuseSoftNormalsBOOLEANNoWhether to average normals at each point to smooth textures. By default, true.
          MeshVisual::Property::LIGHT_POSITIONlightPositionVECTOR3NoThe position, in stage space, of the point light that applies lighting to the model.
          + +
            +
          • When specifying the shadingMode, if anything the mode requires is missing, a simpler mode that can be handled with what has been supplied is used instead. + + + + + + + + + + + + + + + + + + + + + + + + + +
            Table: Shading mode values
            EnumerationStringDescription
            MeshVisual::ShaderType::TEXTURELESS_WITH_DIFFUSE_LIGHTINGTEXTURELESS_WITH_DIFFUSE_LIGHTINGSimplest. One color that is lit by ambient and diffuse lighting.
            MeshVisual::ShaderType::TEXTURED_WITH_SPECULAR_LIGHTINGTEXTURED_WITH_SPECULAR_LIGHTINGUses only the visual image textures provided with specular lighting in addition to ambient and diffuse lighting.
            MeshVisual::ShaderType::TEXTURED_WITH_DETAILED_SPECULAR_LIGHTINGTEXTURED_WITH_DETAILED_SPECULAR_LIGHTINGUses all textures provided including a gloss, normal, and texture map along with specular, ambient, and diffuse lighting.
            +
          + +

          Usage:

          + +
          +Dali::Stage stage = Dali::Stage::GetCurrent();
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::MESH;
          +map[MeshVisual::Property::OBJECT_URL] = "home/models/Dino.obj";
          +map[MeshVisual::Property::MATERIAL_URL] = "home/models/Dino.mtl";
          +map[MeshVisual::Property::TEXTURES_PATH] = "home/images/";
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + + +

          Primitive Visual

          + +

          The primitive visual renders a simple 3D shape, such as a cube or sphere. The shape is scaled to fit the control. The shapes are generated with clockwise winding and back-face culling on by default.

          + +

          Figure: Primitive visual

          +

          Primitive visual

          + +

          The following table lists the supported properties. The visual type is Visual::PRIMITIVE or "PRIMITIVE".

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Table: Primitive visual properties
          PropertyStringTypeDescriptionDefault ValueRange
          PrimitiveVisual::Property::SHAPEshapeINTEGER or STRINGThe specific shape to render.PrimitiveVisual::Shape::SPHERE or "SPHERE"See the Shape values table.
          PrimitiveVisual::Property::COLORshapeColorVECTOR4The color of the shape.(0.5, 0.5, 0.5, 1.0)0.0 - 1.0 for each
          PrimitiveVisual::Property::SLICESslicesINTEGERThe number of slices as you go around the shape.1281 - 255
          PrimitiveVisual::Property::STACKSstacksINTEGERThe number of stacks as you go down the shape.1281 - 255
          PrimitiveVisual::Property::SCALE_TOP_RADIUSscaleTopRadiusFLOATThe scale of the radius of the top circle of a conical frustrum.1.0>= 0.0
          PrimitiveVisual::Property::SCALE_BOTTOM_RADIUSscaleBottomRadiusFLOATThe scale of the radius of the bottom circle of a conical frustrum.1.5>= 0.0
          PrimitiveVisual::Property::SCALE_HEIGHTscaleHeightFLOATThe scale of the height of a conic.3.0> 0.0
          PrimitiveVisual::Property::SCALE_RADIUSscaleRadiusFLOATThe scale of the radius of a cylinder.1.0> 0.0
          PrimitiveVisual::Property::SCALE_DIMENSIONSscaleDimensionVECTOR3The dimensions of a cuboid. Scales in the same fashion as a 9-patch image.Vector3::ONE> 0.0 for each
          PrimitiveVisual::Property::BEVEL_PERCENTAGEbevelPercentageFLOATDefines how beveled the cuboid must be, based on the smallest dimension.0.0 (no bevel)0.0 - 1.0
          PrimitiveVisual::Property::BEVEL_SMOOTHNESSbevelSmoothnessFLOATDefines how smooth the beveled edges must be.0.0 (sharp edges)0.0 - 1.0
          PrimitiveVisual::Property::LIGHT_POSITIONlightPositionVECTOR3The position, in stage space, of the point light that applies lighting to the model.(Offset outwards from the center of the screen.)Unlimited
          + +
          • You can select from 6 shape values, some of which are simplified specializations of another. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            Table: Shape values
            EnumerationStringDescriptionParameters
            PrimitiveVisual::Shape::SPHERESPHEREDefaultcolor, slices, stacks
            PrimitiveVisual::Shape::CONICAL_FRUSTRUMCONICAL_FRUSTRUMThe area bound between 2 circles (basically, a cone with the tip removed)color, scaleTopRadius, scaleBottomRadius, scaleHeight, slices
            PrimitiveVisual::Shape::CONECONEEquivalent to a conical frustrum with the top radius of zero.color, scaleBottomRadius, scaleHeight, slices
            PrimitiveVisual::Shape::CYLINDERCYLINDEREquivalent to a conical frustrum with equal radii for the top and bottom circles.color, scaleRadius, scaleHeight, slices
            PrimitiveVisual::Shape::CUBECUBEEquivalent to a beveled cube with a bevel percentage of zero.color, scaleDimensions
            PrimitiveVisual::Shape::OCTAHEDRONOCTAHEDRONEquivalent to a beveled cube with a bevel percentage of 1.color, scaleDimensions
            PrimitiveVisual::Shape::BEVELLED_CUBEBEVELLED_CUBEA cube/cuboid with all edges flattened to some degree.color, scaleDimensions, bevelPercentage, bevelSmoothness
            +
          + +

          Usage:

          + +
          +// Sphere
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::PRIMITIVE;
          +map[PrimitiveVisual::Property::SHAPE] = PrimitiveVisual::Shape::SPHERE;
          +map[PrimitiveVisual::Property::COLOR] = Vector4( 1.0, 0.5, 0.0, 1.0 );
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          +// Conical frustrum
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::PRIMITIVE;
          +map[PrimitiveVisual::Property::SHAPE] = PrimitiveVisual::Shape::CONICAL_FRUSTRUM;
          +map[PrimitiveVisual::Property::COLOR] = Vector4( 1.0, 0.5, 0.0, 1.0 );
          +map[PrimitiveVisual::Property::SCALE_TOP_RADIUS] = 1.0f;
          +map[PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS] = 1.5f;
          +map[PrimitiveVisual::Property::SCALE_HEIGHT] = 3.0f;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          +// Beveled cube
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::PRIMITIVE;
          +map[PrimitiveVisual::Property::SHAPE] = PrimitiveVisual::Shape::BEVELLED_CUBE;
          +map[PrimitiveVisual::Property::COLOR] = Vector4( 1.0, 0.5, 0.0, 1.0 );
          +map[PrimitiveVisual::Property::BEVEL_PERCENTAGE] = 0.4f;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + +

          Primitive Visual Examples

          + +
            +
          • Sphere: +

            Sphere

            +
          • +
          • Conics: + + + + + + + + + + + + + +
            FrustrumConeCylinder

            Frustrum

            Cone

            Cylinder

            +
          • +
          • Bevel: + +

            Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.

            + + + + + + + + + + + + + + + + + + + + +
            0.0 (cube)0.3

            Bevel1

            Bevel2

            0.71.0 (octahedron)

            Bevel3

            Bevel4

            +
          • +
          • Slices: + +

            For spheres and conical frustrums, "slices" determine how many divisions there are as you go around the object.

            + +

            Slices

            +
          • +
          • Stacks: + +

            For spheres, "stacks" determines how many layers there are as you go down the object.

            + +

            Stacks

            +
          • +
          + +

          Wireframe Visual

          + +

          The wireframe visual renders a wireframe around a control's quad. It is mainly used for debugging and is the visual that replaces all other visuals when Visual Debug Rendering is switched on. To switch Visual Debug Rendering on, set the DALI_DEBUG_RENDERING environment variable to 1 before launching the DALi application.

          + +

          Figure: Wireframe visual

          +

          Wireframe visual

          + +

          The visual type is Visual::WIREFRAME or "WIREFRAME".

          + +

          Usage:

          + +
          +Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
          +Dali::Property::Map map;
          +map[Visual::Property::TYPE] = Dali::Toolkit::Visual::WIREFRAME;
          +control.SetProperty( Control::Property::BACKGROUND, map );
          +
          + + + + +
          + +Go to top + + + + + + + + diff --git a/org.tizen.guides/html/native/ui/ui_cover_n.htm b/org.tizen.guides/html/native/ui/ui_cover_n.htm index 28076f2..755d1bd 100644 --- a/org.tizen.guides/html/native/ui/ui_cover_n.htm +++ b/org.tizen.guides/html/native/ui/ui_cover_n.htm @@ -47,7 +47,7 @@

          You can use the EFL UI toolkit if you are creating a 2D-based Tizen native application. However, EFL supports 2.5D and 3D effects and 3D objects as well. EFL provides streamlined graphic core libraries you need to create powerful applications. EFL needs lower memory but provides high performance, and supports a retained mode graphics system and user-centric features, such as themes, 2D/3D effects, and accessibility. In addition, EFL supports various resolutions with the same layout, fast and small file systems, a variety of programming language bindings, and a separate UI and logic.

          -
        • Dynamic Animation Library (DALi) in mobile applications only +
        • Dynamic Animation Library (DALi)

          You can use the DALi 3D UI toolkit if you are creating a high-performance rich UI application. DALi is based on OpenGL ES 2.0 and 3.0; however it hides the complexity of the OpenGL ES API from you. DALi requires a GPU (Graphical Processing Unit) on the device.

        diff --git a/org.tizen.guides/html/web/app_management/app_controls_w.htm b/org.tizen.guides/html/web/app_management/app_controls_w.htm index 6d8c1a1..6ab241e 100644 --- a/org.tizen.guides/html/web/app_management/app_controls_w.htm +++ b/org.tizen.guides/html/web/app_management/app_controls_w.htm @@ -288,7 +288,6 @@ window.addEventListener("appcontrol", function onAppControl()    } }); -

        Prerequisites

        To use the Application API (in mobile, wearable, and TV applications), the application has to request permission by adding the following privileges to the config.xml file:

        @@ -518,7 +517,7 @@ app.removeEventListener(watchId);

        When a Web application becomes invisible (moves to the background), it is suspended. Before Tizen 2.4, to continue to execute the application on the background, you had to set the background-support attribute of the <tizen:setting> element to enable in the config.xml file (in mobile and wearable applications).

        -

        Since Tizen 2.4, the background process management policy has been changed. The system does not allow applications to run on the background except when they are explicitly declared to do so by having a specific background category. For more information on the available background categories, see the Allowed background application policy table.

        +

        Since Tizen 2.4, the background process management policy has been changed. The system does not allow applications to run on the background except when they are explicitly declared to do so by having a specific background category. For more information on the available background categories, see the Allowed background application policy table.

        @@ -570,4 +569,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.guides/index.xml b/org.tizen.guides/index.xml index 9c9f37c..01ec665 100644 --- a/org.tizen.guides/index.xml +++ b/org.tizen.guides/index.xml @@ -7,11 +7,18 @@ - - - - - + + + + + + + + + + + + @@ -179,15 +186,24 @@ - + + + + + + + + + + @@ -195,7 +211,10 @@ - + + + + diff --git a/org.tizen.studio/html/web_tools/config_editor_w.htm b/org.tizen.studio/html/web_tools/config_editor_w.htm index 51d37c1..d7ae8d4 100644 --- a/org.tizen.studio/html/web_tools/config_editor_w.htm +++ b/org.tizen.studio/html/web_tools/config_editor_w.htm @@ -730,7 +730,7 @@

        Attributes:

        Example:

        <tizen:background-category value="media" />
        @@ -1050,7 +1050,7 @@

        Attributes:

        Example:

        <tizen:background-category value="media" />
        @@ -1587,4 +1587,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + diff --git a/org.tizen.training/html/native/app_model/application_model_n.htm b/org.tizen.training/html/native/app_model/application_model_n.htm index 3cee27f..5447516 100644 --- a/org.tizen.training/html/native/app_model/application_model_n.htm +++ b/org.tizen.training/html/native/app_model/application_model_n.htm @@ -67,7 +67,7 @@ These devices have constraints, such as relatively small screen sizes and lack o
      • An alarm is triggered for another application, which becomes the top-most window and hides your application.

      • -

        Since Tizen 2.4, the application on the background goes into a suspended state. In the suspended state, the application process is executed with limited CPU resources. In other words, the platform does not allow the running of the background applications, except for some exceptional applications (such as Media and Download) that necessarily work on the background. In this case, the application can designate their background category as an allowed category to avoid going into the suspended state.

        +

        Since Tizen 2.4, the application on the background goes into a suspended state. In the suspended state, the application process is executed with limited CPU resources. In other words, the platform does not allow the running of the background applications, except for some exceptional applications (such as Media and Download) that necessarily work on the background. In this case, the application can designate their background category as an allowed category to avoid going into the suspended state.

        When your application becomes visible again, the app_resume_cb() callback is invoked. The visibility returns, when:

        @@ -86,7 +86,7 @@ These devices have constraints, such as relatively small screen sizes and lack o

        Because the service application has no UI, it neither has a pause state. Since Tizen 2.4, the service application can go into the suspended state. Basically, the service application is running on the background by its nature; so the platform does not allow the running of the service application unless it is designated as a background category application. However, when the UI application that is packaged with the service application is running in the foreground, the service application is also regarded as a foreground application and it can be run without a designated background category.

        Application state changes are managed by the underlying framework. - For more information about application state transitions, see Managing Application States and Transitions.

        + For more information about application state transitions, see Application States and Transitions.

        Starting the Tizen Native Application

        diff --git a/org.tizen.training/html/native/feature/app_battery_lifecycle_n.htm b/org.tizen.training/html/native/feature/app_battery_lifecycle_n.htm index fa66cb6..878c6db 100644 --- a/org.tizen.training/html/native/feature/app_battery_lifecycle_n.htm +++ b/org.tizen.training/html/native/feature/app_battery_lifecycle_n.htm @@ -83,7 +83,7 @@
        -

        Application state changes are managed by the underlying framework. For more information about application state transitions, see Managing Application States and Transitions.

        +

        Application state changes are managed by the underlying framework. For more information about application state transitions, see Application States and Transitions.

        Location Service Life-cycle

        diff --git a/org.tizen.training/html/native/process/setting_properties_n.htm b/org.tizen.training/html/native/process/setting_properties_n.htm index 163bb3d..eecf783 100644 --- a/org.tizen.training/html/native/process/setting_properties_n.htm +++ b/org.tizen.training/html/native/process/setting_properties_n.htm @@ -355,7 +355,7 @@
    • -
    • Add the background category type (since Tizen 2.4).

      You can describe the background category of your Tizen native application.

      To add background category types to allow running on the background, click + in the Background Category panel, select the category type, and click OK.

    • +
    • Add the background category type (since Tizen 2.4).

      You can describe the background category of your Tizen native application.

      To add background category types to allow running on the background, click + in the Background Category panel, select the category type, and click OK.

    • Add shortcuts.

      To add a shortcut for the application, click + in the Shortcut List panel, define the shortcut details, and click OK.